Overview
POL Balance
POL Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Name:
Quartz
Compiler Version
v0.8.9+commit.e5eed63a
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.9; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "./interfaces/IQuartzGovernor.sol"; import "./interfaces/IQuartz.sol"; import "./interfaces/IChildToken.sol"; /** * Polygon version of our Quartz token, bridged from Ethereum * * @notice This token starts out with 0 supply. All minting is done by the * bridge's ChildChainManager when a cross-chain transaction is made * * @notice In addition to ERC20 functionalities, this contract also allows * holders to stake tokens, which grants them voting rights on `Governor`, or * the ability to delegate that power to another party */ contract Quartz is ERC20Upgradeable, AccessControlUpgradeable, IQuartz, IChildToken { // Emitted when Quartz is staked event Staked( uint64 indexed id, address indexed owner, address indexed beneficiary, uint256 amount, uint64 maturationTime ); // Emitted when Quartz is unstaked event Unstaked( uint64 indexed id, address indexed owner, address indexed beneficiary, uint256 amount ); // Emitted when the delegatee of an account is changed event DelegateChanged( address indexed delegator, address indexed fromDelegate, address indexed toDelegate ); // Emitted when voting power for an account is changed event DelegateVotesChanged(address indexed delegate, uint256 newBalance); // Emitted when the governor contract is changed event GovernorChanged(address indexed governor); // Emitted when the minimum stake period is updated event MinStakePeriodChanged(uint64 minStakePeriod); struct StakeInfo { address owner; // Owner who staked tokens address beneficiary; // Beneficiary who received vote rep uint256 amount; // Staked Quartz amount uint64 period; // Stake period in seconds uint64 maturationTimestamp; // Stake maturation timestamp bool active; // Indicates active after maturation time } // an update to voting power for an entity struct Checkpoint { uint32 fromBlock; uint256 votes; } // role required by Polygon PoS bridge to mint tokens when a cross-chain transaction happens // https://docs.polygon.technology/docs/develop/ethereum-polygon/pos/mapping-assets/ bytes32 public constant DEPOSITOR_ROLE = keccak256("DEPOSITOR_ROLE"); // governor contract instance IQuartzGovernor public governor; // total amount staked by an account, which corresponds to his total voting power // (including delegated power) mapping(address => uint256) public userVotesRep; // delegates for each account mapping(address => address) public delegates; // all checkpoints for all accounts mapping(address => mapping(uint32 => Checkpoint)) public checkpoints; // checkpoint counters for all accounts mapping(address => uint32) public numCheckpoints; // minimum period before tokens can be unstaked uint64 public minStakePeriod; // stakes counter uint64 public stakeLength; // All stakes infos mapping(uint64 => StakeInfo) public stakes; // Total staked amount uint256 public override totalStaked; /** * @param _minStakePeriod the initial minStakePeriod to set * @param _childChainManager ChildChainManager instance for Polygon PoS bridge */ function initialize(uint64 _minStakePeriod, address _childChainManager) external initializer { minStakePeriod = _minStakePeriod; emit MinStakePeriodChanged(_minStakePeriod); require( _childChainManager != address(0), "QUARTZ: Child chain manager cannot be zero" ); __ERC20_init("Sandclock", "QUARTZ"); __AccessControl_init(); _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); _setupRole(DEPOSITOR_ROLE, _childChainManager); } // // Public API // /** * Sets the governor contract * * @notice Can only be called by a contract admin * * @notice Can only be called once * * @param _governor new Governor instance to use */ function setGovernor(IQuartzGovernor _governor) external onlyRole(DEFAULT_ADMIN_ROLE) { require( address(_governor) != address(0), "QUARTZ: Governor cannot be zero" ); require( address(governor) == address(0), "QUARTZ: Governor already set" ); governor = _governor; emit GovernorChanged(address(_governor)); } /** * Stake QUARTZ token to grant vote rep to beneficiary for a period. * * @param _amount Amount of QUARTZ to stake * @param _beneficiary Beneficiary account for this stake * @param _period minimum period before unstaking is possible */ function stake( uint256 _amount, address _beneficiary, uint64 _period ) external { require( _beneficiary != address(0), "QUARTZ: Beneficiary cannot be 0x0" ); require(_amount > 0, "QUARTZ: Amount must be greater than zero"); require( _period >= minStakePeriod, "QUARTZ: Period must be greater than minimum" ); _transfer(msg.sender, address(this), _amount); address _owner = msg.sender; uint64 _stakeId = stakeLength; uint64 _maturationTimestamp = _getBlockTimestamp() + _period; StakeInfo memory stakeInfo = StakeInfo({ owner: _owner, beneficiary: _beneficiary, amount: _amount, period: _period, maturationTimestamp: _maturationTimestamp, active: true }); stakes[_stakeId] = stakeInfo; userVotesRep[_beneficiary] += _amount; if (delegates[_beneficiary] == address(0)) { _delegate(_beneficiary, _beneficiary); } else { _moveDelegates(address(0), delegates[_beneficiary], _amount); } stakeLength += 1; totalStaked += _amount; emit Staked( _stakeId, _owner, _beneficiary, _amount, _maturationTimestamp ); } /** * Unstakes an existing stake * * @param _stakeId ID of the stake to unstake */ function unstake(uint64 _stakeId) external { require(_stakeId < stakeLength, "QUARTZ: Invalid id"); StakeInfo storage stakeInfo = stakes[_stakeId]; //slither-disable-next-line timestamp require( stakeInfo.maturationTimestamp <= _getBlockTimestamp(), "QUARTZ: Not ready to unstake" ); require(stakeInfo.active, "QUARTZ: Already unstaked"); require(stakeInfo.owner == msg.sender, "QUARTZ: Not owner"); stakeInfo.active = false; userVotesRep[stakeInfo.beneficiary] -= stakeInfo.amount; totalStaked -= stakeInfo.amount; _moveDelegates( delegates[stakeInfo.beneficiary], address(0), stakeInfo.amount ); _transfer(address(this), msg.sender, stakeInfo.amount); emit Unstaked( _stakeId, stakeInfo.owner, stakeInfo.beneficiary, stakeInfo.amount ); } /** * @notice Delegate votes from `msg.sender` to `delegatee` * * @param delegatee The address to delegate votes to */ function delegate(address delegatee) external { return _delegate(msg.sender, delegatee); } /** * Locks voting power in the governor contract. Used by the governor * contract when votes are cast, to lock them until the proposal is finished * * @notice Only callable by the governor contract * * @param user User to get votes from * @param amount How many votes to lock */ function moveVotesToGovernor(address user, uint256 amount) external override { require( msg.sender == address(governor), "QUARTZ: only governor can call" ); _moveDelegates(user, msg.sender, amount); } /** * Unlocks voting power from the governor contract. Used by the governor * contract when a proposal is finished, and all of its votes are unlocked * * @notice Only callable by the governor contract * * @param user User to get votes from * @param amount How many votes to unlock */ function moveVotesFromGovernor(address user, uint256 amount) external override { require( msg.sender == address(governor), "QUARTZ: only governor can call" ); _moveDelegates(msg.sender, user, amount); } /** * Gets the current votes balance for `account` * * @param account The address to get votes balance * @return The number of current votes for `account` */ function getCurrentVotes(address account) external view override returns (uint256) { uint32 nCheckpoints = numCheckpoints[account]; return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0; } // // Polygon PoS Bridge API // /** * @notice called when token is deposited on root chain * * @dev Should be callable only by ChildChainManager * Should handle deposit by minting the required amount for user * Make sure minting is done only by this function * * @param _user user address for whom deposit is being done * @param _depositData abi encoded amount */ function deposit(address _user, bytes calldata _depositData) external override onlyRole(DEPOSITOR_ROLE) { uint256 amount = abi.decode(_depositData, (uint256)); _mint(_user, amount); } /** * @notice called when user wants to withdraw tokens back to root chain * * @dev Should burn user's tokens. This transaction will be verified when exiting on root chain * * @param _amount amount of tokens to withdraw */ function withdraw(uint256 _amount) external override { _burn(_msgSender(), _amount); } // // Private logic // /** * Sets a new delegate for an account, overwriting any previously existing delegate * * @param delegator Account to delegate from * @param delegatee Account to delegate to */ function _delegate(address delegator, address delegatee) internal { require(delegatee != address(0), "QUARTZ: delegatee cannot be 0x0"); address currentDelegate = delegates[delegator]; uint256 delegatorVotesRep = userVotesRep[delegator]; delegates[delegator] = delegatee; emit DelegateChanged(delegator, currentDelegate, delegatee); _moveDelegates(currentDelegate, delegatee, delegatorVotesRep); } /** * Moves voting power from an old delegate to a new one * * @notice If no explicit delegate is registered, the account is actually * its own delegate so this function is always used when transfering voting * power * * @notice If not enough voting power exists on srcRep, we try to withdraw * votes from governor's executed or canceled proposals. If we still don't * have enough votes, and if dstRep is 0x0 (meaning we need to destroy * votes), we force governor to withdraw from active proposals as well, * until the target amount is reached * * @param srcRep Account from which to take votes. If 0x0, we're creating new voting power * @param dstRep Account which will receive votes. If 0x0, we're destroying voting power * @param amount Amount of votes to transfer */ function _moveDelegates( address srcRep, address dstRep, uint256 amount ) internal { // if both addresses are the same, or amount == 0, this is ano-op if (srcRep != dstRep && amount > 0) { if (srcRep != address(0)) { // remove voting power from srcRep uint32 srcRepNum = numCheckpoints[srcRep]; uint256 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0; if (srcRepOld < amount) { governor.withdrawRequiredVotes( srcRep, amount - srcRepOld, dstRep == address(0) ); srcRepNum = numCheckpoints[srcRep]; srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0; } uint256 srcRepNew = srcRepOld - amount; _writeCheckpoint(srcRep, srcRepNum, srcRepNew); } if (dstRep != address(0)) { // add voting power to dstRep uint32 dstRepNum = numCheckpoints[dstRep]; uint256 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0; uint256 dstRepNew = dstRepOld + amount; _writeCheckpoint(dstRep, dstRepNum, dstRepNew); } } } /** * Writes a new checkpoint with updated voting power info for a given delegatee * * @param delegatee The delegatee account * @param nCheckpoints How many checkpoints already exist for this delegatee * @param newVotes new voting power for this delegatee */ function _writeCheckpoint( address delegatee, uint32 nCheckpoints, uint256 newVotes ) internal { uint32 blockNumber = safe32( block.number, "Quartz::_writeCheckpoint: block number exceeds 32 bits" ); if ( //slither-disable-next-line incorrect-equality nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber ) { checkpoints[delegatee][nCheckpoints - 1].votes = newVotes; } else { checkpoints[delegatee][nCheckpoints] = Checkpoint( blockNumber, newVotes ); numCheckpoints[delegatee] = nCheckpoints + 1; } emit DelegateVotesChanged(delegatee, newVotes); } /** * Safely casts uint256 to uint32, reverting if it doesn't fit * * @param n Number to check * @param errorMessage message to throw in case of error * @return the converted uint32 */ function safe32(uint256 n, string memory errorMessage) internal pure returns (uint32) { require(n < 2**32, errorMessage); return uint32(n); } /** * Updates the minimum period for new stakes * * @notice Only callable by contract admin * * @param _minStakePeriod new minumum period */ function setMinStakePeriod(uint64 _minStakePeriod) external onlyRole(DEFAULT_ADMIN_ROLE) { minStakePeriod = _minStakePeriod; emit MinStakePeriodChanged(_minStakePeriod); } /** * Returns the current block timestamp as a uint64 */ function _getBlockTimestamp() private view returns (uint64) { return uint64(block.timestamp); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; import "../utils/ContextUpgradeable.sol"; import "../utils/StringsUpgradeable.sol"; import "../utils/introspection/ERC165Upgradeable.sol"; import "../proxy/utils/Initializable.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 AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable { function __AccessControl_init() internal initializer { __Context_init_unchained(); __ERC165_init_unchained(); __AccessControl_init_unchained(); } function __AccessControl_init_unchained() internal initializer { } 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, _msgSender()); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view override returns (bool) { return _roles[role].members[account]; } /** * @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 { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", StringsUpgradeable.toHexString(uint160(account), 20), " is missing role ", StringsUpgradeable.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 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. */ 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. */ 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 granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ 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. * * [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}. * ==== */ 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); } function _grantRole(bytes32 role, address account) private { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } uint256[49] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC20Upgradeable.sol"; import "./extensions/IERC20MetadataUpgradeable.sol"; import "../../utils/ContextUpgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ function __ERC20_init(string memory name_, string memory symbol_) internal initializer { __Context_init_unchained(); __ERC20_init_unchained(name_, symbol_); } function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(_msgSender(), spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; emit Transfer(sender, recipient, amount); _afterTokenTransfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} uint256[45] private __gap; }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.9; interface IQuartzGovernor { function withdrawRequiredVotes( address from, uint256 amount, bool force ) external; function getTotalUserVotes(address _voter) external view returns (uint256); }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.9; interface IQuartz { function moveVotesToGovernor(address user, uint256 amount) external; function moveVotesFromGovernor(address user, uint256 amount) external; function getCurrentVotes(address account) external view returns (uint256); function totalStaked() external view returns (uint256); }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.9; /** * ChildToken interface for PoS bridge */ interface IChildToken { function deposit(address user, bytes calldata depositData) external; function withdraw(uint256 amount) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControlUpgradeable { /** * @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 pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @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 ContextUpgradeable is Initializable { function __Context_init() internal initializer { __Context_init_unchained(); } function __Context_init_unchained() internal initializer { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @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] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.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 ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal initializer { __ERC165_init_unchained(); } function __ERC165_init_unchained() internal initializer { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { require(_initializing || !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } }
// SPDX-License-Identifier: MIT 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 IERC165Upgradeable { /** * @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 pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @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 `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, 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 `sender` to `recipient` 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 sender, address recipient, uint256 amount ) external returns (bool); /** * @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); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC20Upgradeable.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20MetadataUpgradeable is IERC20Upgradeable { /** * @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); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "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":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"fromDelegate","type":"address"},{"indexed":true,"internalType":"address","name":"toDelegate","type":"address"}],"name":"DelegateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegate","type":"address"},{"indexed":false,"internalType":"uint256","name":"newBalance","type":"uint256"}],"name":"DelegateVotesChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"governor","type":"address"}],"name":"GovernorChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"minStakePeriod","type":"uint64"}],"name":"MinStakePeriodChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"id","type":"uint64"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint64","name":"maturationTime","type":"uint64"}],"name":"Staked","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":"uint64","name":"id","type":"uint64"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Unstaked","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEPOSITOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"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":"","type":"address"},{"internalType":"uint32","name":"","type":"uint32"}],"name":"checkpoints","outputs":[{"internalType":"uint32","name":"fromBlock","type":"uint32"},{"internalType":"uint256","name":"votes","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","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":"address","name":"delegatee","type":"address"}],"name":"delegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"delegates","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"bytes","name":"_depositData","type":"bytes"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getCurrentVotes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"governor","outputs":[{"internalType":"contract IQuartzGovernor","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":[{"internalType":"uint64","name":"_minStakePeriod","type":"uint64"},{"internalType":"address","name":"_childChainManager","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minStakePeriod","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"moveVotesFromGovernor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"moveVotesToGovernor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"numCheckpoints","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IQuartzGovernor","name":"_governor","type":"address"}],"name":"setGovernor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_minStakePeriod","type":"uint64"}],"name":"setMinStakePeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_beneficiary","type":"address"},{"internalType":"uint64","name":"_period","type":"uint64"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakeLength","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"","type":"uint64"}],"name":"stakes","outputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint64","name":"period","type":"uint64"},{"internalType":"uint64","name":"maturationTimestamp","type":"uint64"},{"internalType":"bool","name":"active","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStaked","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":"uint64","name":"_stakeId","type":"uint64"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userVotesRep","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50612a03806100206000396000f3fe608060405234801561001057600080fd5b506004361061023d5760003560e01c806395d89b411161013b578063d4967282116100b8578063e197efbe1161007c578063e197efbe14610628578063f0601bdb1461063b578063f1127ed81461065b578063f977de1c146106b2578063fe85822d146106c557600080fd5b8063d496728214610584578063d547741f146105b6578063d7eecc7e146105c9578063d84f2bc6146105dc578063dd62ed3e146105ef57600080fd5b8063af14be5d116100ff578063af14be5d1461048e578063b4b5ea5714610538578063c42cf5351461054b578063cf2c52cb1461055e578063d29ab87a1461057157600080fd5b806395d89b4114610431578063a217fddf14610439578063a3b0b5a314610441578063a457c2d714610468578063a9059cbb1461047b57600080fd5b8063313ce567116101c95780635c19a95c1161018d5780635c19a95c1461039e5780636fcfff45146103b157806370a08231146103ec578063817b1cd21461041557806391d148541461041e57600080fd5b8063313ce5671461032d57806336568abe1461033c578063395093511461034f578063577440e914610362578063587cde1e1461037557600080fd5b806318160ddd1161021057806318160ddd146102bd57806323b872dd146102cf578063248a9ca3146102e25780632e1a7d4d146103055780632f2ff15d1461031a57600080fd5b806301ffc9a71461024257806306fdde031461026a578063095ea7b31461027f5780630c340a2414610292575b600080fd5b610255610250366004612498565b6106d8565b60405190151581526020015b60405180910390f35b61027261070f565b60405161026191906124ee565b61025561028d366004612536565b6107a1565b60c9546102a5906001600160a01b031681565b6040516001600160a01b039091168152602001610261565b6035545b604051908152602001610261565b6102556102dd366004612562565b6107b7565b6102c16102f03660046125a3565b60009081526097602052604090206001015490565b6103186103133660046125a3565b610866565b005b6103186103283660046125bc565b610873565b60405160128152602001610261565b61031861034a3660046125bc565b61089e565b61025561035d366004612536565b61091c565b610318610370366004612608565b610958565b6102a5610383366004612623565b60cb602052600090815260409020546001600160a01b031681565b6103186103ac366004612623565b6109ba565b6103d76103bf366004612623565b60cd6020526000908152604090205463ffffffff1681565b60405163ffffffff9091168152602001610261565b6102c16103fa366004612623565b6001600160a01b031660009081526033602052604090205490565b6102c160d05481565b61025561042c3660046125bc565b6109c4565b6102726109ef565b6102c1600081565b6102c17f8f4f2da22e8ac8f11e15f9fc141cddbb5deea8800186560abb6e68c5496619a981565b610255610476366004612536565b6109fe565b610255610489366004612536565b610a97565b6104f261049c366004612608565b60cf6020526000908152604090208054600182015460028301546003909301546001600160a01b039283169391909216916001600160401b0380821691600160401b81049091169060ff600160801b9091041686565b604080516001600160a01b039788168152969095166020870152938501929092526001600160401b039081166060850152166080830152151560a082015260c001610261565b6102c1610546366004612623565b610aa4565b610318610559366004612623565b610b19565b61031861056c366004612640565b610c1f565b61031861057f366004612608565b610c6b565b60ce5461059e90600160401b90046001600160401b031681565b6040516001600160401b039091168152602001610261565b6103186105c43660046125bc565b610ee8565b6103186105d73660046126c4565b610f0e565b60ce5461059e906001600160401b031681565b6102c16105fd3660046126f0565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b610318610636366004612536565b6110bc565b6102c1610649366004612623565b60ca6020526000908152604090205481565b61069661066936600461270e565b60cc6020908152600092835260408084209091529082529020805460019091015463ffffffff9091169082565b6040805163ffffffff9093168352602083019190915201610261565b6103186106c0366004612536565b611121565b6103186106d3366004612745565b611186565b60006001600160e01b03198216637965db0b60e01b148061070957506301ffc9a760e01b6001600160e01b03198316145b92915050565b60606036805461071e90612783565b80601f016020809104026020016040519081016040528092919081815260200182805461074a90612783565b80156107975780601f1061076c57610100808354040283529160200191610797565b820191906000526020600020905b81548152906001019060200180831161077a57829003601f168201915b5050505050905090565b60006107ae3384846114f7565b50600192915050565b60006107c484848461161b565b6001600160a01b03841660009081526034602090815260408083203384529091529020548281101561084e5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b61085b85338584036114f7565b506001949350505050565b61087033826117eb565b50565b60008281526097602052604090206001015461088f8133611939565b610899838361199d565b505050565b6001600160a01b038116331461090e5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610845565b6109188282611a23565b5050565b3360008181526034602090815260408083206001600160a01b038716845290915281205490916107ae9185906109539086906127d4565b6114f7565b60006109648133611939565b60ce805467ffffffffffffffff19166001600160401b0384169081179091556040519081527f1b8eba8186beea9a9877e2a965617e7d58f4c1bbb53be0c5c6586384823510419060200160405180910390a15050565b6108703382611a8a565b60009182526097602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60606037805461071e90612783565b3360009081526034602090815260408083206001600160a01b038616845290915281205482811015610a805760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610845565b610a8d33858584036114f7565b5060019392505050565b60006107ae33848461161b565b6001600160a01b038116600090815260cd602052604081205463ffffffff1680610acf576000610b12565b6001600160a01b038316600090815260cc6020526040812090610af36001846127ec565b63ffffffff1663ffffffff168152602001908152602001600020600101545b9392505050565b6000610b258133611939565b6001600160a01b038216610b7b5760405162461bcd60e51b815260206004820152601f60248201527f51554152545a3a20476f7665726e6f722063616e6e6f74206265207a65726f006044820152606401610845565b60c9546001600160a01b031615610bd45760405162461bcd60e51b815260206004820152601c60248201527f51554152545a3a20476f7665726e6f7220616c726561647920736574000000006044820152606401610845565b60c980546001600160a01b0319166001600160a01b0384169081179091556040517f5ffbefd23f1844198adf645535c8dce8d9f3f2f9f5e917bf4e3aa8fc90299a9090600090a25050565b7f8f4f2da22e8ac8f11e15f9fc141cddbb5deea8800186560abb6e68c5496619a9610c4a8133611939565b6000610c58838501856125a3565b9050610c648582611b5a565b5050505050565b60ce546001600160401b03600160401b909104811690821610610cc55760405162461bcd60e51b81526020600482015260126024820152711455505495168e88125b9d985b1a59081a5960721b6044820152606401610845565b6001600160401b03818116600090815260cf6020526040902060038101549091428116600160401b909204161115610d3f5760405162461bcd60e51b815260206004820152601c60248201527f51554152545a3a204e6f7420726561647920746f20756e7374616b65000000006044820152606401610845565b6003810154600160801b900460ff16610d9a5760405162461bcd60e51b815260206004820152601860248201527f51554152545a3a20416c726561647920756e7374616b656400000000000000006044820152606401610845565b80546001600160a01b03163314610de75760405162461bcd60e51b815260206004820152601160248201527028aaa0a92a2d1d102737ba1037bbb732b960791b6044820152606401610845565b60038101805460ff60801b19169055600281015460018201546001600160a01b0316600090815260ca602052604081208054909190610e27908490612811565b9091555050600281015460d08054600090610e43908490612811565b909155505060018101546001600160a01b03908116600090815260cb60205260408120546002840154610e7b93919091169190611c39565b610e8a3033836002015461161b565b6001810154815460028301546040519081526001600160a01b0392831692909116906001600160401b038516907f2806d44cd3ddd552c2fb779db451721a692f4e817549bbed3cbaa3e1d795f5d99060200160405180910390a45050565b600082815260976020526040902060010154610f048133611939565b6108998383611a23565b600054610100900460ff1680610f27575060005460ff16155b610f435760405162461bcd60e51b815260040161084590612828565b600054610100900460ff16158015610f65576000805461ffff19166101011790555b60ce805467ffffffffffffffff19166001600160401b0385169081179091556040519081527f1b8eba8186beea9a9877e2a965617e7d58f4c1bbb53be0c5c6586384823510419060200160405180910390a16001600160a01b0382166110205760405162461bcd60e51b815260206004820152602a60248201527f51554152545a3a204368696c6420636861696e206d616e616765722063616e6e6044820152696f74206265207a65726f60b01b6064820152608401610845565b6110696040518060400160405280600981526020016853616e64636c6f636b60b81b8152506040518060400160405280600681526020016528aaa0a92a2d60d11b815250611e9f565b611071611f08565b61107c600033611f8b565b6110a67f8f4f2da22e8ac8f11e15f9fc141cddbb5deea8800186560abb6e68c5496619a983611f8b565b8015610899576000805461ff0019169055505050565b60c9546001600160a01b031633146111165760405162461bcd60e51b815260206004820152601e60248201527f51554152545a3a206f6e6c7920676f7665726e6f722063616e2063616c6c00006044820152606401610845565b610918823383611c39565b60c9546001600160a01b0316331461117b5760405162461bcd60e51b815260206004820152601e60248201527f51554152545a3a206f6e6c7920676f7665726e6f722063616e2063616c6c00006044820152606401610845565b610918338383611c39565b6001600160a01b0382166111e65760405162461bcd60e51b815260206004820152602160248201527f51554152545a3a2042656e65666963696172792063616e6e6f742062652030786044820152600360fc1b6064820152608401610845565b600083116112475760405162461bcd60e51b815260206004820152602860248201527f51554152545a3a20416d6f756e74206d7573742062652067726561746572207460448201526768616e207a65726f60c01b6064820152608401610845565b60ce546001600160401b0390811690821610156112ba5760405162461bcd60e51b815260206004820152602b60248201527f51554152545a3a20506572696f64206d7573742062652067726561746572207460448201526a68616e206d696e696d756d60a81b6064820152608401610845565b6112c533308561161b565b60ce543390600160401b90046001600160401b031660006112e68442612876565b6040805160c0810182526001600160a01b03808716825288811660208084018281528486018d81526001600160401b03808d1660608801908152818a1660808901908152600160a08a018181528e8516600090815260cf89528c81208c518154908d166001600160a01b03199182161782559851938101805494909c16939098169290921790995593516002860155905160039094018054915197511515600160801b0260ff60801b19988416600160401b026fffffffffffffffffffffffffffffffff199093169590931694909417179590951694909417905590825260ca9052918220805493945090928992906113e09084906127d4565b90915550506001600160a01b03868116600090815260cb6020526040902054166114135761140e8687611a8a565b611438565b6001600160a01b03808716600090815260cb6020526040812054611438921689611c39565b600160ce60088282829054906101000a90046001600160401b031661145d9190612876565b92506101000a8154816001600160401b0302191690836001600160401b031602179055508660d0600082825461149391906127d4565b9091555050604080518881526001600160401b0384811660208301526001600160a01b03808a169390881692918716917f0e19c1574798346661139391be6cc6e850cc2373284e6f60d667a3be63bb3dd9910160405180910390a450505050505050565b6001600160a01b0383166115595760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610845565b6001600160a01b0382166115ba5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610845565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661167f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610845565b6001600160a01b0382166116e15760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610845565b6001600160a01b038316600090815260336020526040902054818110156117595760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610845565b6001600160a01b038085166000908152603360205260408082208585039055918516815290812080548492906117909084906127d4565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516117dc91815260200190565b60405180910390a35b50505050565b6001600160a01b03821661184b5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610845565b6001600160a01b038216600090815260336020526040902054818110156118bf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610845565b6001600160a01b03831660009081526033602052604081208383039055603580548492906118ee908490612811565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b61194382826109c4565b6109185761195b816001600160a01b03166014611f95565b611966836020611f95565b6040516020016119779291906128a1565b60408051601f198184030181529082905262461bcd60e51b8252610845916004016124ee565b6119a782826109c4565b6109185760008281526097602090815260408083206001600160a01b03851684529091529020805460ff191660011790556119df3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b611a2d82826109c4565b156109185760008281526097602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6001600160a01b038116611ae05760405162461bcd60e51b815260206004820152601f60248201527f51554152545a3a2064656c6567617465652063616e6e6f7420626520307830006044820152606401610845565b6001600160a01b03808316600081815260cb60208181526040808420805460ca845282862054949093528787166001600160a01b03198416811790915590519190951694919391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a46117e5828483611c39565b6001600160a01b038216611bb05760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610845565b8060356000828254611bc291906127d4565b90915550506001600160a01b03821660009081526033602052604081208054839290611bef9084906127d4565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b816001600160a01b0316836001600160a01b031614158015611c5b5750600081115b15610899576001600160a01b03831615611dfe576001600160a01b038316600090815260cd602052604081205463ffffffff169081611c9b576000611cde565b6001600160a01b038516600090815260cc6020526040812090611cbf6001856127ec565b63ffffffff1663ffffffff168152602001908152602001600020600101545b905082811015611de15760c9546001600160a01b031663cba7f62386611d048487612811565b60405160e084901b6001600160e01b03191681526001600160a01b0392831660048201526024810191909152908716156044820152606401600060405180830381600087803b158015611d5657600080fd5b505af1158015611d6a573d6000803e3d6000fd5b5050506001600160a01b038616600090815260cd602052604090205463ffffffff1692505081611d9b576000611dde565b6001600160a01b038516600090815260cc6020526040812090611dbf6001856127ec565b63ffffffff1663ffffffff168152602001908152602001600020600101545b90505b6000611ded8483612811565b9050611dfa868483612130565b5050505b6001600160a01b03821615610899576001600160a01b038216600090815260cd602052604081205463ffffffff169081611e39576000611e7c565b6001600160a01b038416600090815260cc6020526040812090611e5d6001856127ec565b63ffffffff1663ffffffff168152602001908152602001600020600101545b90506000611e8a84836127d4565b9050611e97858483612130565b505050505050565b600054610100900460ff1680611eb8575060005460ff16155b611ed45760405162461bcd60e51b815260040161084590612828565b600054610100900460ff16158015611ef6576000805461ffff19166101011790555b611efe6122d0565b6110a6838361233a565b600054610100900460ff1680611f21575060005460ff16155b611f3d5760405162461bcd60e51b815260040161084590612828565b600054610100900460ff16158015611f5f576000805461ffff19166101011790555b611f676122d0565b611f6f6122d0565b611f776122d0565b8015610870576000805461ff001916905550565b610918828261199d565b60606000611fa4836002612916565b611faf9060026127d4565b6001600160401b03811115611fc657611fc6612935565b6040519080825280601f01601f191660200182016040528015611ff0576020820181803683370190505b509050600360fc1b8160008151811061200b5761200b61294b565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061203a5761203a61294b565b60200101906001600160f81b031916908160001a905350600061205e846002612916565b6120699060016127d4565b90505b60018111156120e1576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061209d5761209d61294b565b1a60f81b8282815181106120b3576120b361294b565b60200101906001600160f81b031916908160001a90535060049490941c936120da81612961565b905061206c565b508315610b125760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610845565b600061215443604051806060016040528060368152602001612998603691396123cf565b905060008363ffffffff161180156121ae57506001600160a01b038416600090815260cc6020526040812063ffffffff8316916121926001876127ec565b63ffffffff908116825260208201929092526040016000205416145b156121f7576001600160a01b038416600090815260cc6020526040812083916121d86001876127ec565b63ffffffff168152602081019190915260400160002060010155612287565b60408051808201825263ffffffff838116825260208083018681526001600160a01b038916600090815260cc835285812089851682529092529390209151825463ffffffff191691161781559051600191820155612256908490612978565b6001600160a01b038516600090815260cd60205260409020805463ffffffff191663ffffffff929092169190911790555b836001600160a01b03167fec403710888771623c684636fcba8fca8ecf0a71dab5548254bb8883f569e872836040516122c291815260200190565b60405180910390a250505050565b600054610100900460ff16806122e9575060005460ff16155b6123055760405162461bcd60e51b815260040161084590612828565b600054610100900460ff16158015611f77576000805461ffff19166101011790558015610870576000805461ff001916905550565b600054610100900460ff1680612353575060005460ff16155b61236f5760405162461bcd60e51b815260040161084590612828565b600054610100900460ff16158015612391576000805461ffff19166101011790555b82516123a49060369060208601906123ff565b5081516123b89060379060208501906123ff565b508015610899576000805461ff0019169055505050565b60008164010000000084106123f75760405162461bcd60e51b815260040161084591906124ee565b509192915050565b82805461240b90612783565b90600052602060002090601f01602090048101928261242d5760008555612473565b82601f1061244657805160ff1916838001178555612473565b82800160010185558215612473579182015b82811115612473578251825591602001919060010190612458565b5061247f929150612483565b5090565b5b8082111561247f5760008155600101612484565b6000602082840312156124aa57600080fd5b81356001600160e01b031981168114610b1257600080fd5b60005b838110156124dd5781810151838201526020016124c5565b838111156117e55750506000910152565b602081526000825180602084015261250d8160408501602087016124c2565b601f01601f19169190910160400192915050565b6001600160a01b038116811461087057600080fd5b6000806040838503121561254957600080fd5b823561255481612521565b946020939093013593505050565b60008060006060848603121561257757600080fd5b833561258281612521565b9250602084013561259281612521565b929592945050506040919091013590565b6000602082840312156125b557600080fd5b5035919050565b600080604083850312156125cf57600080fd5b8235915060208301356125e181612521565b809150509250929050565b80356001600160401b038116811461260357600080fd5b919050565b60006020828403121561261a57600080fd5b610b12826125ec565b60006020828403121561263557600080fd5b8135610b1281612521565b60008060006040848603121561265557600080fd5b833561266081612521565b925060208401356001600160401b038082111561267c57600080fd5b818601915086601f83011261269057600080fd5b81358181111561269f57600080fd5b8760208285010111156126b157600080fd5b6020830194508093505050509250925092565b600080604083850312156126d757600080fd5b6126e0836125ec565b915060208301356125e181612521565b6000806040838503121561270357600080fd5b82356126e081612521565b6000806040838503121561272157600080fd5b823561272c81612521565b9150602083013563ffffffff811681146125e157600080fd5b60008060006060848603121561275a57600080fd5b83359250602084013561276c81612521565b915061277a604085016125ec565b90509250925092565b600181811c9082168061279757607f821691505b602082108114156127b857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600082198211156127e7576127e76127be565b500190565b600063ffffffff83811690831681811015612809576128096127be565b039392505050565b600082821015612823576128236127be565b500390565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b60006001600160401b03808316818516808303821115612898576128986127be565b01949350505050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516128d98160178501602088016124c2565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161290a8160288401602088016124c2565b01602801949350505050565b6000816000190483118215151615612930576129306127be565b500290565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600081612970576129706127be565b506000190190565b600063ffffffff808316818516808303821115612898576128986127be56fe51756172747a3a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473a2646970667358221220cacd089d134d126c2dbd3ed09bd27722179f66120ce5f777573b9fb69261dc3864736f6c63430008090033
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061023d5760003560e01c806395d89b411161013b578063d4967282116100b8578063e197efbe1161007c578063e197efbe14610628578063f0601bdb1461063b578063f1127ed81461065b578063f977de1c146106b2578063fe85822d146106c557600080fd5b8063d496728214610584578063d547741f146105b6578063d7eecc7e146105c9578063d84f2bc6146105dc578063dd62ed3e146105ef57600080fd5b8063af14be5d116100ff578063af14be5d1461048e578063b4b5ea5714610538578063c42cf5351461054b578063cf2c52cb1461055e578063d29ab87a1461057157600080fd5b806395d89b4114610431578063a217fddf14610439578063a3b0b5a314610441578063a457c2d714610468578063a9059cbb1461047b57600080fd5b8063313ce567116101c95780635c19a95c1161018d5780635c19a95c1461039e5780636fcfff45146103b157806370a08231146103ec578063817b1cd21461041557806391d148541461041e57600080fd5b8063313ce5671461032d57806336568abe1461033c578063395093511461034f578063577440e914610362578063587cde1e1461037557600080fd5b806318160ddd1161021057806318160ddd146102bd57806323b872dd146102cf578063248a9ca3146102e25780632e1a7d4d146103055780632f2ff15d1461031a57600080fd5b806301ffc9a71461024257806306fdde031461026a578063095ea7b31461027f5780630c340a2414610292575b600080fd5b610255610250366004612498565b6106d8565b60405190151581526020015b60405180910390f35b61027261070f565b60405161026191906124ee565b61025561028d366004612536565b6107a1565b60c9546102a5906001600160a01b031681565b6040516001600160a01b039091168152602001610261565b6035545b604051908152602001610261565b6102556102dd366004612562565b6107b7565b6102c16102f03660046125a3565b60009081526097602052604090206001015490565b6103186103133660046125a3565b610866565b005b6103186103283660046125bc565b610873565b60405160128152602001610261565b61031861034a3660046125bc565b61089e565b61025561035d366004612536565b61091c565b610318610370366004612608565b610958565b6102a5610383366004612623565b60cb602052600090815260409020546001600160a01b031681565b6103186103ac366004612623565b6109ba565b6103d76103bf366004612623565b60cd6020526000908152604090205463ffffffff1681565b60405163ffffffff9091168152602001610261565b6102c16103fa366004612623565b6001600160a01b031660009081526033602052604090205490565b6102c160d05481565b61025561042c3660046125bc565b6109c4565b6102726109ef565b6102c1600081565b6102c17f8f4f2da22e8ac8f11e15f9fc141cddbb5deea8800186560abb6e68c5496619a981565b610255610476366004612536565b6109fe565b610255610489366004612536565b610a97565b6104f261049c366004612608565b60cf6020526000908152604090208054600182015460028301546003909301546001600160a01b039283169391909216916001600160401b0380821691600160401b81049091169060ff600160801b9091041686565b604080516001600160a01b039788168152969095166020870152938501929092526001600160401b039081166060850152166080830152151560a082015260c001610261565b6102c1610546366004612623565b610aa4565b610318610559366004612623565b610b19565b61031861056c366004612640565b610c1f565b61031861057f366004612608565b610c6b565b60ce5461059e90600160401b90046001600160401b031681565b6040516001600160401b039091168152602001610261565b6103186105c43660046125bc565b610ee8565b6103186105d73660046126c4565b610f0e565b60ce5461059e906001600160401b031681565b6102c16105fd3660046126f0565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b610318610636366004612536565b6110bc565b6102c1610649366004612623565b60ca6020526000908152604090205481565b61069661066936600461270e565b60cc6020908152600092835260408084209091529082529020805460019091015463ffffffff9091169082565b6040805163ffffffff9093168352602083019190915201610261565b6103186106c0366004612536565b611121565b6103186106d3366004612745565b611186565b60006001600160e01b03198216637965db0b60e01b148061070957506301ffc9a760e01b6001600160e01b03198316145b92915050565b60606036805461071e90612783565b80601f016020809104026020016040519081016040528092919081815260200182805461074a90612783565b80156107975780601f1061076c57610100808354040283529160200191610797565b820191906000526020600020905b81548152906001019060200180831161077a57829003601f168201915b5050505050905090565b60006107ae3384846114f7565b50600192915050565b60006107c484848461161b565b6001600160a01b03841660009081526034602090815260408083203384529091529020548281101561084e5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b61085b85338584036114f7565b506001949350505050565b61087033826117eb565b50565b60008281526097602052604090206001015461088f8133611939565b610899838361199d565b505050565b6001600160a01b038116331461090e5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610845565b6109188282611a23565b5050565b3360008181526034602090815260408083206001600160a01b038716845290915281205490916107ae9185906109539086906127d4565b6114f7565b60006109648133611939565b60ce805467ffffffffffffffff19166001600160401b0384169081179091556040519081527f1b8eba8186beea9a9877e2a965617e7d58f4c1bbb53be0c5c6586384823510419060200160405180910390a15050565b6108703382611a8a565b60009182526097602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60606037805461071e90612783565b3360009081526034602090815260408083206001600160a01b038616845290915281205482811015610a805760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610845565b610a8d33858584036114f7565b5060019392505050565b60006107ae33848461161b565b6001600160a01b038116600090815260cd602052604081205463ffffffff1680610acf576000610b12565b6001600160a01b038316600090815260cc6020526040812090610af36001846127ec565b63ffffffff1663ffffffff168152602001908152602001600020600101545b9392505050565b6000610b258133611939565b6001600160a01b038216610b7b5760405162461bcd60e51b815260206004820152601f60248201527f51554152545a3a20476f7665726e6f722063616e6e6f74206265207a65726f006044820152606401610845565b60c9546001600160a01b031615610bd45760405162461bcd60e51b815260206004820152601c60248201527f51554152545a3a20476f7665726e6f7220616c726561647920736574000000006044820152606401610845565b60c980546001600160a01b0319166001600160a01b0384169081179091556040517f5ffbefd23f1844198adf645535c8dce8d9f3f2f9f5e917bf4e3aa8fc90299a9090600090a25050565b7f8f4f2da22e8ac8f11e15f9fc141cddbb5deea8800186560abb6e68c5496619a9610c4a8133611939565b6000610c58838501856125a3565b9050610c648582611b5a565b5050505050565b60ce546001600160401b03600160401b909104811690821610610cc55760405162461bcd60e51b81526020600482015260126024820152711455505495168e88125b9d985b1a59081a5960721b6044820152606401610845565b6001600160401b03818116600090815260cf6020526040902060038101549091428116600160401b909204161115610d3f5760405162461bcd60e51b815260206004820152601c60248201527f51554152545a3a204e6f7420726561647920746f20756e7374616b65000000006044820152606401610845565b6003810154600160801b900460ff16610d9a5760405162461bcd60e51b815260206004820152601860248201527f51554152545a3a20416c726561647920756e7374616b656400000000000000006044820152606401610845565b80546001600160a01b03163314610de75760405162461bcd60e51b815260206004820152601160248201527028aaa0a92a2d1d102737ba1037bbb732b960791b6044820152606401610845565b60038101805460ff60801b19169055600281015460018201546001600160a01b0316600090815260ca602052604081208054909190610e27908490612811565b9091555050600281015460d08054600090610e43908490612811565b909155505060018101546001600160a01b03908116600090815260cb60205260408120546002840154610e7b93919091169190611c39565b610e8a3033836002015461161b565b6001810154815460028301546040519081526001600160a01b0392831692909116906001600160401b038516907f2806d44cd3ddd552c2fb779db451721a692f4e817549bbed3cbaa3e1d795f5d99060200160405180910390a45050565b600082815260976020526040902060010154610f048133611939565b6108998383611a23565b600054610100900460ff1680610f27575060005460ff16155b610f435760405162461bcd60e51b815260040161084590612828565b600054610100900460ff16158015610f65576000805461ffff19166101011790555b60ce805467ffffffffffffffff19166001600160401b0385169081179091556040519081527f1b8eba8186beea9a9877e2a965617e7d58f4c1bbb53be0c5c6586384823510419060200160405180910390a16001600160a01b0382166110205760405162461bcd60e51b815260206004820152602a60248201527f51554152545a3a204368696c6420636861696e206d616e616765722063616e6e6044820152696f74206265207a65726f60b01b6064820152608401610845565b6110696040518060400160405280600981526020016853616e64636c6f636b60b81b8152506040518060400160405280600681526020016528aaa0a92a2d60d11b815250611e9f565b611071611f08565b61107c600033611f8b565b6110a67f8f4f2da22e8ac8f11e15f9fc141cddbb5deea8800186560abb6e68c5496619a983611f8b565b8015610899576000805461ff0019169055505050565b60c9546001600160a01b031633146111165760405162461bcd60e51b815260206004820152601e60248201527f51554152545a3a206f6e6c7920676f7665726e6f722063616e2063616c6c00006044820152606401610845565b610918823383611c39565b60c9546001600160a01b0316331461117b5760405162461bcd60e51b815260206004820152601e60248201527f51554152545a3a206f6e6c7920676f7665726e6f722063616e2063616c6c00006044820152606401610845565b610918338383611c39565b6001600160a01b0382166111e65760405162461bcd60e51b815260206004820152602160248201527f51554152545a3a2042656e65666963696172792063616e6e6f742062652030786044820152600360fc1b6064820152608401610845565b600083116112475760405162461bcd60e51b815260206004820152602860248201527f51554152545a3a20416d6f756e74206d7573742062652067726561746572207460448201526768616e207a65726f60c01b6064820152608401610845565b60ce546001600160401b0390811690821610156112ba5760405162461bcd60e51b815260206004820152602b60248201527f51554152545a3a20506572696f64206d7573742062652067726561746572207460448201526a68616e206d696e696d756d60a81b6064820152608401610845565b6112c533308561161b565b60ce543390600160401b90046001600160401b031660006112e68442612876565b6040805160c0810182526001600160a01b03808716825288811660208084018281528486018d81526001600160401b03808d1660608801908152818a1660808901908152600160a08a018181528e8516600090815260cf89528c81208c518154908d166001600160a01b03199182161782559851938101805494909c16939098169290921790995593516002860155905160039094018054915197511515600160801b0260ff60801b19988416600160401b026fffffffffffffffffffffffffffffffff199093169590931694909417179590951694909417905590825260ca9052918220805493945090928992906113e09084906127d4565b90915550506001600160a01b03868116600090815260cb6020526040902054166114135761140e8687611a8a565b611438565b6001600160a01b03808716600090815260cb6020526040812054611438921689611c39565b600160ce60088282829054906101000a90046001600160401b031661145d9190612876565b92506101000a8154816001600160401b0302191690836001600160401b031602179055508660d0600082825461149391906127d4565b9091555050604080518881526001600160401b0384811660208301526001600160a01b03808a169390881692918716917f0e19c1574798346661139391be6cc6e850cc2373284e6f60d667a3be63bb3dd9910160405180910390a450505050505050565b6001600160a01b0383166115595760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610845565b6001600160a01b0382166115ba5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610845565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661167f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610845565b6001600160a01b0382166116e15760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610845565b6001600160a01b038316600090815260336020526040902054818110156117595760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610845565b6001600160a01b038085166000908152603360205260408082208585039055918516815290812080548492906117909084906127d4565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516117dc91815260200190565b60405180910390a35b50505050565b6001600160a01b03821661184b5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610845565b6001600160a01b038216600090815260336020526040902054818110156118bf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610845565b6001600160a01b03831660009081526033602052604081208383039055603580548492906118ee908490612811565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b61194382826109c4565b6109185761195b816001600160a01b03166014611f95565b611966836020611f95565b6040516020016119779291906128a1565b60408051601f198184030181529082905262461bcd60e51b8252610845916004016124ee565b6119a782826109c4565b6109185760008281526097602090815260408083206001600160a01b03851684529091529020805460ff191660011790556119df3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b611a2d82826109c4565b156109185760008281526097602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6001600160a01b038116611ae05760405162461bcd60e51b815260206004820152601f60248201527f51554152545a3a2064656c6567617465652063616e6e6f7420626520307830006044820152606401610845565b6001600160a01b03808316600081815260cb60208181526040808420805460ca845282862054949093528787166001600160a01b03198416811790915590519190951694919391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a46117e5828483611c39565b6001600160a01b038216611bb05760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610845565b8060356000828254611bc291906127d4565b90915550506001600160a01b03821660009081526033602052604081208054839290611bef9084906127d4565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b816001600160a01b0316836001600160a01b031614158015611c5b5750600081115b15610899576001600160a01b03831615611dfe576001600160a01b038316600090815260cd602052604081205463ffffffff169081611c9b576000611cde565b6001600160a01b038516600090815260cc6020526040812090611cbf6001856127ec565b63ffffffff1663ffffffff168152602001908152602001600020600101545b905082811015611de15760c9546001600160a01b031663cba7f62386611d048487612811565b60405160e084901b6001600160e01b03191681526001600160a01b0392831660048201526024810191909152908716156044820152606401600060405180830381600087803b158015611d5657600080fd5b505af1158015611d6a573d6000803e3d6000fd5b5050506001600160a01b038616600090815260cd602052604090205463ffffffff1692505081611d9b576000611dde565b6001600160a01b038516600090815260cc6020526040812090611dbf6001856127ec565b63ffffffff1663ffffffff168152602001908152602001600020600101545b90505b6000611ded8483612811565b9050611dfa868483612130565b5050505b6001600160a01b03821615610899576001600160a01b038216600090815260cd602052604081205463ffffffff169081611e39576000611e7c565b6001600160a01b038416600090815260cc6020526040812090611e5d6001856127ec565b63ffffffff1663ffffffff168152602001908152602001600020600101545b90506000611e8a84836127d4565b9050611e97858483612130565b505050505050565b600054610100900460ff1680611eb8575060005460ff16155b611ed45760405162461bcd60e51b815260040161084590612828565b600054610100900460ff16158015611ef6576000805461ffff19166101011790555b611efe6122d0565b6110a6838361233a565b600054610100900460ff1680611f21575060005460ff16155b611f3d5760405162461bcd60e51b815260040161084590612828565b600054610100900460ff16158015611f5f576000805461ffff19166101011790555b611f676122d0565b611f6f6122d0565b611f776122d0565b8015610870576000805461ff001916905550565b610918828261199d565b60606000611fa4836002612916565b611faf9060026127d4565b6001600160401b03811115611fc657611fc6612935565b6040519080825280601f01601f191660200182016040528015611ff0576020820181803683370190505b509050600360fc1b8160008151811061200b5761200b61294b565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061203a5761203a61294b565b60200101906001600160f81b031916908160001a905350600061205e846002612916565b6120699060016127d4565b90505b60018111156120e1576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061209d5761209d61294b565b1a60f81b8282815181106120b3576120b361294b565b60200101906001600160f81b031916908160001a90535060049490941c936120da81612961565b905061206c565b508315610b125760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610845565b600061215443604051806060016040528060368152602001612998603691396123cf565b905060008363ffffffff161180156121ae57506001600160a01b038416600090815260cc6020526040812063ffffffff8316916121926001876127ec565b63ffffffff908116825260208201929092526040016000205416145b156121f7576001600160a01b038416600090815260cc6020526040812083916121d86001876127ec565b63ffffffff168152602081019190915260400160002060010155612287565b60408051808201825263ffffffff838116825260208083018681526001600160a01b038916600090815260cc835285812089851682529092529390209151825463ffffffff191691161781559051600191820155612256908490612978565b6001600160a01b038516600090815260cd60205260409020805463ffffffff191663ffffffff929092169190911790555b836001600160a01b03167fec403710888771623c684636fcba8fca8ecf0a71dab5548254bb8883f569e872836040516122c291815260200190565b60405180910390a250505050565b600054610100900460ff16806122e9575060005460ff16155b6123055760405162461bcd60e51b815260040161084590612828565b600054610100900460ff16158015611f77576000805461ffff19166101011790558015610870576000805461ff001916905550565b600054610100900460ff1680612353575060005460ff16155b61236f5760405162461bcd60e51b815260040161084590612828565b600054610100900460ff16158015612391576000805461ffff19166101011790555b82516123a49060369060208601906123ff565b5081516123b89060379060208501906123ff565b508015610899576000805461ff0019169055505050565b60008164010000000084106123f75760405162461bcd60e51b815260040161084591906124ee565b509192915050565b82805461240b90612783565b90600052602060002090601f01602090048101928261242d5760008555612473565b82601f1061244657805160ff1916838001178555612473565b82800160010185558215612473579182015b82811115612473578251825591602001919060010190612458565b5061247f929150612483565b5090565b5b8082111561247f5760008155600101612484565b6000602082840312156124aa57600080fd5b81356001600160e01b031981168114610b1257600080fd5b60005b838110156124dd5781810151838201526020016124c5565b838111156117e55750506000910152565b602081526000825180602084015261250d8160408501602087016124c2565b601f01601f19169190910160400192915050565b6001600160a01b038116811461087057600080fd5b6000806040838503121561254957600080fd5b823561255481612521565b946020939093013593505050565b60008060006060848603121561257757600080fd5b833561258281612521565b9250602084013561259281612521565b929592945050506040919091013590565b6000602082840312156125b557600080fd5b5035919050565b600080604083850312156125cf57600080fd5b8235915060208301356125e181612521565b809150509250929050565b80356001600160401b038116811461260357600080fd5b919050565b60006020828403121561261a57600080fd5b610b12826125ec565b60006020828403121561263557600080fd5b8135610b1281612521565b60008060006040848603121561265557600080fd5b833561266081612521565b925060208401356001600160401b038082111561267c57600080fd5b818601915086601f83011261269057600080fd5b81358181111561269f57600080fd5b8760208285010111156126b157600080fd5b6020830194508093505050509250925092565b600080604083850312156126d757600080fd5b6126e0836125ec565b915060208301356125e181612521565b6000806040838503121561270357600080fd5b82356126e081612521565b6000806040838503121561272157600080fd5b823561272c81612521565b9150602083013563ffffffff811681146125e157600080fd5b60008060006060848603121561275a57600080fd5b83359250602084013561276c81612521565b915061277a604085016125ec565b90509250925092565b600181811c9082168061279757607f821691505b602082108114156127b857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600082198211156127e7576127e76127be565b500190565b600063ffffffff83811690831681811015612809576128096127be565b039392505050565b600082821015612823576128236127be565b500390565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b60006001600160401b03808316818516808303821115612898576128986127be565b01949350505050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516128d98160178501602088016124c2565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161290a8160288401602088016124c2565b01602801949350505050565b6000816000190483118215151615612930576129306127be565b500290565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600081612970576129706127be565b506000190190565b600063ffffffff808316818516808303821115612898576128986127be56fe51756172747a3a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473a2646970667358221220cacd089d134d126c2dbd3ed09bd27722179f66120ce5f777573b9fb69261dc3864736f6c63430008090033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.