Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
Value | ||||
---|---|---|---|---|---|---|---|---|---|
0x60806040 | 16431885 | 539 days ago | IN | Create: STBT | 0 ETH | 0.04046516 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
STBT
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.0; import "@openzeppelin/contracts/proxy/Proxy.sol"; import "@openzeppelin/contracts/governance/TimelockController.sol"; import "./interfaces/ISTBT.sol"; contract StbtTimelockController is TimelockController { mapping (bytes4 => uint256) public delayMap; constructor( address[] memory proposers, address[] memory executors, address admin, bytes4[] memory selectors, uint256[] memory delays ) TimelockController(0/*minDelay*/, proposers, executors, admin) { require(selectors.length == delays.length, 'TimelockController: SELECTORS_DELAYS_LEN_NOT_MATCH'); for (uint256 i = 0; i < selectors.length; i++) { delayMap[selectors[i]] = delays[i]; } } function updateDelay(uint256 /*newDelay*/) external override pure { revert('TimelockController: UNSUPPORTED'); } function scheduleBatch( address[] calldata /*targets*/, uint256[] calldata /*values*/, bytes[] calldata /*payloads*/, bytes32 /*predecessor*/, bytes32 /*salt*/, uint256 /*delay*/ ) public override pure { revert('TimelockController: UNSUPPORTED'); } function schedule( address target, uint256 value, bytes calldata data, bytes32 predecessor, bytes32 salt, uint256 /*delay*/ ) public override onlyRole(PROPOSER_ROLE) { bytes4 sel = bytes4(data[0:4]); uint256 delay = delayMap[sel]; require(delay > 0, 'TimelockController: UNKNOWN_SELECTOR'); super.schedule(target, value, data, predecessor, salt, delay); } // function schedule2( // address target, // bytes calldata data, // bytes32 predecessor, // bytes32 salt // ) public { // schedule(target, 0, data, predecessor, salt, 0); // } // function cancelOperation( // address target, // uint256 value, // bytes calldata data, // bytes32 predecessor, // bytes32 salt // ) public onlyRole(CANCELLER_ROLE) { // bytes32 id = hashOperation(target, value, data, predecessor, salt); // cancel(id); // } function _execute( address target, uint256 value, bytes calldata data ) internal override { (bool success, ) = target.call{value: value}(data); if (success == false) { assembly { let ptr := mload(0x40) let size := returndatasize() returndatacopy(ptr, 0, size) revert(ptr, size) } } } } contract UpgradeableSTBT is Proxy { // override address public owner; address public issuer; address public controller; address public moderator; // new state below address public implementation; constructor( address _owner, address _issuer, address _controller, address _moderator, address _impl ){ owner = _owner; issuer = _issuer; controller = _controller; moderator = _moderator; implementation = _impl; } function resetImplementation(address _impl) external { require(msg.sender == owner, "STBT: NOT_OWNER"); implementation = _impl; } function _implementation() internal view override returns (address) { return implementation; } } contract STBT is Ownable, ISTBT { // all the following three roles are contracts of governance/TimelockController.sol address public issuer; address public controller; address public moderator; uint[300] public placeholders; uint public totalSupply; uint public totalShares; mapping(address => uint256) private shares; mapping(address => mapping(address => uint256)) private allowances; mapping(address => Permission) public permissions; // Address-specific transfer permissions uint64 public lastDistributeTime; uint64 public minDistributeInterval; uint64 public maxDistributeRatio; struct Document { bytes32 docHash; uint256 lastModified; string uri; } bytes32[] docNames; // doc name => doc detail mapping(bytes32 => Document) public documents; // doc name => doc name index in docNames mapping(bytes32 => uint256) public docIndexes; // EIP-1066 status code uint8 private constant Success = 0x01; uint8 private constant UpperLimit = 0x06; uint8 private constant PermissionRequested = 0x13; uint8 private constant RevokedOrBanned = 0x16; event InterestsDistributed(int interest, uint newTotalSupply, uint interestFromTime, uint interestToTime); event TransferShares(address indexed from, address indexed to, uint256 sharesValue); modifier onlyIssuer() { require(msg.sender == issuer, 'STBT: NOT_ISSUER'); _; } modifier onlyController() { require(msg.sender == controller, 'STBT: NOT_CONTROLLER'); _; } modifier onlyModerator() { require(msg.sender == moderator, 'STBT: NOT_MODERATOR'); _; } function setIssuer(address _issuer) public onlyOwner { issuer = _issuer; } function setController(address _controller) public onlyOwner { controller = _controller; } function setModerator(address _moderator) public onlyOwner { moderator = _moderator; } function setMinDistributeInterval(uint64 interval) public onlyOwner { minDistributeInterval = interval; } function setMaxDistributeRatio(uint64 ratio) public onlyOwner { maxDistributeRatio = ratio; } function setPermission(address addr, Permission calldata permission) public onlyModerator { permissions[addr] = permission; } function name() public pure returns (string memory) { return "Short-term Treasury Bill Token"; } function symbol() public pure returns (string memory) { return "STBT"; } function decimals() public pure returns (uint8) { return 18; } function balanceOf(address _account) public view returns (uint256) { return getAmountByShares(shares[_account]); } function transfer(address _recipient, uint256 _amount) public returns (bool) { _transferWithCheck(msg.sender, _recipient, _amount); return true; } function allowance(address _owner, address _spender) public view returns (uint256) { return allowances[_owner][_spender]; } function approve(address _spender, uint256 _amount) public returns (bool) { _approve(msg.sender, _spender, _amount); return true; } function transferFrom(address _sender, address _recipient, uint256 _amount) public returns (bool) { uint256 currentAllowance = allowances[_sender][msg.sender]; require(currentAllowance >= _amount, "STBT: TRANSFER_AMOUNT_EXCEEDS_ALLOWANCE"); _transferWithCheck(_sender, _recipient, _amount); _approve(_sender, msg.sender, currentAllowance - _amount); return true; } function increaseAllowance(address _spender, uint256 _addedValue) public returns (bool) { _approve(msg.sender, _spender, allowances[msg.sender][_spender] + _addedValue); return true; } function decreaseAllowance(address _spender, uint256 _subtractedValue) public returns (bool) { uint256 currentAllowance = allowances[msg.sender][_spender]; require(currentAllowance >= _subtractedValue, "STBT: DECREASED_ALLOWANCE_BELOW_ZERO"); _approve(msg.sender, _spender, currentAllowance - _subtractedValue); return true; } function sharesOf(address _account) public view returns (uint256) { return shares[_account]; } function getSharesByAmountRoundUp(uint256 _amount) public view returns (uint256 result) { uint _totalSupply = totalSupply; return _totalSupply == 0 ? 0 : (_amount * totalShares + _totalSupply - 1) / _totalSupply; } function getSharesByAmount(uint256 _amount) public view returns (uint256 result) { // unchecked { // result = _amount * totalShares / totalSupply; // divide-by-zero will return zero // } return totalSupply == 0 ? 0 : _amount * totalShares / totalSupply; } function getAmountByShares(uint256 _shares) public view returns (uint256 result) { // unchecked { // result = _shares * totalSupply / totalShares; // divide-by-zero will return zero // } return totalShares == 0 ? 0 : _shares * totalSupply / totalShares; } function _transferWithCheck(address _sender, address _recipient, uint256 _amount) internal { _checkSendPermission(_sender); _checkReceivePermission(_recipient); _transfer(_sender, _recipient, _amount); } function _checkSendPermission(address _sender) private view { Permission memory permTx = permissions[_sender]; require(permTx.sendAllowed, 'STBT: NO_SEND_PERMISSION'); require(permTx.expiryTime == 0 || permTx.expiryTime > block.timestamp, 'STBT: SEND_PERMISSION_EXPIRED'); } function _checkReceivePermission(address _recipient) private view { Permission memory permRx = permissions[_recipient]; require(permRx.receiveAllowed, 'STBT: NO_RECEIVE_PERMISSION'); require(permRx.expiryTime == 0 || permRx.expiryTime > block.timestamp, 'STBT: RECEIVE_PERMISSION_EXPIRED'); } function _transfer(address _sender, address _recipient, uint256 _amount) internal { uint256 _sharesToTransfer = getSharesByAmount(_amount); _transferShares(_sender, _recipient, _sharesToTransfer); emit Transfer(_sender, _recipient, getAmountByShares(_sharesToTransfer)); } function _approve(address _owner, address _spender, uint256 _amount) internal { allowances[_owner][_spender] = _amount; emit Approval(_owner, _spender, _amount); } function _transferShares(address _sender, address _recipient, uint256 _shares) internal { require(_sender != address(0), "STBT: TRANSFER_FROM_THE_ZERO_ADDRESS"); require(_recipient != address(0), "STBT: TRANSFER_TO_THE_ZERO_ADDRESS"); uint256 currentSenderShares = shares[_sender]; require(_shares <= currentSenderShares, "STBT: TRANSFER_AMOUNT_EXCEEDS_BALANCE"); shares[_sender] = currentSenderShares - _shares; shares[_recipient] = shares[_recipient] + _shares; emit TransferShares(_sender, _recipient, _shares); } function _mintSharesWithCheck(address _recipient, uint256 _shares) internal returns (uint256 newTotalShares) { require(_recipient != address(0), "STBT: MINT_TO_THE_ZERO_ADDRESS"); _checkReceivePermission(_recipient); totalShares += _shares; shares[_recipient] += _shares; emit TransferShares(address(0), _recipient, _shares); return totalShares; } function _burnSharesWithCheck(address _account, uint256 _shares) internal returns (uint256 newTotalShares) { _checkSendPermission(_account); return _burnShares(_account, _shares); } function _burnShares(address _account, uint256 _shares) internal returns (uint256 newTotalShares) { require(_account != address(0), "STBT: BURN_FROM_THE_ZERO_ADDRESS"); uint256 accountShares = shares[_account]; require(_shares <= accountShares, "STBT: BURN_AMOUNT_EXCEEDS_BALANCE"); newTotalShares = totalShares - _shares; totalShares = newTotalShares; shares[_account] = accountShares - _shares; emit TransferShares(_account, address(0), _shares); } function distributeInterests(int256 _distributedInterest, uint interestFromTime, uint interestToTime) external onlyIssuer { uint oldTotalSupply = totalSupply; uint newTotalSupply; if(_distributedInterest > 0) { require(oldTotalSupply * maxDistributeRatio >= uint(_distributedInterest) * (10 ** 18), 'STBT: MAX_DISTRIBUTE_RATIO_EXCEEDED'); newTotalSupply = oldTotalSupply + uint(_distributedInterest); } else { require(oldTotalSupply * maxDistributeRatio >= uint(-_distributedInterest) * (10 ** 18), 'STBT: MAX_DISTRIBUTE_RATIO_EXCEEDED'); newTotalSupply = oldTotalSupply - uint(-_distributedInterest); } totalSupply = newTotalSupply; require(lastDistributeTime + minDistributeInterval < block.timestamp, 'STBT: MIN_DISTRIBUTE_INTERVAL_VIOLATED'); emit InterestsDistributed(_distributedInterest, newTotalSupply, interestFromTime, interestToTime); lastDistributeTime = uint64(block.timestamp); } function isControllable() external pure returns (bool) { return true; } function controllerTransfer(address _from, address _to, uint256 _value, bytes calldata _data, bytes calldata _operatorData) external onlyController { _transfer(_from, _to, _value); emit ControllerTransfer(msg.sender, _from, _to, _value, _data, _operatorData); } function controllerRedeem(address _tokenHolder, uint256 _value, bytes calldata _data, bytes calldata _operatorData) external onlyController { uint sharesDelta = getSharesByAmountRoundUp(_value); _burnShares(_tokenHolder, sharesDelta); totalSupply -= _value; _value = getAmountByShares(sharesDelta); emit ControllerRedemption(msg.sender, _tokenHolder, _value, _data, _operatorData); emit Transfer(_tokenHolder, address(0), _value); } // Transfers function transferWithData(address _to, uint256 _value, bytes calldata /*_data*/) external { transfer(_to, _value); } function transferFromWithData(address _from, address _to, uint256 _value, bytes calldata /*_data*/) external { transferFrom(_from, _to, _value); } // Token Issuance function isIssuable() external pure returns (bool) { return true; } function issue(address _tokenHolder, uint256 _value, bytes calldata _data) external onlyIssuer { if (_value == 0) { return; } uint sharesDelta = getSharesByAmount(_value); if (sharesDelta == 0) { sharesDelta = _value; totalSupply = _value; lastDistributeTime = uint64(block.timestamp); } else { totalSupply += _value; } _mintSharesWithCheck(_tokenHolder, sharesDelta); _value = getAmountByShares(sharesDelta); emit Issued(msg.sender, _tokenHolder, _value, _data); emit Transfer(address(0), _tokenHolder, _value); } // Token Redemption function redeem(uint256 _value, bytes calldata _data) external onlyIssuer { if (_value == 0) { return; } uint sharesDelta = getSharesByAmountRoundUp(_value); _burnSharesWithCheck(msg.sender, sharesDelta); totalSupply -= _value; _value = getAmountByShares(sharesDelta); emit Redeemed(msg.sender, msg.sender, _value, _data); emit Transfer(msg.sender, address(0), _value); } function redeemFrom(address _tokenHolder, uint256 _value, bytes calldata _data) external onlyIssuer { uint256 currentAllowance = allowances[_tokenHolder][msg.sender]; require(currentAllowance >= _value, "STBT: REDEEM_AMOUNT_EXCEEDS_ALLOWANCE"); uint sharesDelta = getSharesByAmountRoundUp(_value); _burnSharesWithCheck(_tokenHolder, sharesDelta); totalSupply -= _value; _value = getAmountByShares(sharesDelta); emit Redeemed(msg.sender, _tokenHolder, _value, _data); emit Transfer(_tokenHolder, address(0), _value); _approve(_tokenHolder, msg.sender, currentAllowance - _value); } function _checkTransfer(address _sender, address _recipient, uint256 _amount, bytes calldata /*_data*/) internal view returns (bool, uint8, bytes32) { Permission memory permTx = permissions[_sender]; Permission memory permRx = permissions[_recipient]; bool txOK = permTx.sendAllowed && (permTx.expiryTime == 0 || permTx.expiryTime > block.timestamp) && _sender != address(0); if (!txOK) { return (false, PermissionRequested, bytes32(bytes("CANNOT_SEND"))); } bool rxOK = permRx.receiveAllowed && (permRx.expiryTime == 0 || permRx.expiryTime > block.timestamp) && _recipient != address(0); if (!rxOK) { return (false, PermissionRequested, bytes32(bytes("CANNOT_RECEIVE"))); } uint256 _shares = getSharesByAmount(_amount); uint256 currentSenderShares = shares[_sender]; if (_shares > currentSenderShares) { return (false, UpperLimit, bytes32(bytes("SHARES_NOT_ENOUGH"))); } return (true, Success, bytes32(0)); } function canTransfer(address _recipient, uint256 _amount, bytes calldata _data) external view returns (bool, uint8, bytes32) { return _checkTransfer(msg.sender, _recipient, _amount, _data); } function canTransferFrom(address _sender, address _recipient, uint256 _amount, bytes calldata _data) external view returns (bool, uint8, bytes32) { uint256 currentAllowance = allowances[_sender][msg.sender]; if (_amount > currentAllowance) { return (false, UpperLimit, bytes32(bytes("ALLOWANCE_NOT_ENOUGH"))); } return _checkTransfer(_sender, _recipient, _amount, _data); } function setDocument(bytes32 _name, string calldata _uri, bytes32 _documentHash) external onlyOwner { require(_name != bytes32(0), "STBT: INVALID_DOC_NAME"); require(bytes(_uri).length > 0, "STBT: INVALID_URL"); if (documents[_name].lastModified == uint256(0)) { docNames.push(_name); docIndexes[_name] = docNames.length; } documents[_name] = Document(_documentHash, block.timestamp, _uri); emit DocumentUpdated(_name, _uri, _documentHash); } function removeDocument(bytes32 _name) external onlyOwner { require(documents[_name].lastModified != uint256(0), "STBT: DOC_NOT_EXIST"); uint256 index = docIndexes[_name] - 1; if (index != docNames.length - 1) { docNames[index] = docNames[docNames.length - 1]; docIndexes[docNames[index]] = index + 1; } docNames.pop(); delete documents[_name]; emit DocumentRemoved(_name, documents[_name].uri, documents[_name].docHash); } function getDocument(bytes32 _name) external view returns (string memory, bytes32, uint256) { return ( documents[_name].uri, documents[_name].docHash, documents[_name].lastModified ); } function getAllDocuments() external view returns (bytes32[] memory) { return docNames; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(account), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (governance/TimelockController.sol) pragma solidity ^0.8.0; import "../access/AccessControl.sol"; import "../token/ERC721/IERC721Receiver.sol"; import "../token/ERC1155/IERC1155Receiver.sol"; import "../utils/Address.sol"; /** * @dev Contract module which acts as a timelocked controller. When set as the * owner of an `Ownable` smart contract, it enforces a timelock on all * `onlyOwner` maintenance operations. This gives time for users of the * controlled contract to exit before a potentially dangerous maintenance * operation is applied. * * By default, this contract is self administered, meaning administration tasks * have to go through the timelock process. The proposer (resp executor) role * is in charge of proposing (resp executing) operations. A common use case is * to position this {TimelockController} as the owner of a smart contract, with * a multisig or a DAO as the sole proposer. * * _Available since v3.3._ */ contract TimelockController is AccessControl, IERC721Receiver, IERC1155Receiver { bytes32 public constant TIMELOCK_ADMIN_ROLE = keccak256("TIMELOCK_ADMIN_ROLE"); bytes32 public constant PROPOSER_ROLE = keccak256("PROPOSER_ROLE"); bytes32 public constant EXECUTOR_ROLE = keccak256("EXECUTOR_ROLE"); bytes32 public constant CANCELLER_ROLE = keccak256("CANCELLER_ROLE"); uint256 internal constant _DONE_TIMESTAMP = uint256(1); mapping(bytes32 => uint256) private _timestamps; uint256 private _minDelay; /** * @dev Emitted when a call is scheduled as part of operation `id`. */ event CallScheduled( bytes32 indexed id, uint256 indexed index, address target, uint256 value, bytes data, bytes32 predecessor, uint256 delay ); /** * @dev Emitted when a call is performed as part of operation `id`. */ event CallExecuted(bytes32 indexed id, uint256 indexed index, address target, uint256 value, bytes data); /** * @dev Emitted when operation `id` is cancelled. */ event Cancelled(bytes32 indexed id); /** * @dev Emitted when the minimum delay for future operations is modified. */ event MinDelayChange(uint256 oldDuration, uint256 newDuration); /** * @dev Initializes the contract with the following parameters: * * - `minDelay`: initial minimum delay for operations * - `proposers`: accounts to be granted proposer and canceller roles * - `executors`: accounts to be granted executor role * - `admin`: optional account to be granted admin role; disable with zero address * * IMPORTANT: The optional admin can aid with initial configuration of roles after deployment * without being subject to delay, but this role should be subsequently renounced in favor of * administration through timelocked proposals. Previous versions of this contract would assign * this admin to the deployer automatically and should be renounced as well. */ constructor( uint256 minDelay, address[] memory proposers, address[] memory executors, address admin ) { _setRoleAdmin(TIMELOCK_ADMIN_ROLE, TIMELOCK_ADMIN_ROLE); _setRoleAdmin(PROPOSER_ROLE, TIMELOCK_ADMIN_ROLE); _setRoleAdmin(EXECUTOR_ROLE, TIMELOCK_ADMIN_ROLE); _setRoleAdmin(CANCELLER_ROLE, TIMELOCK_ADMIN_ROLE); // self administration _setupRole(TIMELOCK_ADMIN_ROLE, address(this)); // optional admin if (admin != address(0)) { _setupRole(TIMELOCK_ADMIN_ROLE, admin); } // register proposers and cancellers for (uint256 i = 0; i < proposers.length; ++i) { _setupRole(PROPOSER_ROLE, proposers[i]); _setupRole(CANCELLER_ROLE, proposers[i]); } // register executors for (uint256 i = 0; i < executors.length; ++i) { _setupRole(EXECUTOR_ROLE, executors[i]); } _minDelay = minDelay; emit MinDelayChange(0, minDelay); } /** * @dev Modifier to make a function callable only by a certain role. In * addition to checking the sender's role, `address(0)` 's role is also * considered. Granting a role to `address(0)` is equivalent to enabling * this role for everyone. */ modifier onlyRoleOrOpenRole(bytes32 role) { if (!hasRole(role, address(0))) { _checkRole(role, _msgSender()); } _; } /** * @dev Contract might receive/hold ETH as part of the maintenance process. */ receive() external payable {} /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, AccessControl) returns (bool) { return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns whether an id correspond to a registered operation. This * includes both Pending, Ready and Done operations. */ function isOperation(bytes32 id) public view virtual returns (bool registered) { return getTimestamp(id) > 0; } /** * @dev Returns whether an operation is pending or not. */ function isOperationPending(bytes32 id) public view virtual returns (bool pending) { return getTimestamp(id) > _DONE_TIMESTAMP; } /** * @dev Returns whether an operation is ready or not. */ function isOperationReady(bytes32 id) public view virtual returns (bool ready) { uint256 timestamp = getTimestamp(id); return timestamp > _DONE_TIMESTAMP && timestamp <= block.timestamp; } /** * @dev Returns whether an operation is done or not. */ function isOperationDone(bytes32 id) public view virtual returns (bool done) { return getTimestamp(id) == _DONE_TIMESTAMP; } /** * @dev Returns the timestamp at with an operation becomes ready (0 for * unset operations, 1 for done operations). */ function getTimestamp(bytes32 id) public view virtual returns (uint256 timestamp) { return _timestamps[id]; } /** * @dev Returns the minimum delay for an operation to become valid. * * This value can be changed by executing an operation that calls `updateDelay`. */ function getMinDelay() public view virtual returns (uint256 duration) { return _minDelay; } /** * @dev Returns the identifier of an operation containing a single * transaction. */ function hashOperation( address target, uint256 value, bytes calldata data, bytes32 predecessor, bytes32 salt ) public pure virtual returns (bytes32 hash) { return keccak256(abi.encode(target, value, data, predecessor, salt)); } /** * @dev Returns the identifier of an operation containing a batch of * transactions. */ function hashOperationBatch( address[] calldata targets, uint256[] calldata values, bytes[] calldata payloads, bytes32 predecessor, bytes32 salt ) public pure virtual returns (bytes32 hash) { return keccak256(abi.encode(targets, values, payloads, predecessor, salt)); } /** * @dev Schedule an operation containing a single transaction. * * Emits a {CallScheduled} event. * * Requirements: * * - the caller must have the 'proposer' role. */ function schedule( address target, uint256 value, bytes calldata data, bytes32 predecessor, bytes32 salt, uint256 delay ) public virtual onlyRole(PROPOSER_ROLE) { bytes32 id = hashOperation(target, value, data, predecessor, salt); _schedule(id, delay); emit CallScheduled(id, 0, target, value, data, predecessor, delay); } /** * @dev Schedule an operation containing a batch of transactions. * * Emits one {CallScheduled} event per transaction in the batch. * * Requirements: * * - the caller must have the 'proposer' role. */ function scheduleBatch( address[] calldata targets, uint256[] calldata values, bytes[] calldata payloads, bytes32 predecessor, bytes32 salt, uint256 delay ) public virtual onlyRole(PROPOSER_ROLE) { require(targets.length == values.length, "TimelockController: length mismatch"); require(targets.length == payloads.length, "TimelockController: length mismatch"); bytes32 id = hashOperationBatch(targets, values, payloads, predecessor, salt); _schedule(id, delay); for (uint256 i = 0; i < targets.length; ++i) { emit CallScheduled(id, i, targets[i], values[i], payloads[i], predecessor, delay); } } /** * @dev Schedule an operation that is to becomes valid after a given delay. */ function _schedule(bytes32 id, uint256 delay) private { require(!isOperation(id), "TimelockController: operation already scheduled"); require(delay >= getMinDelay(), "TimelockController: insufficient delay"); _timestamps[id] = block.timestamp + delay; } /** * @dev Cancel an operation. * * Requirements: * * - the caller must have the 'canceller' role. */ function cancel(bytes32 id) public virtual onlyRole(CANCELLER_ROLE) { require(isOperationPending(id), "TimelockController: operation cannot be cancelled"); delete _timestamps[id]; emit Cancelled(id); } /** * @dev Execute an (ready) operation containing a single transaction. * * Emits a {CallExecuted} event. * * Requirements: * * - the caller must have the 'executor' role. */ // This function can reenter, but it doesn't pose a risk because _afterCall checks that the proposal is pending, // thus any modifications to the operation during reentrancy should be caught. // slither-disable-next-line reentrancy-eth function execute( address target, uint256 value, bytes calldata payload, bytes32 predecessor, bytes32 salt ) public payable virtual onlyRoleOrOpenRole(EXECUTOR_ROLE) { bytes32 id = hashOperation(target, value, payload, predecessor, salt); _beforeCall(id, predecessor); _execute(target, value, payload); emit CallExecuted(id, 0, target, value, payload); _afterCall(id); } /** * @dev Execute an (ready) operation containing a batch of transactions. * * Emits one {CallExecuted} event per transaction in the batch. * * Requirements: * * - the caller must have the 'executor' role. */ function executeBatch( address[] calldata targets, uint256[] calldata values, bytes[] calldata payloads, bytes32 predecessor, bytes32 salt ) public payable virtual onlyRoleOrOpenRole(EXECUTOR_ROLE) { require(targets.length == values.length, "TimelockController: length mismatch"); require(targets.length == payloads.length, "TimelockController: length mismatch"); bytes32 id = hashOperationBatch(targets, values, payloads, predecessor, salt); _beforeCall(id, predecessor); for (uint256 i = 0; i < targets.length; ++i) { address target = targets[i]; uint256 value = values[i]; bytes calldata payload = payloads[i]; _execute(target, value, payload); emit CallExecuted(id, i, target, value, payload); } _afterCall(id); } /** * @dev Execute an operation's call. */ function _execute( address target, uint256 value, bytes calldata data ) internal virtual { (bool success, ) = target.call{value: value}(data); require(success, "TimelockController: underlying transaction reverted"); } /** * @dev Checks before execution of an operation's calls. */ function _beforeCall(bytes32 id, bytes32 predecessor) private view { require(isOperationReady(id), "TimelockController: operation is not ready"); require(predecessor == bytes32(0) || isOperationDone(predecessor), "TimelockController: missing dependency"); } /** * @dev Checks after execution of an operation's calls. */ function _afterCall(bytes32 id) private { require(isOperationReady(id), "TimelockController: operation is not ready"); _timestamps[id] = _DONE_TIMESTAMP; } /** * @dev Changes the minimum timelock duration for future operations. * * Emits a {MinDelayChange} event. * * Requirements: * * - the caller must be the timelock itself. This can only be achieved by scheduling and later executing * an operation where the timelock is the target and the data is the ABI-encoded call to this function. */ function updateDelay(uint256 newDelay) external virtual { require(msg.sender == address(this), "TimelockController: caller must be timelock"); emit MinDelayChange(_minDelay, newDelay); _minDelay = newDelay; } /** * @dev See {IERC721Receiver-onERC721Received}. */ function onERC721Received( address, address, uint256, bytes memory ) public virtual override returns (bytes4) { return this.onERC721Received.selector; } /** * @dev See {IERC1155Receiver-onERC1155Received}. */ function onERC1155Received( address, address, uint256, uint256, bytes memory ) public virtual override returns (bytes4) { return this.onERC1155Received.selector; } /** * @dev See {IERC1155Receiver-onERC1155BatchReceived}. */ function onERC1155BatchReceived( address, address, uint256[] memory, uint256[] memory, bytes memory ) public virtual override returns (bytes4) { return this.onERC1155BatchReceived.selector; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../token/ERC20/extensions/IERC20Metadata.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol) pragma solidity ^0.8.0; /** * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to * be specified by overriding the virtual {_implementation} function. * * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a * different contract through the {_delegate} function. * * The success and return data of the delegated call will be returned back to the caller of the proxy. */ abstract contract Proxy { /** * @dev Delegates the current call to `implementation`. * * This function does not return to its internal call site, it will return directly to the external caller. */ function _delegate(address implementation) internal virtual { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function * and {_fallback} should delegate. */ function _implementation() internal view virtual returns (address); /** * @dev Delegates the current call to the address returned by `_implementation()`. * * This function does not return to its internal call site, it will return directly to the external caller. */ function _fallback() internal virtual { _beforeFallback(); _delegate(_implementation()); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other * function in the contract matches the call data. */ fallback() external payable virtual { _fallback(); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data * is empty. */ receive() external payable virtual { _fallback(); } /** * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback` * call, or as part of the Solidity `fallback` or `receive` functions. * * If overridden should call `super._beforeFallback()`. */ function _beforeFallback() internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/interfaces/IERC20Metadata.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; interface IERC1644 is IERC20 { // Controller Events event ControllerTransfer( address _controller, address indexed _from, address indexed _to, uint256 _value, bytes _data, bytes _operatorData ); event ControllerRedemption( address _controller, address indexed _tokenHolder, uint256 _value, bytes _data, bytes _operatorData ); // Controller Operation function isControllable() external view returns (bool); function controllerTransfer(address _from, address _to, uint256 _value, bytes calldata _data, bytes calldata _operatorData) external; function controllerRedeem(address _tokenHolder, uint256 _value, bytes calldata _data, bytes calldata _operatorData) external; } interface IERC1643 { // Document Events event DocumentRemoved(bytes32 indexed _name, string _uri, bytes32 _documentHash); event DocumentUpdated(bytes32 indexed _name, string _uri, bytes32 _documentHash); // Document Management function getDocument(bytes32 _name) external view returns (string memory, bytes32, uint256); function setDocument(bytes32 _name, string calldata _uri, bytes32 _documentHash) external; function removeDocument(bytes32 _name) external; function getAllDocuments() external view returns (bytes32[] memory); } interface IERC1594 is IERC20 { // Issuance / Redemption Events event Issued(address indexed _operator, address indexed _to, uint256 _value, bytes _data); event Redeemed(address indexed _operator, address indexed _from, uint256 _value, bytes _data); // Transfers function transferWithData(address _to, uint256 _value, bytes calldata _data) external; function transferFromWithData(address _from, address _to, uint256 _value, bytes calldata _data) external; // Token Issuance function isIssuable() external view returns (bool); function issue(address _tokenHolder, uint256 _value, bytes calldata _data) external; // Token Redemption function redeem(uint256 _value, bytes calldata _data) external; function redeemFrom(address _tokenHolder, uint256 _value, bytes calldata _data) external; // Transfer Validity function canTransfer(address _to, uint256 _value, bytes calldata _data) external view returns (bool, uint8, bytes32); function canTransferFrom(address _from, address _to, uint256 _value, bytes calldata _data) external view returns (bool, uint8, bytes32); } interface ISTBT is IERC20, IERC20Metadata, IERC1594, IERC1643, IERC1644 { struct Permission { bool sendAllowed; // default: true bool receiveAllowed; // Address holder’s KYC will be validated till this time, after that the holder needs to re-KYC. uint64 expiryTime; // default:0 validated forever } function setIssuer(address _issuer) external; function setController(address _controller) external; function setModerator(address _moderator) external; function setMinDistributeInterval(uint64 interval) external; function setMaxDistributeRatio(uint64 ratio) external; function setPermission(address addr, Permission calldata permission) external; function distributeInterests(int256 _distributedInterest, uint interestFromTime, uint interestToTime) external; function increaseAllowance(address _spender, uint256 _addedValue) external returns (bool); function decreaseAllowance(address _spender, uint256 _subtractedValue) external returns (bool); function sharesOf(address _account) external view returns (uint256); function getSharesByAmount(uint256 _amount) external view returns (uint256 result); function getAmountByShares(uint256 _shares) external view returns (uint256 result); }
{ "optimizer": { "enabled": true, "runs": 1000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_controller","type":"address"},{"indexed":true,"internalType":"address","name":"_tokenHolder","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"_data","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"_operatorData","type":"bytes"}],"name":"ControllerRedemption","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_controller","type":"address"},{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"_data","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"_operatorData","type":"bytes"}],"name":"ControllerTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"_name","type":"bytes32"},{"indexed":false,"internalType":"string","name":"_uri","type":"string"},{"indexed":false,"internalType":"bytes32","name":"_documentHash","type":"bytes32"}],"name":"DocumentRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"_name","type":"bytes32"},{"indexed":false,"internalType":"string","name":"_uri","type":"string"},{"indexed":false,"internalType":"bytes32","name":"_documentHash","type":"bytes32"}],"name":"DocumentUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"int256","name":"interest","type":"int256"},{"indexed":false,"internalType":"uint256","name":"newTotalSupply","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"interestFromTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"interestToTime","type":"uint256"}],"name":"InterestsDistributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_operator","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"_data","type":"bytes"}],"name":"Issued","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_operator","type":"address"},{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"_data","type":"bytes"}],"name":"Redeemed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"sharesValue","type":"uint256"}],"name":"TransferShares","type":"event"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_spender","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"canTransfer","outputs":[{"internalType":"bool","name":"","type":"bool"},{"internalType":"uint8","name":"","type":"uint8"},{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"},{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"canTransferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"},{"internalType":"uint8","name":"","type":"uint8"},{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenHolder","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"},{"internalType":"bytes","name":"_operatorData","type":"bytes"}],"name":"controllerRedeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"},{"internalType":"bytes","name":"_operatorData","type":"bytes"}],"name":"controllerTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"_spender","type":"address"},{"internalType":"uint256","name":"_subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"int256","name":"_distributedInterest","type":"int256"},{"internalType":"uint256","name":"interestFromTime","type":"uint256"},{"internalType":"uint256","name":"interestToTime","type":"uint256"}],"name":"distributeInterests","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"docIndexes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"documents","outputs":[{"internalType":"bytes32","name":"docHash","type":"bytes32"},{"internalType":"uint256","name":"lastModified","type":"uint256"},{"internalType":"string","name":"uri","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllDocuments","outputs":[{"internalType":"bytes32[]","name":"","type":"bytes32[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_shares","type":"uint256"}],"name":"getAmountByShares","outputs":[{"internalType":"uint256","name":"result","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_name","type":"bytes32"}],"name":"getDocument","outputs":[{"internalType":"string","name":"","type":"string"},{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"getSharesByAmount","outputs":[{"internalType":"uint256","name":"result","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"getSharesByAmountRoundUp","outputs":[{"internalType":"uint256","name":"result","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_spender","type":"address"},{"internalType":"uint256","name":"_addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isControllable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"isIssuable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenHolder","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"issue","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"issuer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastDistributeTime","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxDistributeRatio","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minDistributeInterval","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"moderator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"permissions","outputs":[{"internalType":"bool","name":"sendAllowed","type":"bool"},{"internalType":"bool","name":"receiveAllowed","type":"bool"},{"internalType":"uint64","name":"expiryTime","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"placeholders","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"redeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenHolder","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"redeemFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_name","type":"bytes32"}],"name":"removeDocument","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_controller","type":"address"}],"name":"setController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_name","type":"bytes32"},{"internalType":"string","name":"_uri","type":"string"},{"internalType":"bytes32","name":"_documentHash","type":"bytes32"}],"name":"setDocument","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_issuer","type":"address"}],"name":"setIssuer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"ratio","type":"uint64"}],"name":"setMaxDistributeRatio","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"interval","type":"uint64"}],"name":"setMinDistributeInterval","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_moderator","type":"address"}],"name":"setModerator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"},{"components":[{"internalType":"bool","name":"sendAllowed","type":"bool"},{"internalType":"bool","name":"receiveAllowed","type":"bool"},{"internalType":"uint64","name":"expiryTime","type":"uint64"}],"internalType":"struct ISTBT.Permission","name":"permission","type":"tuple"}],"name":"setPermission","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"sharesOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"totalShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"},{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"transferFromWithData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"transferWithData","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b613174806200007f6000396000f3fe608060405234801561001057600080fd5b50600436106103415760003560e01c80634c783bf5116101bd578063a457c2d7116100f9578063dd62ed3e116100a2578063f282527a1161007c578063f282527a1461080d578063f2fde38b14610820578063f5eb42dc14610833578063f77c47911461085d57600080fd5b8063dd62ed3e146107ad578063e77c646d146107e7578063ee532f31146107fa57600080fd5b8063bb3acde9116100d3578063bb3acde914610774578063c350184814610787578063d2e494bc1461079a57600080fd5b8063a457c2d71461072c578063a9059cbb1461073f578063b10d6b411461075257600080fd5b806388206fe11161016657806392eefe9b1161014057806392eefe9b146106b857806395d89b41146106cb5780639675193c146107045780639fa5f50b1461071757600080fd5b806388206fe1146106735780638da5cb5b146106945780638db8df7f146106a557600080fd5b806370a082311161019757806370a0823114610645578063715018a61461065857806375bba1891461066057600080fd5b80634c783bf51461056557806355cc4e571461061f57806360588f9d1461063257600080fd5b80632b2805db1161028c57806338743904116102355780633cf6bcfe1161020f5780633cf6bcfe146105d157806346f60da7146105e657806347e640c0146105f95780634b8fb92f1461060c57600080fd5b806338743904146105a157806339509351146105b45780633a98ef39146105c757600080fd5b8063313ce56711610266578063313ce5671461056c578063322e654e1461057b57806332574d711461058e57600080fd5b80632b2805db146105305780632bc6acc3146105525780632f1cae851461056557600080fd5b806318160ddd116102ee57806322c34c0b116102c857806322c34c0b146104d557806323b872dd1461050a5780632535f7621461051d57600080fd5b806318160ddd1461048d5780631badb25c146104975780631d143848146104aa57600080fd5b8063095ea7b31161031f578063095ea7b3146104095780630986902f1461042c578063122eb5751461045b57600080fd5b8063010648ca1461034657806301e882081461035b57806306fdde03146103c7575b600080fd5b6103596103543660046127f7565b610870565b005b61039b610369366004612866565b6101346020526000908152604090205460ff8082169161010081049091169062010000900467ffffffffffffffff1683565b604080519315158452911515602084015267ffffffffffffffff16908201526060015b60405180910390f35b60408051808201909152601e81527f53686f72742d7465726d2054726561737572792042696c6c20546f6b656e000060208201525b6040516103be91906128c7565b61041c6104173660046128da565b610a39565b60405190151581526020016103be565b61044d61043a366004612904565b6101386020526000908152604090205481565b6040519081526020016103be565b61046e61046936600461291d565b610a50565b60408051931515845260ff9092166020840152908201526060016103be565b61044d6101305481565b61046e6104a536600461298c565b610af0565b6001546104bd906001600160a01b031681565b6040516001600160a01b0390911681526020016103be565b610135546104f190600160801b900467ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016103be565b61041c6105183660046129e6565b610b12565b61035961052b36600461298c565b610bd7565b61054361053e366004612904565b610be8565b6040516103be93929190612a22565b610359610560366004612a4a565b610c94565b600161041c565b604051601281526020016103be565b610359610589366004612aea565b610dc0565b61035961059c366004612b07565b610e10565b6003546104bd906001600160a01b031681565b61041c6105c23660046128da565b6110c9565b61044d6101315481565b610135546104f19067ffffffffffffffff1681565b61044d6105f4366004612904565b611101565b610359610607366004612b33565b611119565b61044d61061a366004612904565b61119e565b61035961062d366004612866565b6111d4565b61044d610640366004612904565b61120b565b61044d610653366004612866565b61122a565b61035961124d565b61035961066e366004612866565b611261565b610135546104f19068010000000000000000900467ffffffffffffffff1681565b6000546001600160a01b03166104bd565b6103596106b3366004612aea565b611298565b6103596106c6366004612866565b6112e3565b60408051808201909152600481527f535442540000000000000000000000000000000000000000000000000000000060208201526103fc565b61035961071236600461298c565b61131a565b61071f6114e5565b6040516103be9190612b72565b61041c61073a3660046128da565b61153e565b61041c61074d3660046128da565b6115f1565b610765610760366004612904565b6115fe565b6040516103be93929190612bb6565b61035961078236600461298c565b6116ba565b610359610795366004612904565b611813565b61044d6107a8366004612904565b6119e5565b61044d6107bb366004612bdb565b6001600160a01b0391821660009081526101336020908152604080832093909416825291909152205490565b6103596107f5366004612c0e565b611a32565b61035961080836600461291d565b611b50565b61035961081b366004612c5a565b611b5b565b61035961082e366004612866565b611c0d565b61044d610841366004612866565b6001600160a01b03166000908152610132602052604090205490565b6002546104bd906001600160a01b031681565b610878611c9d565b836108ca5760405162461bcd60e51b815260206004820152601660248201527f535442543a20494e56414c49445f444f435f4e414d450000000000000000000060448201526064015b60405180910390fd5b816109175760405162461bcd60e51b815260206004820152601160248201527f535442543a20494e56414c49445f55524c00000000000000000000000000000060448201526064016108c1565b600084815261013760205260409020600101546109705761013680546001810182557f39da2db355130acf428d669fbf1c14faa9d51399a25b793fc254bbbde66f02e20185905554600085815261013860205260409020555b604051806060016040528082815260200142815260200184848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250508681526101376020908152604091829020845181559084015160018201559083015190915060028201906109f39082612d8b565b50905050837fb4c22d60cd550a815744f04e3ff5278bf19684565ee00e2b084041b6024bd6f6848484604051610a2b93929190612e74565b60405180910390a250505050565b6000610a46338484611cf7565b5060015b92915050565b6001600160a01b0385166000908152610133602090815260408083203384529091528120548190819080871115610ad057600060066040518060400160405280601481526020017f414c4c4f57414e43455f4e4f545f454e4f554748000000000000000000000000815250610ac490612e98565b93509350935050610ae5565b610add8989898989611d59565b935093509350505b955095509592505050565b6000806000610b023388888888611d59565b9250925092509450945094915050565b6001600160a01b03831660009081526101336020908152604080832033845290915281205482811015610bad5760405162461bcd60e51b815260206004820152602760248201527f535442543a205452414e534645525f414d4f554e545f455843454544535f414c60448201527f4c4f57414e43450000000000000000000000000000000000000000000000000060648201526084016108c1565b610bb8858585611fca565b610bcc8533610bc78685612ed2565b611cf7565b506001949350505050565b610be184846115f1565b5050505050565b6101376020526000908152604090208054600182015460028301805492939192610c1190612d0b565b80601f0160208091040260200160405190810160405280929190818152602001828054610c3d90612d0b565b8015610c8a5780601f10610c5f57610100808354040283529160200191610c8a565b820191906000526020600020905b815481529060010190602001808311610c6d57829003601f168201915b5050505050905083565b6002546001600160a01b03163314610cee5760405162461bcd60e51b815260206004820152601460248201527f535442543a204e4f545f434f4e54524f4c4c455200000000000000000000000060448201526064016108c1565b6000610cf9866119e5565b9050610d058782611fe7565b50856101306000828254610d199190612ed2565b90915550610d2890508161120b565b9550866001600160a01b03167f876b7cb47aa150b3a5516188b19ed308752ad4d0ae9a702543353b78163f7589338888888888604051610d6d96959493929190612ee5565b60405180910390a26040518681526000906001600160a01b038916907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020015b60405180910390a350505050505050565b610dc8611c9d565b610135805467ffffffffffffffff90921668010000000000000000027fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff909216919091179055565b6001546001600160a01b03163314610e5d5760405162461bcd60e51b815260206004820152601060248201526f29aa212a1d102727aa2fa4a9a9aaa2a960811b60448201526064016108c1565b61013054600080851315610f0757610e7d85670de0b6b3a7640000612f2e565b61013554610e9c90600160801b900467ffffffffffffffff1684612f2e565b1015610ef65760405162461bcd60e51b815260206004820152602360248201527f535442543a204d41585f444953545249425554455f524154494f5f455843454560448201526211115160ea1b60648201526084016108c1565b610f008583612f45565b9050610fb1565b610f1085612f58565b610f2290670de0b6b3a7640000612f2e565b61013554610f4190600160801b900467ffffffffffffffff1684612f2e565b1015610f9b5760405162461bcd60e51b815260206004820152602360248201527f535442543a204d41585f444953545249425554455f524154494f5f455843454560448201526211115160ea1b60648201526084016108c1565b610fa485612f58565b610fae9083612ed2565b90505b610130819055610135544290610fdf9067ffffffffffffffff68010000000000000000820481169116612f90565b67ffffffffffffffff161061105c5760405162461bcd60e51b815260206004820152602660248201527f535442543a204d494e5f444953545249425554455f494e54455256414c5f564960448201527f4f4c41544544000000000000000000000000000000000000000000000000000060648201526084016108c1565b6040805186815260208101839052908101859052606081018490527f2de232542b5e46095f9201d87c29ba9afb81780177592a791c24967bd51529a79060800160405180910390a15050610135805467ffffffffffffffff19164267ffffffffffffffff16179055505050565b336000818152610133602090815260408083206001600160a01b03871684529091528120549091610a46918590610bc7908690612f45565b60048161012c811061111257600080fd5b0154905081565b6003546001600160a01b031633146111735760405162461bcd60e51b815260206004820152601360248201527f535442543a204e4f545f4d4f44455241544f520000000000000000000000000060448201526064016108c1565b6001600160a01b03821660009081526101346020526040902081906111988282612fca565b50505050565b6000610130546000146111cc5761013054610131546111bd9084612f2e565b6111c79190613042565b610a4a565b600092915050565b6111dc611c9d565b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6000610131546000146111cc5761013154610130546111bd9084612f2e565b6001600160a01b03811660009081526101326020526040812054610a4a9061120b565b611255611c9d565b61125f600061214e565b565b611269611c9d565b6003805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6112a0611c9d565b610135805467ffffffffffffffff909216600160801b027fffffffffffffffff0000000000000000ffffffffffffffffffffffffffffffff909216919091179055565b6112eb611c9d565b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6001546001600160a01b031633146113675760405162461bcd60e51b815260206004820152601060248201526f29aa212a1d102727aa2fa4a9a9aaa2a960811b60448201526064016108c1565b6001600160a01b038416600090815261013360209081526040808320338452909152902054838110156114025760405162461bcd60e51b815260206004820152602560248201527f535442543a2052454445454d5f414d4f554e545f455843454544535f414c4c4f60448201527f57414e434500000000000000000000000000000000000000000000000000000060648201526084016108c1565b600061140d856119e5565b905061141986826121ab565b5084610130600082825461142d9190612ed2565b9091555061143c90508161120b565b9450856001600160a01b0316336001600160a01b03167fb7d0d6b60740753e9f16692a2f479472a1385aec2420fa43225b02f2ffa1afe787878760405161148593929190613064565b60405180910390a36040518581526000906001600160a01b038816907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a36114dd8633610bc78886612ed2565b505050505050565b606061013680548060200260200160405190810160405280929190818152602001828054801561153457602002820191906000526020600020905b815481526020019060010190808311611520575b5050505050905090565b336000908152610133602090815260408083206001600160a01b0386168452909152812054828110156115d85760405162461bcd60e51b8152602060048201526024808201527f535442543a204445435245415345445f414c4c4f57414e43455f42454c4f575f60448201527f5a45524f0000000000000000000000000000000000000000000000000000000060648201526084016108c1565b6115e73385610bc78685612ed2565b5060019392505050565b6000610a46338484611fca565b600081815261013760205260408120805460018201546002909201805460609493849391839061162d90612d0b565b80601f016020809104026020016040519081016040528092919081815260200182805461165990612d0b565b80156116a65780601f1061167b576101008083540402835291602001916116a6565b820191906000526020600020905b81548152906001019060200180831161168957829003601f168201915b505050505092509250925092509193909250565b6001546001600160a01b031633146117075760405162461bcd60e51b815260206004820152601060248201526f29aa212a1d102727aa2fa4a9a9aaa2a960811b60448201526064016108c1565b82156111985760006117188461119e565b90508060000361174d5750610130839055610135805467ffffffffffffffff19164267ffffffffffffffff1617905582611766565b8361013060008282546117609190612f45565b90915550505b61177085826121c0565b5061177a8161120b565b9350846001600160a01b0316336001600160a01b03167f0e9905d62635f049c2f4e11678ebf9dc3d1f8c4a653e290759b772e47ba00d008686866040516117c393929190613064565b60405180910390a36040518481526001600160a01b038616906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050505050565b61181b611c9d565b6000818152610137602052604090206001015461187a5760405162461bcd60e51b815260206004820152601360248201527f535442543a20444f435f4e4f545f45584953540000000000000000000000000060448201526064016108c1565b6000818152610138602052604081205461189690600190612ed2565b610136549091506118a990600190612ed2565b811461193d5761013680546118c090600190612ed2565b815481106118d0576118d061307e565b906000526020600020015461013682815481106118ef576118ef61307e565b600091825260209091200155611906816001612f45565b6101386000610136848154811061191f5761191f61307e565b90600052602060002001548152602001908152602001600020819055505b61013680548061194f5761194f613094565b600082815260208082208301600019908101839055909201909255838252610137905260408120818155600181018290559061198e6002830182612760565b505060008281526101376020526040908190208054915184927f3d9bba27d3e360d8c80645beed7e991454a8271bf6f269a24f7782be0f0d0654926119d992600290910191906130aa565b60405180910390a25050565b610130546000908015611a2857806001826101315486611a059190612f2e565b611a0f9190612f45565b611a199190612ed2565b611a239190613042565b611a2b565b60005b9392505050565b6001546001600160a01b03163314611a7f5760405162461bcd60e51b815260206004820152601060248201526f29aa212a1d102727aa2fa4a9a9aaa2a960811b60448201526064016108c1565b8215611b4b576000611a90846119e5565b9050611a9c33826121ab565b50836101306000828254611ab09190612ed2565b90915550611abf90508161120b565b9350336001600160a01b0316336001600160a01b03167fb7d0d6b60740753e9f16692a2f479472a1385aec2420fa43225b02f2ffa1afe7868686604051611b0893929190613064565b60405180910390a360405184815260009033907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020015b60405180910390a3505b505050565b6114dd858585610b12565b6002546001600160a01b03163314611bb55760405162461bcd60e51b815260206004820152601460248201527f535442543a204e4f545f434f4e54524f4c4c455200000000000000000000000060448201526064016108c1565b611bc08787876122b3565b856001600160a01b0316876001600160a01b03167f6bf62b4b9c7b768275122bf70d429efc398a056d669b1efdf6c3976346246d7d338888888888604051610daf96959493929190612ee5565b611c15611c9d565b6001600160a01b038116611c915760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016108c1565b611c9a8161214e565b50565b6000546001600160a01b0316331461125f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108c1565b6001600160a01b038381166000818152610133602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03808616600090815261013460208181526040808420815160608082018452915460ff80821615158352610100808304821615158488015267ffffffffffffffff6201000093849004811685880152998e16895296865284882085519485018652548082161515855296870416151594830194909452929093049094169382019390935282519192839283929083908015611e1e5750604083015167ffffffffffffffff161580611e1e575042836040015167ffffffffffffffff16115b8015611e3257506001600160a01b038b1615155b905080611e8a57600060136040518060400160405280600b81526020017f43414e4e4f545f53454e44000000000000000000000000000000000000000000815250611e7c90612e98565b955095509550505050610ae5565b600082602001518015611ec05750604083015167ffffffffffffffff161580611ec0575042836040015167ffffffffffffffff16115b8015611ed457506001600160a01b038b1615155b905080611f2d57600060136040518060400160405280600e81526020017f43414e4e4f545f52454345495645000000000000000000000000000000000000815250611f1e90612e98565b96509650965050505050610ae5565b6000611f388b61119e565b6001600160a01b038e166000908152610132602052604090205490915080821115611fb157600060066040518060400160405280601181526020017f5348415245535f4e4f545f454e4f554748000000000000000000000000000000815250611fa090612e98565b985098509850505050505050610ae5565b5060019d8e9d5060009c509a5050505050505050505050565b611fd383612317565b611fdc82612434565b611b4b8383836122b3565b60006001600160a01b03831661203f5760405162461bcd60e51b815260206004820181905260248201527f535442543a204255524e5f46524f4d5f5448455f5a45524f5f4144445245535360448201526064016108c1565b6001600160a01b03831660009081526101326020526040902054808311156120cf5760405162461bcd60e51b815260206004820152602160248201527f535442543a204255524e5f414d4f554e545f455843454544535f42414c414e4360448201527f450000000000000000000000000000000000000000000000000000000000000060648201526084016108c1565b82610131546120de9190612ed2565b61013181905591506120f08382612ed2565b6001600160a01b038516600081815261013260205260408082209390935591517f9d9c909296d9c674451c0c24f02cb64981eb3b727f99865939192f880a755dcb9061213f9087815260200190565b60405180910390a35092915050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006121b683612317565b611a2b8383611fe7565b60006001600160a01b0383166122185760405162461bcd60e51b815260206004820152601e60248201527f535442543a204d494e545f544f5f5448455f5a45524f5f41444452455353000060448201526064016108c1565b61222183612434565b8161013160008282546122349190612f45565b90915550506001600160a01b0383166000908152610132602052604081208054849290612262908490612f45565b90915550506040518281526001600160a01b038416906000907f9d9c909296d9c674451c0c24f02cb64981eb3b727f99865939192f880a755dcb9060200160405180910390a3506101315492915050565b60006122be8261119e565b90506122cb848483612549565b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6123098461120b565b604051908152602001611b41565b6001600160a01b038116600090815261013460209081526040918290208251606081018452905460ff8082161515808452610100830490911615159383019390935262010000900467ffffffffffffffff16928101929092526123bc5760405162461bcd60e51b815260206004820152601860248201527f535442543a204e4f5f53454e445f5045524d495353494f4e000000000000000060448201526064016108c1565b604081015167ffffffffffffffff1615806123e4575042816040015167ffffffffffffffff16115b6124305760405162461bcd60e51b815260206004820152601d60248201527f535442543a2053454e445f5045524d495353494f4e5f4558504952454400000060448201526064016108c1565b5050565b6001600160a01b038116600090815261013460209081526040918290208251606081018452905460ff80821615158352610100820416151592820183905262010000900467ffffffffffffffff16928101929092526124d55760405162461bcd60e51b815260206004820152601b60248201527f535442543a204e4f5f524543454956455f5045524d495353494f4e000000000060448201526064016108c1565b604081015167ffffffffffffffff1615806124fd575042816040015167ffffffffffffffff16115b6124305760405162461bcd60e51b815260206004820181905260248201527f535442543a20524543454956455f5045524d495353494f4e5f4558504952454460448201526064016108c1565b6001600160a01b0383166125c45760405162461bcd60e51b8152602060048201526024808201527f535442543a205452414e534645525f46524f4d5f5448455f5a45524f5f41444460448201527f524553530000000000000000000000000000000000000000000000000000000060648201526084016108c1565b6001600160a01b0382166126405760405162461bcd60e51b815260206004820152602260248201527f535442543a205452414e534645525f544f5f5448455f5a45524f5f414444524560448201527f535300000000000000000000000000000000000000000000000000000000000060648201526084016108c1565b6001600160a01b03831660009081526101326020526040902054808211156126d05760405162461bcd60e51b815260206004820152602560248201527f535442543a205452414e534645525f414d4f554e545f455843454544535f424160448201527f4c414e434500000000000000000000000000000000000000000000000000000060648201526084016108c1565b6126da8282612ed2565b6001600160a01b0380861660009081526101326020526040808220939093559085168152205461270b908390612f45565b6001600160a01b038085166000818152610132602052604090819020939093559151908616907f9d9c909296d9c674451c0c24f02cb64981eb3b727f99865939192f880a755dcb90611b419086815260200190565b50805461276c90612d0b565b6000825580601f1061277c575050565b601f016020900490600052602060002090810190611c9a91905b808211156127aa5760008155600101612796565b5090565b60008083601f8401126127c057600080fd5b50813567ffffffffffffffff8111156127d857600080fd5b6020830191508360208285010111156127f057600080fd5b9250929050565b6000806000806060858703121561280d57600080fd5b84359350602085013567ffffffffffffffff81111561282b57600080fd5b612837878288016127ae565b9598909750949560400135949350505050565b80356001600160a01b038116811461286157600080fd5b919050565b60006020828403121561287857600080fd5b611a2b8261284a565b6000815180845260005b818110156128a75760208185018101518683018201520161288b565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000611a2b6020830184612881565b600080604083850312156128ed57600080fd5b6128f68361284a565b946020939093013593505050565b60006020828403121561291657600080fd5b5035919050565b60008060008060006080868803121561293557600080fd5b61293e8661284a565b945061294c6020870161284a565b935060408601359250606086013567ffffffffffffffff81111561296f57600080fd5b61297b888289016127ae565b969995985093965092949392505050565b600080600080606085870312156129a257600080fd5b6129ab8561284a565b935060208501359250604085013567ffffffffffffffff8111156129ce57600080fd5b6129da878288016127ae565b95989497509550505050565b6000806000606084860312156129fb57600080fd5b612a048461284a565b9250612a126020850161284a565b9150604084013590509250925092565b838152826020820152606060408201526000612a416060830184612881565b95945050505050565b60008060008060008060808789031215612a6357600080fd5b612a6c8761284a565b955060208701359450604087013567ffffffffffffffff80821115612a9057600080fd5b612a9c8a838b016127ae565b90965094506060890135915080821115612ab557600080fd5b50612ac289828a016127ae565b979a9699509497509295939492505050565b67ffffffffffffffff81168114611c9a57600080fd5b600060208284031215612afc57600080fd5b8135611a2b81612ad4565b600080600060608486031215612b1c57600080fd5b505081359360208301359350604090920135919050565b6000808284036080811215612b4757600080fd5b612b508461284a565b92506060601f1982011215612b6457600080fd5b506020830190509250929050565b6020808252825182820181905260009190848201906040850190845b81811015612baa57835183529284019291840191600101612b8e565b50909695505050505050565b606081526000612bc96060830186612881565b60208301949094525060400152919050565b60008060408385031215612bee57600080fd5b612bf78361284a565b9150612c056020840161284a565b90509250929050565b600080600060408486031215612c2357600080fd5b83359250602084013567ffffffffffffffff811115612c4157600080fd5b612c4d868287016127ae565b9497909650939450505050565b600080600080600080600060a0888a031215612c7557600080fd5b612c7e8861284a565b9650612c8c6020890161284a565b955060408801359450606088013567ffffffffffffffff80821115612cb057600080fd5b612cbc8b838c016127ae565b909650945060808a0135915080821115612cd557600080fd5b50612ce28a828b016127ae565b989b979a50959850939692959293505050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680612d1f57607f821691505b602082108103612d3f57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115611b4b57600081815260208120601f850160051c81016020861015612d6c5750805b601f850160051c820191505b818110156114dd57828155600101612d78565b815167ffffffffffffffff811115612da557612da5612cf5565b612db981612db38454612d0b565b84612d45565b602080601f831160018114612dee5760008415612dd65750858301515b600019600386901b1c1916600185901b1785556114dd565b600085815260208120601f198616915b82811015612e1d57888601518255948401946001909101908401612dfe565b5085821015612e3b5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b604081526000612e88604083018587612e4b565b9050826020830152949350505050565b80516020808301519190811015612d3f5760001960209190910360031b1b16919050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610a4a57610a4a612ebc565b6001600160a01b0387168152856020820152608060408201526000612f0e608083018688612e4b565b8281036060840152612f21818587612e4b565b9998505050505050505050565b8082028115828204841417610a4a57610a4a612ebc565b80820180821115610a4a57610a4a612ebc565b60007f80000000000000000000000000000000000000000000000000000000000000008203612f8957612f89612ebc565b5060000390565b67ffffffffffffffff818116838216019080821115612fb157612fb1612ebc565b5092915050565b600081358015158114610a4a57600080fd5b612fd382612fb8565b1515815460ff821691508160ff19821617835561ff00612ff560208601612fb8565b151560081b16808361ffff19841617178455604085013561301581612ad4565b69ffffffffffffffff00008160101b168469ffffffffffffffffffff198516178317178555505050505050565b60008261305f57634e487b7160e01b600052601260045260246000fd5b500490565b838152604060208201526000612a41604083018486612e4b565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b6040815260008084546130bc81612d0b565b80604086015260606001808416600081146130de57600181146130f857613129565b60ff1985168884015283151560051b880183019550613129565b8960005260208060002060005b868110156131205781548b8201870152908401908201613105565b8a018501975050505b5050505050602092909201929092529291505056fea26469706673582212201e89b34c6395d82330eb966c29d28667888a482d098d59839b342c8d9449496764736f6c63430008110033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106103415760003560e01c80634c783bf5116101bd578063a457c2d7116100f9578063dd62ed3e116100a2578063f282527a1161007c578063f282527a1461080d578063f2fde38b14610820578063f5eb42dc14610833578063f77c47911461085d57600080fd5b8063dd62ed3e146107ad578063e77c646d146107e7578063ee532f31146107fa57600080fd5b8063bb3acde9116100d3578063bb3acde914610774578063c350184814610787578063d2e494bc1461079a57600080fd5b8063a457c2d71461072c578063a9059cbb1461073f578063b10d6b411461075257600080fd5b806388206fe11161016657806392eefe9b1161014057806392eefe9b146106b857806395d89b41146106cb5780639675193c146107045780639fa5f50b1461071757600080fd5b806388206fe1146106735780638da5cb5b146106945780638db8df7f146106a557600080fd5b806370a082311161019757806370a0823114610645578063715018a61461065857806375bba1891461066057600080fd5b80634c783bf51461056557806355cc4e571461061f57806360588f9d1461063257600080fd5b80632b2805db1161028c57806338743904116102355780633cf6bcfe1161020f5780633cf6bcfe146105d157806346f60da7146105e657806347e640c0146105f95780634b8fb92f1461060c57600080fd5b806338743904146105a157806339509351146105b45780633a98ef39146105c757600080fd5b8063313ce56711610266578063313ce5671461056c578063322e654e1461057b57806332574d711461058e57600080fd5b80632b2805db146105305780632bc6acc3146105525780632f1cae851461056557600080fd5b806318160ddd116102ee57806322c34c0b116102c857806322c34c0b146104d557806323b872dd1461050a5780632535f7621461051d57600080fd5b806318160ddd1461048d5780631badb25c146104975780631d143848146104aa57600080fd5b8063095ea7b31161031f578063095ea7b3146104095780630986902f1461042c578063122eb5751461045b57600080fd5b8063010648ca1461034657806301e882081461035b57806306fdde03146103c7575b600080fd5b6103596103543660046127f7565b610870565b005b61039b610369366004612866565b6101346020526000908152604090205460ff8082169161010081049091169062010000900467ffffffffffffffff1683565b604080519315158452911515602084015267ffffffffffffffff16908201526060015b60405180910390f35b60408051808201909152601e81527f53686f72742d7465726d2054726561737572792042696c6c20546f6b656e000060208201525b6040516103be91906128c7565b61041c6104173660046128da565b610a39565b60405190151581526020016103be565b61044d61043a366004612904565b6101386020526000908152604090205481565b6040519081526020016103be565b61046e61046936600461291d565b610a50565b60408051931515845260ff9092166020840152908201526060016103be565b61044d6101305481565b61046e6104a536600461298c565b610af0565b6001546104bd906001600160a01b031681565b6040516001600160a01b0390911681526020016103be565b610135546104f190600160801b900467ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016103be565b61041c6105183660046129e6565b610b12565b61035961052b36600461298c565b610bd7565b61054361053e366004612904565b610be8565b6040516103be93929190612a22565b610359610560366004612a4a565b610c94565b600161041c565b604051601281526020016103be565b610359610589366004612aea565b610dc0565b61035961059c366004612b07565b610e10565b6003546104bd906001600160a01b031681565b61041c6105c23660046128da565b6110c9565b61044d6101315481565b610135546104f19067ffffffffffffffff1681565b61044d6105f4366004612904565b611101565b610359610607366004612b33565b611119565b61044d61061a366004612904565b61119e565b61035961062d366004612866565b6111d4565b61044d610640366004612904565b61120b565b61044d610653366004612866565b61122a565b61035961124d565b61035961066e366004612866565b611261565b610135546104f19068010000000000000000900467ffffffffffffffff1681565b6000546001600160a01b03166104bd565b6103596106b3366004612aea565b611298565b6103596106c6366004612866565b6112e3565b60408051808201909152600481527f535442540000000000000000000000000000000000000000000000000000000060208201526103fc565b61035961071236600461298c565b61131a565b61071f6114e5565b6040516103be9190612b72565b61041c61073a3660046128da565b61153e565b61041c61074d3660046128da565b6115f1565b610765610760366004612904565b6115fe565b6040516103be93929190612bb6565b61035961078236600461298c565b6116ba565b610359610795366004612904565b611813565b61044d6107a8366004612904565b6119e5565b61044d6107bb366004612bdb565b6001600160a01b0391821660009081526101336020908152604080832093909416825291909152205490565b6103596107f5366004612c0e565b611a32565b61035961080836600461291d565b611b50565b61035961081b366004612c5a565b611b5b565b61035961082e366004612866565b611c0d565b61044d610841366004612866565b6001600160a01b03166000908152610132602052604090205490565b6002546104bd906001600160a01b031681565b610878611c9d565b836108ca5760405162461bcd60e51b815260206004820152601660248201527f535442543a20494e56414c49445f444f435f4e414d450000000000000000000060448201526064015b60405180910390fd5b816109175760405162461bcd60e51b815260206004820152601160248201527f535442543a20494e56414c49445f55524c00000000000000000000000000000060448201526064016108c1565b600084815261013760205260409020600101546109705761013680546001810182557f39da2db355130acf428d669fbf1c14faa9d51399a25b793fc254bbbde66f02e20185905554600085815261013860205260409020555b604051806060016040528082815260200142815260200184848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250508681526101376020908152604091829020845181559084015160018201559083015190915060028201906109f39082612d8b565b50905050837fb4c22d60cd550a815744f04e3ff5278bf19684565ee00e2b084041b6024bd6f6848484604051610a2b93929190612e74565b60405180910390a250505050565b6000610a46338484611cf7565b5060015b92915050565b6001600160a01b0385166000908152610133602090815260408083203384529091528120548190819080871115610ad057600060066040518060400160405280601481526020017f414c4c4f57414e43455f4e4f545f454e4f554748000000000000000000000000815250610ac490612e98565b93509350935050610ae5565b610add8989898989611d59565b935093509350505b955095509592505050565b6000806000610b023388888888611d59565b9250925092509450945094915050565b6001600160a01b03831660009081526101336020908152604080832033845290915281205482811015610bad5760405162461bcd60e51b815260206004820152602760248201527f535442543a205452414e534645525f414d4f554e545f455843454544535f414c60448201527f4c4f57414e43450000000000000000000000000000000000000000000000000060648201526084016108c1565b610bb8858585611fca565b610bcc8533610bc78685612ed2565b611cf7565b506001949350505050565b610be184846115f1565b5050505050565b6101376020526000908152604090208054600182015460028301805492939192610c1190612d0b565b80601f0160208091040260200160405190810160405280929190818152602001828054610c3d90612d0b565b8015610c8a5780601f10610c5f57610100808354040283529160200191610c8a565b820191906000526020600020905b815481529060010190602001808311610c6d57829003601f168201915b5050505050905083565b6002546001600160a01b03163314610cee5760405162461bcd60e51b815260206004820152601460248201527f535442543a204e4f545f434f4e54524f4c4c455200000000000000000000000060448201526064016108c1565b6000610cf9866119e5565b9050610d058782611fe7565b50856101306000828254610d199190612ed2565b90915550610d2890508161120b565b9550866001600160a01b03167f876b7cb47aa150b3a5516188b19ed308752ad4d0ae9a702543353b78163f7589338888888888604051610d6d96959493929190612ee5565b60405180910390a26040518681526000906001600160a01b038916907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020015b60405180910390a350505050505050565b610dc8611c9d565b610135805467ffffffffffffffff90921668010000000000000000027fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff909216919091179055565b6001546001600160a01b03163314610e5d5760405162461bcd60e51b815260206004820152601060248201526f29aa212a1d102727aa2fa4a9a9aaa2a960811b60448201526064016108c1565b61013054600080851315610f0757610e7d85670de0b6b3a7640000612f2e565b61013554610e9c90600160801b900467ffffffffffffffff1684612f2e565b1015610ef65760405162461bcd60e51b815260206004820152602360248201527f535442543a204d41585f444953545249425554455f524154494f5f455843454560448201526211115160ea1b60648201526084016108c1565b610f008583612f45565b9050610fb1565b610f1085612f58565b610f2290670de0b6b3a7640000612f2e565b61013554610f4190600160801b900467ffffffffffffffff1684612f2e565b1015610f9b5760405162461bcd60e51b815260206004820152602360248201527f535442543a204d41585f444953545249425554455f524154494f5f455843454560448201526211115160ea1b60648201526084016108c1565b610fa485612f58565b610fae9083612ed2565b90505b610130819055610135544290610fdf9067ffffffffffffffff68010000000000000000820481169116612f90565b67ffffffffffffffff161061105c5760405162461bcd60e51b815260206004820152602660248201527f535442543a204d494e5f444953545249425554455f494e54455256414c5f564960448201527f4f4c41544544000000000000000000000000000000000000000000000000000060648201526084016108c1565b6040805186815260208101839052908101859052606081018490527f2de232542b5e46095f9201d87c29ba9afb81780177592a791c24967bd51529a79060800160405180910390a15050610135805467ffffffffffffffff19164267ffffffffffffffff16179055505050565b336000818152610133602090815260408083206001600160a01b03871684529091528120549091610a46918590610bc7908690612f45565b60048161012c811061111257600080fd5b0154905081565b6003546001600160a01b031633146111735760405162461bcd60e51b815260206004820152601360248201527f535442543a204e4f545f4d4f44455241544f520000000000000000000000000060448201526064016108c1565b6001600160a01b03821660009081526101346020526040902081906111988282612fca565b50505050565b6000610130546000146111cc5761013054610131546111bd9084612f2e565b6111c79190613042565b610a4a565b600092915050565b6111dc611c9d565b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6000610131546000146111cc5761013154610130546111bd9084612f2e565b6001600160a01b03811660009081526101326020526040812054610a4a9061120b565b611255611c9d565b61125f600061214e565b565b611269611c9d565b6003805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6112a0611c9d565b610135805467ffffffffffffffff909216600160801b027fffffffffffffffff0000000000000000ffffffffffffffffffffffffffffffff909216919091179055565b6112eb611c9d565b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6001546001600160a01b031633146113675760405162461bcd60e51b815260206004820152601060248201526f29aa212a1d102727aa2fa4a9a9aaa2a960811b60448201526064016108c1565b6001600160a01b038416600090815261013360209081526040808320338452909152902054838110156114025760405162461bcd60e51b815260206004820152602560248201527f535442543a2052454445454d5f414d4f554e545f455843454544535f414c4c4f60448201527f57414e434500000000000000000000000000000000000000000000000000000060648201526084016108c1565b600061140d856119e5565b905061141986826121ab565b5084610130600082825461142d9190612ed2565b9091555061143c90508161120b565b9450856001600160a01b0316336001600160a01b03167fb7d0d6b60740753e9f16692a2f479472a1385aec2420fa43225b02f2ffa1afe787878760405161148593929190613064565b60405180910390a36040518581526000906001600160a01b038816907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a36114dd8633610bc78886612ed2565b505050505050565b606061013680548060200260200160405190810160405280929190818152602001828054801561153457602002820191906000526020600020905b815481526020019060010190808311611520575b5050505050905090565b336000908152610133602090815260408083206001600160a01b0386168452909152812054828110156115d85760405162461bcd60e51b8152602060048201526024808201527f535442543a204445435245415345445f414c4c4f57414e43455f42454c4f575f60448201527f5a45524f0000000000000000000000000000000000000000000000000000000060648201526084016108c1565b6115e73385610bc78685612ed2565b5060019392505050565b6000610a46338484611fca565b600081815261013760205260408120805460018201546002909201805460609493849391839061162d90612d0b565b80601f016020809104026020016040519081016040528092919081815260200182805461165990612d0b565b80156116a65780601f1061167b576101008083540402835291602001916116a6565b820191906000526020600020905b81548152906001019060200180831161168957829003601f168201915b505050505092509250925092509193909250565b6001546001600160a01b031633146117075760405162461bcd60e51b815260206004820152601060248201526f29aa212a1d102727aa2fa4a9a9aaa2a960811b60448201526064016108c1565b82156111985760006117188461119e565b90508060000361174d5750610130839055610135805467ffffffffffffffff19164267ffffffffffffffff1617905582611766565b8361013060008282546117609190612f45565b90915550505b61177085826121c0565b5061177a8161120b565b9350846001600160a01b0316336001600160a01b03167f0e9905d62635f049c2f4e11678ebf9dc3d1f8c4a653e290759b772e47ba00d008686866040516117c393929190613064565b60405180910390a36040518481526001600160a01b038616906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050505050565b61181b611c9d565b6000818152610137602052604090206001015461187a5760405162461bcd60e51b815260206004820152601360248201527f535442543a20444f435f4e4f545f45584953540000000000000000000000000060448201526064016108c1565b6000818152610138602052604081205461189690600190612ed2565b610136549091506118a990600190612ed2565b811461193d5761013680546118c090600190612ed2565b815481106118d0576118d061307e565b906000526020600020015461013682815481106118ef576118ef61307e565b600091825260209091200155611906816001612f45565b6101386000610136848154811061191f5761191f61307e565b90600052602060002001548152602001908152602001600020819055505b61013680548061194f5761194f613094565b600082815260208082208301600019908101839055909201909255838252610137905260408120818155600181018290559061198e6002830182612760565b505060008281526101376020526040908190208054915184927f3d9bba27d3e360d8c80645beed7e991454a8271bf6f269a24f7782be0f0d0654926119d992600290910191906130aa565b60405180910390a25050565b610130546000908015611a2857806001826101315486611a059190612f2e565b611a0f9190612f45565b611a199190612ed2565b611a239190613042565b611a2b565b60005b9392505050565b6001546001600160a01b03163314611a7f5760405162461bcd60e51b815260206004820152601060248201526f29aa212a1d102727aa2fa4a9a9aaa2a960811b60448201526064016108c1565b8215611b4b576000611a90846119e5565b9050611a9c33826121ab565b50836101306000828254611ab09190612ed2565b90915550611abf90508161120b565b9350336001600160a01b0316336001600160a01b03167fb7d0d6b60740753e9f16692a2f479472a1385aec2420fa43225b02f2ffa1afe7868686604051611b0893929190613064565b60405180910390a360405184815260009033907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020015b60405180910390a3505b505050565b6114dd858585610b12565b6002546001600160a01b03163314611bb55760405162461bcd60e51b815260206004820152601460248201527f535442543a204e4f545f434f4e54524f4c4c455200000000000000000000000060448201526064016108c1565b611bc08787876122b3565b856001600160a01b0316876001600160a01b03167f6bf62b4b9c7b768275122bf70d429efc398a056d669b1efdf6c3976346246d7d338888888888604051610daf96959493929190612ee5565b611c15611c9d565b6001600160a01b038116611c915760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016108c1565b611c9a8161214e565b50565b6000546001600160a01b0316331461125f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108c1565b6001600160a01b038381166000818152610133602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03808616600090815261013460208181526040808420815160608082018452915460ff80821615158352610100808304821615158488015267ffffffffffffffff6201000093849004811685880152998e16895296865284882085519485018652548082161515855296870416151594830194909452929093049094169382019390935282519192839283929083908015611e1e5750604083015167ffffffffffffffff161580611e1e575042836040015167ffffffffffffffff16115b8015611e3257506001600160a01b038b1615155b905080611e8a57600060136040518060400160405280600b81526020017f43414e4e4f545f53454e44000000000000000000000000000000000000000000815250611e7c90612e98565b955095509550505050610ae5565b600082602001518015611ec05750604083015167ffffffffffffffff161580611ec0575042836040015167ffffffffffffffff16115b8015611ed457506001600160a01b038b1615155b905080611f2d57600060136040518060400160405280600e81526020017f43414e4e4f545f52454345495645000000000000000000000000000000000000815250611f1e90612e98565b96509650965050505050610ae5565b6000611f388b61119e565b6001600160a01b038e166000908152610132602052604090205490915080821115611fb157600060066040518060400160405280601181526020017f5348415245535f4e4f545f454e4f554748000000000000000000000000000000815250611fa090612e98565b985098509850505050505050610ae5565b5060019d8e9d5060009c509a5050505050505050505050565b611fd383612317565b611fdc82612434565b611b4b8383836122b3565b60006001600160a01b03831661203f5760405162461bcd60e51b815260206004820181905260248201527f535442543a204255524e5f46524f4d5f5448455f5a45524f5f4144445245535360448201526064016108c1565b6001600160a01b03831660009081526101326020526040902054808311156120cf5760405162461bcd60e51b815260206004820152602160248201527f535442543a204255524e5f414d4f554e545f455843454544535f42414c414e4360448201527f450000000000000000000000000000000000000000000000000000000000000060648201526084016108c1565b82610131546120de9190612ed2565b61013181905591506120f08382612ed2565b6001600160a01b038516600081815261013260205260408082209390935591517f9d9c909296d9c674451c0c24f02cb64981eb3b727f99865939192f880a755dcb9061213f9087815260200190565b60405180910390a35092915050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006121b683612317565b611a2b8383611fe7565b60006001600160a01b0383166122185760405162461bcd60e51b815260206004820152601e60248201527f535442543a204d494e545f544f5f5448455f5a45524f5f41444452455353000060448201526064016108c1565b61222183612434565b8161013160008282546122349190612f45565b90915550506001600160a01b0383166000908152610132602052604081208054849290612262908490612f45565b90915550506040518281526001600160a01b038416906000907f9d9c909296d9c674451c0c24f02cb64981eb3b727f99865939192f880a755dcb9060200160405180910390a3506101315492915050565b60006122be8261119e565b90506122cb848483612549565b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6123098461120b565b604051908152602001611b41565b6001600160a01b038116600090815261013460209081526040918290208251606081018452905460ff8082161515808452610100830490911615159383019390935262010000900467ffffffffffffffff16928101929092526123bc5760405162461bcd60e51b815260206004820152601860248201527f535442543a204e4f5f53454e445f5045524d495353494f4e000000000000000060448201526064016108c1565b604081015167ffffffffffffffff1615806123e4575042816040015167ffffffffffffffff16115b6124305760405162461bcd60e51b815260206004820152601d60248201527f535442543a2053454e445f5045524d495353494f4e5f4558504952454400000060448201526064016108c1565b5050565b6001600160a01b038116600090815261013460209081526040918290208251606081018452905460ff80821615158352610100820416151592820183905262010000900467ffffffffffffffff16928101929092526124d55760405162461bcd60e51b815260206004820152601b60248201527f535442543a204e4f5f524543454956455f5045524d495353494f4e000000000060448201526064016108c1565b604081015167ffffffffffffffff1615806124fd575042816040015167ffffffffffffffff16115b6124305760405162461bcd60e51b815260206004820181905260248201527f535442543a20524543454956455f5045524d495353494f4e5f4558504952454460448201526064016108c1565b6001600160a01b0383166125c45760405162461bcd60e51b8152602060048201526024808201527f535442543a205452414e534645525f46524f4d5f5448455f5a45524f5f41444460448201527f524553530000000000000000000000000000000000000000000000000000000060648201526084016108c1565b6001600160a01b0382166126405760405162461bcd60e51b815260206004820152602260248201527f535442543a205452414e534645525f544f5f5448455f5a45524f5f414444524560448201527f535300000000000000000000000000000000000000000000000000000000000060648201526084016108c1565b6001600160a01b03831660009081526101326020526040902054808211156126d05760405162461bcd60e51b815260206004820152602560248201527f535442543a205452414e534645525f414d4f554e545f455843454544535f424160448201527f4c414e434500000000000000000000000000000000000000000000000000000060648201526084016108c1565b6126da8282612ed2565b6001600160a01b0380861660009081526101326020526040808220939093559085168152205461270b908390612f45565b6001600160a01b038085166000818152610132602052604090819020939093559151908616907f9d9c909296d9c674451c0c24f02cb64981eb3b727f99865939192f880a755dcb90611b419086815260200190565b50805461276c90612d0b565b6000825580601f1061277c575050565b601f016020900490600052602060002090810190611c9a91905b808211156127aa5760008155600101612796565b5090565b60008083601f8401126127c057600080fd5b50813567ffffffffffffffff8111156127d857600080fd5b6020830191508360208285010111156127f057600080fd5b9250929050565b6000806000806060858703121561280d57600080fd5b84359350602085013567ffffffffffffffff81111561282b57600080fd5b612837878288016127ae565b9598909750949560400135949350505050565b80356001600160a01b038116811461286157600080fd5b919050565b60006020828403121561287857600080fd5b611a2b8261284a565b6000815180845260005b818110156128a75760208185018101518683018201520161288b565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000611a2b6020830184612881565b600080604083850312156128ed57600080fd5b6128f68361284a565b946020939093013593505050565b60006020828403121561291657600080fd5b5035919050565b60008060008060006080868803121561293557600080fd5b61293e8661284a565b945061294c6020870161284a565b935060408601359250606086013567ffffffffffffffff81111561296f57600080fd5b61297b888289016127ae565b969995985093965092949392505050565b600080600080606085870312156129a257600080fd5b6129ab8561284a565b935060208501359250604085013567ffffffffffffffff8111156129ce57600080fd5b6129da878288016127ae565b95989497509550505050565b6000806000606084860312156129fb57600080fd5b612a048461284a565b9250612a126020850161284a565b9150604084013590509250925092565b838152826020820152606060408201526000612a416060830184612881565b95945050505050565b60008060008060008060808789031215612a6357600080fd5b612a6c8761284a565b955060208701359450604087013567ffffffffffffffff80821115612a9057600080fd5b612a9c8a838b016127ae565b90965094506060890135915080821115612ab557600080fd5b50612ac289828a016127ae565b979a9699509497509295939492505050565b67ffffffffffffffff81168114611c9a57600080fd5b600060208284031215612afc57600080fd5b8135611a2b81612ad4565b600080600060608486031215612b1c57600080fd5b505081359360208301359350604090920135919050565b6000808284036080811215612b4757600080fd5b612b508461284a565b92506060601f1982011215612b6457600080fd5b506020830190509250929050565b6020808252825182820181905260009190848201906040850190845b81811015612baa57835183529284019291840191600101612b8e565b50909695505050505050565b606081526000612bc96060830186612881565b60208301949094525060400152919050565b60008060408385031215612bee57600080fd5b612bf78361284a565b9150612c056020840161284a565b90509250929050565b600080600060408486031215612c2357600080fd5b83359250602084013567ffffffffffffffff811115612c4157600080fd5b612c4d868287016127ae565b9497909650939450505050565b600080600080600080600060a0888a031215612c7557600080fd5b612c7e8861284a565b9650612c8c6020890161284a565b955060408801359450606088013567ffffffffffffffff80821115612cb057600080fd5b612cbc8b838c016127ae565b909650945060808a0135915080821115612cd557600080fd5b50612ce28a828b016127ae565b989b979a50959850939692959293505050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680612d1f57607f821691505b602082108103612d3f57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115611b4b57600081815260208120601f850160051c81016020861015612d6c5750805b601f850160051c820191505b818110156114dd57828155600101612d78565b815167ffffffffffffffff811115612da557612da5612cf5565b612db981612db38454612d0b565b84612d45565b602080601f831160018114612dee5760008415612dd65750858301515b600019600386901b1c1916600185901b1785556114dd565b600085815260208120601f198616915b82811015612e1d57888601518255948401946001909101908401612dfe565b5085821015612e3b5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b604081526000612e88604083018587612e4b565b9050826020830152949350505050565b80516020808301519190811015612d3f5760001960209190910360031b1b16919050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610a4a57610a4a612ebc565b6001600160a01b0387168152856020820152608060408201526000612f0e608083018688612e4b565b8281036060840152612f21818587612e4b565b9998505050505050505050565b8082028115828204841417610a4a57610a4a612ebc565b80820180821115610a4a57610a4a612ebc565b60007f80000000000000000000000000000000000000000000000000000000000000008203612f8957612f89612ebc565b5060000390565b67ffffffffffffffff818116838216019080821115612fb157612fb1612ebc565b5092915050565b600081358015158114610a4a57600080fd5b612fd382612fb8565b1515815460ff821691508160ff19821617835561ff00612ff560208601612fb8565b151560081b16808361ffff19841617178455604085013561301581612ad4565b69ffffffffffffffff00008160101b168469ffffffffffffffffffff198516178317178555505050505050565b60008261305f57634e487b7160e01b600052601260045260246000fd5b500490565b838152604060208201526000612a41604083018486612e4b565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b6040815260008084546130bc81612d0b565b80604086015260606001808416600081146130de57600181146130f857613129565b60ff1985168884015283151560051b880183019550613129565b8960005260208060002060005b868110156131205781548b8201870152908401908201613105565b8a018501975050505b5050505050602092909201929092529291505056fea26469706673582212201e89b34c6395d82330eb966c29d28667888a482d098d59839b342c8d9449496764736f6c63430008110033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.