// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./SomaAccessControl/ISomaAccessControl.sol"; import "./SomaSwap/periphery/ISomaSwapRouter.sol"; import "./SomaSwap/core/interfaces/ISomaSwapFactory.sol"; import "./SomaGuard/ISomaGuard.sol"; import "./TemplateFactory/ITemplateFactory.sol"; import "./Lockdrop/ILockdropFactory.sol"; /** * @title SOMA Contract. * @author SOMA.finance * @notice Interface of the SOMA contract. */ interface ISOMA { /** * @notice Emitted when the SOMA snapshot is updated. * @param version The version of the new snapshot. * @param hash The hash of the new snapshot. * @param snapshot The new snapshot. */ event SOMAUpgraded(bytes32 indexed version, bytes32 indexed hash, bytes snapshot); /** * @notice Emitted when the `seizeTo` address is updated. * @param prevSeizeTo The address of the previous `seizeTo`. * @param newSeizeTo The address of the new `seizeTo`. * @param sender The address of the message sender. */ event SeizeToUpdated(address indexed prevSeizeTo, address indexed newSeizeTo, address indexed sender); /** * @notice Emitted when the `mintTo` address is updated. * @param prevMintTo The address of the previous `mintTo`. * @param newMintTo The address of the new `mintTo`. * @param sender The address of the message sender. */ event MintToUpdated(address indexed prevMintTo, address indexed newMintTo, address indexed sender); /** * @notice Snapshot of the SOMA contracts. * @param master The master address. * @param subMaster The subMaster address. * @param access The ISomaAccessControl contract. * @param guard The ISomaGuard contract. * @param factory The ITemplateFactory contract. * @param token The IERC20 contract. */ struct Snapshot { address master; address subMaster; address access; address guard; address factory; address token; } /** * @notice Returns the address that has been assigned the master role. */ function master() external view returns (address); /** * @notice Returns the address that has been assigned the subMaster role. */ function subMaster() external view returns (address); /** * @notice Returns the address of the {ISomaAccessControl} contract. */ function access() external view returns (address); /** * @notice Returns the address of the {ISomaGuard} contract. */ function guard() external view returns (address); /** * @notice Returns the address of the {ITemplateFactory} contract. */ function factory() external view returns (address); /** * @notice Returns the address of the {IERC20} contract. */ function token() external view returns (address); /** * @notice Returns the hash of the latest snapshot. */ function snapshotHash() external view returns (bytes32); /** * @notice Returns the latest snapshot version. */ function snapshotVersion() external view returns (bytes32); /** * @notice Returns the snapshot, given a snapshot hash. * @param hash The snapshot hash. * @return _snapshot The snapshot matching the `hash`. */ function snapshots(bytes32 hash) external view returns (bytes memory _snapshot); /** * @notice Returns the hash when given a version, returns a version when given a hash. * @param versionOrHash The version or hash. * @return hashOrVersion The hash or version based on the input. */ function versions(bytes32 versionOrHash) external view returns (bytes32 hashOrVersion); /** * @notice Returns the address that receives all minted tokens. */ function mintTo() external view returns (address); /** * @notice Returns the address that receives all seized tokens. */ function seizeTo() external view returns (address); /** * @notice Updates the current SOMA snapshot and is called after the proxy has been upgraded. * @param version The version to upgrade to. * @custom:emits SOMAUpgraded * @custom:requirement The incoming snapshot hash cannot be equal to the contract's existing snapshot hash. */ function __upgrade(bytes32 version) external; /** * @notice Triggers the SOMA paused state. Pauses all the SOMA contracts. * @custom:emits Paused * @custom:requirement SOMA must be already unpaused. * @custom:requirement The caller must be the master or subMaster. */ function pause() external; /** * @notice Triggers the SOMA unpaused state. Unpauses all the SOMA contracts. * @custom:emits Unpaused * @custom:requirement SOMA must be already paused. * @custom:requirement The caller must be the master or subMaster. */ function unpause() external; /** * @notice Sets the `mintTo` address to `_mintTo`. * @param _mintTo The address to be set as the `mintTo` address. * @custom:emits MintToUpdated * @custom:requirement The caller must be the master. */ function setMintTo(address _mintTo) external; /** * @notice Sets the `seizeTo` address to `_seizeTo`. * @param _seizeTo The address to be set as the `seizeTo` address. * @custom:emits SeizeToUpdated * @custom:requirement The caller must be the master. */ function setSeizeTo(address _seizeTo) external; /** * @notice Returns the current snapshot of the SOMA contracts. */ function snapshot() external view returns (Snapshot memory _snapshot); }