Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Become | 11309845 | 1503 days ago | IN | 0 ETH | 0.00276806 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
VotingPower
Compiler Version
v0.7.4+commit.3f05b770
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; import "./interfaces/IERC20.sol"; import "./lib/SafeMath.sol"; import "./lib/ReentrancyGuardUpgradeSafe.sol"; import "./lib/PrismProxyImplementation.sol"; import "./lib/VotingPowerStorage.sol"; import "./lib/SafeERC20.sol"; /** * @title VotingPower * @dev Implementation contract for voting power prism proxy * Calls should not be made directly to this contract, instead make calls to the VotingPowerPrism proxy contract * The exception to this is the `become` function specified in PrismProxyImplementation * This function is called once and is used by this contract to accept its role as the implementation for the prism proxy */ contract VotingPower is PrismProxyImplementation, ReentrancyGuardUpgradeSafe { using SafeMath for uint256; using SafeERC20 for IERC20; /// @notice An event that's emitted when a user's staked balance increases event Staked(address indexed user, address indexed token, uint256 indexed amount, uint256 votingPower); /// @notice An event that's emitted when a user's staked balance decreases event Withdrawn(address indexed user, address indexed token, uint256 indexed amount, uint256 votingPower); /// @notice An event that's emitted when an account's vote balance changes event VotingPowerChanged(address indexed voter, uint256 indexed previousBalance, uint256 indexed newBalance); /** * @notice Initialize VotingPower contract * @dev Should be called via VotingPowerPrism before calling anything else * @param _archToken address of ARCH token * @param _vestingContract address of Vesting contract */ function initialize( address _archToken, address _vestingContract ) public initializer { __ReentrancyGuard_init_unchained(); AppStorage storage app = VotingPowerStorage.appStorage(); app.archToken = IArchToken(_archToken); app.vesting = IVesting(_vestingContract); } /** * @notice Address of ARCH token * @return Address of ARCH token */ function archToken() public view returns (address) { AppStorage storage app = VotingPowerStorage.appStorage(); return address(app.archToken); } /** * @notice Address of vesting contract * @return Address of vesting contract */ function vestingContract() public view returns (address) { AppStorage storage app = VotingPowerStorage.appStorage(); return address(app.vesting); } /** * @notice Stake ARCH tokens using offchain approvals to unlock voting power * @param amount The amount to stake * @param deadline The time at which to expire the signature * @param v The recovery byte of the signature * @param r Half of the ECDSA signature pair * @param s Half of the ECDSA signature pair */ function stakeWithPermit(uint256 amount, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonReentrant { require(amount > 0, "VP::stakeWithPermit: cannot stake 0"); AppStorage storage app = VotingPowerStorage.appStorage(); require(app.archToken.balanceOf(msg.sender) >= amount, "VP::stakeWithPermit: not enough tokens"); app.archToken.permit(msg.sender, address(this), amount, deadline, v, r, s); _stake(msg.sender, address(app.archToken), amount, amount); } /** * @notice Stake ARCH tokens to unlock voting power for `msg.sender` * @param amount The amount to stake */ function stake(uint256 amount) external nonReentrant { AppStorage storage app = VotingPowerStorage.appStorage(); require(amount > 0, "VP::stake: cannot stake 0"); require(app.archToken.balanceOf(msg.sender) >= amount, "VP::stake: not enough tokens"); require(app.archToken.allowance(msg.sender, address(this)) >= amount, "VP::stake: must approve tokens before staking"); _stake(msg.sender, address(app.archToken), amount, amount); } /** * @notice Count vesting ARCH tokens toward voting power for `account` * @param account The recipient of voting power * @param amount The amount of voting power to add */ function addVotingPowerForVestingTokens(address account, uint256 amount) external nonReentrant { AppStorage storage app = VotingPowerStorage.appStorage(); require(amount > 0, "VP::addVPforVT: cannot add 0 voting power"); require(msg.sender == address(app.vesting), "VP::addVPforVT: only vesting contract"); _increaseVotingPower(account, amount); } /** * @notice Remove claimed vesting ARCH tokens from voting power for `account` * @param account The account with voting power * @param amount The amount of voting power to remove */ function removeVotingPowerForClaimedTokens(address account, uint256 amount) external nonReentrant { AppStorage storage app = VotingPowerStorage.appStorage(); require(amount > 0, "VP::removeVPforVT: cannot remove 0 voting power"); require(msg.sender == address(app.vesting), "VP::removeVPforVT: only vesting contract"); _decreaseVotingPower(account, amount); } /** * @notice Withdraw staked ARCH tokens, removing voting power for `msg.sender` * @param amount The amount to withdraw */ function withdraw(uint256 amount) external nonReentrant { require(amount > 0, "VP::withdraw: cannot withdraw 0"); AppStorage storage app = VotingPowerStorage.appStorage(); _withdraw(msg.sender, address(app.archToken), amount, amount); } /** * @notice Get total amount of ARCH tokens staked in contract by `staker` * @param staker The user with staked ARCH * @return total ARCH amount staked */ function getARCHAmountStaked(address staker) public view returns (uint256) { return getARCHStake(staker).amount; } /** * @notice Get total amount of tokens staked in contract by `staker` * @param staker The user with staked tokens * @param stakedToken The staked token * @return total amount staked */ function getAmountStaked(address staker, address stakedToken) public view returns (uint256) { return getStake(staker, stakedToken).amount; } /** * @notice Get staked amount and voting power from ARCH tokens staked in contract by `staker` * @param staker The user with staked ARCH * @return total ARCH staked */ function getARCHStake(address staker) public view returns (Stake memory) { AppStorage storage app = VotingPowerStorage.appStorage(); return getStake(staker, address(app.archToken)); } /** * @notice Get total staked amount and voting power from `stakedToken` staked in contract by `staker` * @param staker The user with staked tokens * @param stakedToken The staked token * @return total staked */ function getStake(address staker, address stakedToken) public view returns (Stake memory) { StakeStorage storage ss = VotingPowerStorage.stakeStorage(); return ss.stakes[staker][stakedToken]; } /** * @notice Gets the current votes balance for `account` * @param account The address to get votes balance * @return The number of current votes for `account` */ function balanceOf(address account) public view returns (uint256) { CheckpointStorage storage cs = VotingPowerStorage.checkpointStorage(); uint32 nCheckpoints = cs.numCheckpoints[account]; return nCheckpoints > 0 ? cs.checkpoints[account][nCheckpoints - 1].votes : 0; } /** * @notice Determine the prior number of votes for an account as of a block number * @dev Block number must be a finalized block or else this function will revert to prevent misinformation. * @param account The address of the account to check * @param blockNumber The block number to get the vote balance at * @return The number of votes the account had as of the given block */ function balanceOfAt(address account, uint256 blockNumber) public view returns (uint256) { require(blockNumber < block.number, "VP::balanceOfAt: not yet determined"); CheckpointStorage storage cs = VotingPowerStorage.checkpointStorage(); uint32 nCheckpoints = cs.numCheckpoints[account]; if (nCheckpoints == 0) { return 0; } // First check most recent balance if (cs.checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) { return cs.checkpoints[account][nCheckpoints - 1].votes; } // Next check implicit zero balance if (cs.checkpoints[account][0].fromBlock > blockNumber) { return 0; } uint32 lower = 0; uint32 upper = nCheckpoints - 1; while (upper > lower) { uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow Checkpoint memory cp = cs.checkpoints[account][center]; if (cp.fromBlock == blockNumber) { return cp.votes; } else if (cp.fromBlock < blockNumber) { lower = center; } else { upper = center - 1; } } return cs.checkpoints[account][lower].votes; } /** * @notice Internal implementation of stake * @param voter The user that is staking tokens * @param token The token to stake * @param tokenAmount The amount of token to stake * @param votingPower The amount of voting power stake translates into */ function _stake(address voter, address token, uint256 tokenAmount, uint256 votingPower) internal { IERC20(token).safeTransferFrom(voter, address(this), tokenAmount); StakeStorage storage ss = VotingPowerStorage.stakeStorage(); ss.stakes[voter][token].amount = ss.stakes[voter][token].amount.add(tokenAmount); ss.stakes[voter][token].votingPower = ss.stakes[voter][token].votingPower.add(votingPower); emit Staked(voter, token, tokenAmount, votingPower); _increaseVotingPower(voter, votingPower); } /** * @notice Internal implementation of withdraw * @param voter The user with tokens staked * @param token The token that is staked * @param tokenAmount The amount of token to withdraw * @param votingPower The amount of voting power stake translates into */ function _withdraw(address voter, address token, uint256 tokenAmount, uint256 votingPower) internal { StakeStorage storage ss = VotingPowerStorage.stakeStorage(); require(ss.stakes[voter][token].amount >= tokenAmount, "VP::_withdraw: not enough tokens staked"); require(ss.stakes[voter][token].votingPower >= votingPower, "VP::_withdraw: not enough voting power"); ss.stakes[voter][token].amount = ss.stakes[voter][token].amount.sub(tokenAmount); ss.stakes[voter][token].votingPower = ss.stakes[voter][token].votingPower.sub(votingPower); IERC20(token).safeTransfer(voter, tokenAmount); emit Withdrawn(voter, token, tokenAmount, votingPower); _decreaseVotingPower(voter, votingPower); } /** * @notice Increase voting power of voter * @param voter The voter whose voting power is increasing * @param amount The amount of voting power to increase by */ function _increaseVotingPower(address voter, uint256 amount) internal { CheckpointStorage storage cs = VotingPowerStorage.checkpointStorage(); uint32 checkpointNum = cs.numCheckpoints[voter]; uint256 votingPowerOld = checkpointNum > 0 ? cs.checkpoints[voter][checkpointNum - 1].votes : 0; uint256 votingPowerNew = votingPowerOld.add(amount); _writeCheckpoint(voter, checkpointNum, votingPowerOld, votingPowerNew); } /** * @notice Decrease voting power of voter * @param voter The voter whose voting power is decreasing * @param amount The amount of voting power to decrease by */ function _decreaseVotingPower(address voter, uint256 amount) internal { CheckpointStorage storage cs = VotingPowerStorage.checkpointStorage(); uint32 checkpointNum = cs.numCheckpoints[voter]; uint256 votingPowerOld = checkpointNum > 0 ? cs.checkpoints[voter][checkpointNum - 1].votes : 0; uint256 votingPowerNew = votingPowerOld.sub(amount); _writeCheckpoint(voter, checkpointNum, votingPowerOld, votingPowerNew); } /** * @notice Create checkpoint of voting power for voter at current block number * @param voter The voter whose voting power is changing * @param nCheckpoints The current checkpoint number for voter * @param oldVotes The previous voting power of this voter * @param newVotes The new voting power of this voter */ function _writeCheckpoint(address voter, uint32 nCheckpoints, uint256 oldVotes, uint256 newVotes) internal { uint32 blockNumber = _safe32(block.number, "VP::_writeCheckpoint: block number exceeds 32 bits"); CheckpointStorage storage cs = VotingPowerStorage.checkpointStorage(); if (nCheckpoints > 0 && cs.checkpoints[voter][nCheckpoints - 1].fromBlock == blockNumber) { cs.checkpoints[voter][nCheckpoints - 1].votes = newVotes; } else { cs.checkpoints[voter][nCheckpoints] = Checkpoint(blockNumber, newVotes); cs.numCheckpoints[voter] = nCheckpoints + 1; } emit VotingPowerChanged(voter, oldVotes, newVotes); } /** * @notice Converts uint256 to uint32 safely * @param n Number * @param errorMessage Error message to use if number cannot be converted * @return uint32 number */ function _safe32(uint256 n, string memory errorMessage) internal pure returns (uint32) { require(n < 2**32, errorMessage); return uint32(n); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; interface IArchToken { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external; function mint(address dst, uint256 amount) external returns (bool); function burn(address src, uint256 amount) external returns (bool); function updateTokenMetadata(string memory tokenName, string memory tokenSymbol) external returns (bool); function supplyManager() external view returns (address); function metadataManager() external view returns (address); function supplyChangeAllowedAfter() external view returns (uint256); function supplyChangeWaitingPeriod() external view returns (uint32); function supplyChangeWaitingPeriodMinimum() external view returns (uint32); function mintCap() external view returns (uint16); function setSupplyManager(address newSupplyManager) external returns (bool); function setMetadataManager(address newMetadataManager) external returns (bool); function setSupplyChangeWaitingPeriod(uint32 period) external returns (bool); function setMintCap(uint16 newCap) external returns (bool); event MintCapChanged(uint16 indexed oldMintCap, uint16 indexed newMintCap); event SupplyManagerChanged(address indexed oldManager, address indexed newManager); event SupplyChangeWaitingPeriodChanged(uint32 indexed oldWaitingPeriod, uint32 indexed newWaitingPeriod); event MetadataManagerChanged(address indexed oldManager, address indexed newManager); event TokenMetaUpdated(string indexed name, string indexed symbol); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); event AuthorizationUsed(address indexed authorizer, bytes32 indexed nonce); }
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; interface IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; import "./IArchToken.sol"; import "./IVotingPower.sol"; interface IVesting { struct Grant { uint256 startTime; uint256 amount; uint16 vestingDuration; uint16 vestingCliff; uint256 totalClaimed; } function owner() external view returns (address); function token() external view returns (IArchToken); function votingPower() external view returns (IVotingPower); function addTokenGrant(address recipient, uint256 startTime, uint256 amount, uint16 vestingDurationInDays, uint16 vestingCliffInDays) external; function getTokenGrant(address recipient) external view returns(Grant memory); function calculateGrantClaim(address recipient) external view returns (uint256); function vestedBalance(address account) external view returns (uint256); function claimedBalance(address recipient) external view returns (uint256); function claimVestedTokens(address recipient) external; function tokensVestedPerDay(address recipient) external view returns(uint256); function setVotingPowerContract(address newContract) external; function changeOwner(address newOwner) external; event GrantAdded(address indexed recipient, uint256 indexed amount, uint256 startTime, uint16 vestingDurationInDays, uint16 vestingCliffInDays); event GrantTokensClaimed(address indexed recipient, uint256 indexed amountClaimed); event ChangedOwner(address indexed oldOwner, address indexed newOwner); event ChangedVotingPower(address indexed oldContract, address indexed newContract); }
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; import "../lib/PrismProxy.sol"; interface IVotingPower { struct Stake { uint256 amount; uint256 votingPower; } function setPendingProxyImplementation(address newPendingImplementation) external returns (bool); function acceptProxyImplementation() external returns (bool); function setPendingProxyAdmin(address newPendingAdmin) external returns (bool); function acceptProxyAdmin() external returns (bool); function proxyAdmin() external view returns (address); function pendingProxyAdmin() external view returns (address); function proxyImplementation() external view returns (address); function pendingProxyImplementation() external view returns (address); function proxyImplementationVersion() external view returns (uint8); function become(PrismProxy prism) external; function initialize(address _archToken, address _vestingContract) external; function archToken() external view returns (address); function vestingContract() external view returns (address); function stake(uint256 amount) external; function stakeWithPermit(uint256 amount, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external; function withdraw(uint256 amount) external; function addVotingPowerForVestingTokens(address account, uint256 amount) external; function removeVotingPowerForClaimedTokens(address account, uint256 amount) external; function getARCHAmountStaked(address staker) external view returns (uint256); function getAmountStaked(address staker, address stakedToken) external view returns (uint256); function getARCHStake(address staker) external view returns (Stake memory); function getStake(address staker, address stakedToken) external view returns (Stake memory); function balanceOf(address account) external view returns (uint256); function balanceOfAt(address account, uint256 blockNumber) external view returns (uint256); event NewPendingImplementation(address indexed oldPendingImplementation, address indexed newPendingImplementation); event NewImplementation(address indexed oldImplementation, address indexed newImplementation); event NewPendingAdmin(address indexed oldPendingAdmin, address indexed newPendingAdmin); event NewAdmin(address indexed oldAdmin, address indexed newAdmin); event Staked(address indexed user, address indexed token, uint256 indexed amount, uint256 votingPower); event Withdrawn(address indexed user, address indexed token, uint256 indexed amount, uint256 votingPower); event VotingPowerChanged(address indexed voter, uint256 indexed previousBalance, uint256 indexed newBalance); }
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.3._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.3._ */ function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; /** * @title Initializable * * @dev Helper contract to support initializer functions. To use it, replace * the constructor with a function that has the `initializer` modifier. * WARNING: Unlike constructors, initializer functions must be manually * invoked. This applies both to deploying an Initializable contract, as well * as extending an Initializable contract via inheritance. * WARNING: When used with inheritance, manual care must be taken to not invoke * a parent initializer twice, or ensure that all initializers are idempotent, * because this is not dealt with automatically as with constructors. */ 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 use in the initializer function of a contract. */ modifier initializer() { require(initializing || isConstructor() || !initialized, "Contract instance has already been initialized"); bool isTopLevelCall = !initializing; if (isTopLevelCall) { initializing = true; initialized = true; } _; if (isTopLevelCall) { initializing = false; } } /// @dev Returns true if and only if the function is running in the constructor function isConstructor() private view returns (bool) { // extcodesize checks the size of the code stored in an address, and // address returns the current address. Since the code is still not // deployed when running a constructor, any checks on its code size will // yield zero, making it an effective way to detect if a contract is // under construction or not. address self = address(this); uint256 cs; assembly { cs := extcodesize(self) } return cs == 0; } // Reserved storage space to allow for layout changes in the future. uint256[50] private ______gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; contract PrismProxy { /// @notice Proxy admin and implementation storage variables struct ProxyStorage { // Administrator for this contract address admin; // Pending administrator for this contract address pendingAdmin; // Active implementation of this contract address implementation; // Pending implementation of this contract address pendingImplementation; // Implementation version of this contract uint8 version; } /// @dev Position in contract storage where prism ProxyStorage struct will be stored bytes32 constant PRISM_PROXY_STORAGE_POSITION = keccak256("prism.proxy.storage"); /// @notice Emitted when pendingImplementation is changed event NewPendingImplementation(address indexed oldPendingImplementation, address indexed newPendingImplementation); /// @notice Emitted when pendingImplementation is accepted, which means implementation is updated event NewImplementation(address indexed oldImplementation, address indexed newImplementation); /// @notice Emitted when pendingAdmin is changed event NewPendingAdmin(address indexed oldPendingAdmin, address indexed newPendingAdmin); /// @notice Emitted when pendingAdmin is accepted, which means admin is updated event NewAdmin(address indexed oldAdmin, address indexed newAdmin); /** * @notice Load proxy storage struct from specified PRISM_PROXY_STORAGE_POSITION * @return ps ProxyStorage struct */ function proxyStorage() internal pure returns (ProxyStorage storage ps) { bytes32 position = PRISM_PROXY_STORAGE_POSITION; assembly { ps.slot := position } } /*** Admin Functions ***/ /** * @notice Create new pending implementation for prism. msg.sender must be admin * @dev Admin function for proposing new implementation contract * @return boolean indicating success of operation */ function setPendingProxyImplementation(address newPendingImplementation) public returns (bool) { ProxyStorage storage s = proxyStorage(); require(msg.sender == s.admin, "Prism::setPendingProxyImp: caller must be admin"); address oldPendingImplementation = s.pendingImplementation; s.pendingImplementation = newPendingImplementation; emit NewPendingImplementation(oldPendingImplementation, s.pendingImplementation); return true; } /** * @notice Accepts new implementation for prism. msg.sender must be pendingImplementation * @dev Admin function for new implementation to accept it's role as implementation * @return boolean indicating success of operation */ function acceptProxyImplementation() public returns (bool) { ProxyStorage storage s = proxyStorage(); // Check caller is pendingImplementation and pendingImplementation ≠ address(0) require(msg.sender == s.pendingImplementation && s.pendingImplementation != address(0), "Prism::acceptProxyImp: caller must be pending implementation"); // Save current values for inclusion in log address oldImplementation = s.implementation; address oldPendingImplementation = s.pendingImplementation; s.implementation = s.pendingImplementation; s.pendingImplementation = address(0); s.version++; emit NewImplementation(oldImplementation, s.implementation); emit NewPendingImplementation(oldPendingImplementation, s.pendingImplementation); return true; } /** * @notice Begins transfer of admin rights. The newPendingAdmin must call `acceptAdmin` to finalize the transfer. * @dev Admin function to begin change of admin. The newPendingAdmin must call `acceptAdmin` to finalize the transfer. * @param newPendingAdmin New pending admin. * @return boolean indicating success of operation */ function setPendingProxyAdmin(address newPendingAdmin) public returns (bool) { ProxyStorage storage s = proxyStorage(); // Check caller = admin require(msg.sender == s.admin, "Prism::setPendingProxyAdmin: caller must be admin"); // Save current value, if any, for inclusion in log address oldPendingAdmin = s.pendingAdmin; // Store pendingAdmin with value newPendingAdmin s.pendingAdmin = newPendingAdmin; // Emit NewPendingAdmin(oldPendingAdmin, newPendingAdmin) emit NewPendingAdmin(oldPendingAdmin, newPendingAdmin); return true; } /** * @notice Accepts transfer of admin rights. msg.sender must be pendingAdmin * @dev Admin function for pending admin to accept role and update admin * @return boolean indicating success of operation */ function acceptProxyAdmin() public returns (bool) { ProxyStorage storage s = proxyStorage(); // Check caller is pendingAdmin and pendingAdmin ≠ address(0) require(msg.sender == s.pendingAdmin && msg.sender != address(0), "Prism::acceptProxyAdmin: caller must be pending admin"); // Save current values for inclusion in log address oldAdmin = s.admin; address oldPendingAdmin = s.pendingAdmin; // Store admin with value pendingAdmin s.admin = s.pendingAdmin; // Clear the pending value s.pendingAdmin = address(0); emit NewAdmin(oldAdmin, s.admin); emit NewPendingAdmin(oldPendingAdmin, s.pendingAdmin); return true; } /** * @notice Get current admin for prism proxy * @return admin address */ function proxyAdmin() public view returns (address) { ProxyStorage storage s = proxyStorage(); return s.admin; } /** * @notice Get pending admin for prism proxy * @return admin address */ function pendingProxyAdmin() public view returns (address) { ProxyStorage storage s = proxyStorage(); return s.pendingAdmin; } /** * @notice Address of implementation contract * @return implementation address */ function proxyImplementation() public view returns (address) { ProxyStorage storage s = proxyStorage(); return s.implementation; } /** * @notice Address of pending implementation contract * @return pending implementation address */ function pendingProxyImplementation() public view returns (address) { ProxyStorage storage s = proxyStorage(); return s.pendingImplementation; } /** * @notice Current implementation version for proxy * @return version number */ function proxyImplementationVersion() public view returns (uint8) { ProxyStorage storage s = proxyStorage(); return s.version; } /** * @notice Delegates execution to an implementation contract. * @dev Returns to the external caller whatever the implementation returns or forwards reverts */ function _forwardToImplementation() internal { ProxyStorage storage s = proxyStorage(); // delegate all other functions to current implementation (bool success, ) = s.implementation.delegatecall(msg.data); assembly { let free_mem_ptr := mload(0x40) returndatacopy(free_mem_ptr, 0, returndatasize()) switch success case 0 { revert(free_mem_ptr, returndatasize()) } default { return(free_mem_ptr, returndatasize()) } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; import "./Initializable.sol"; import "./PrismProxy.sol"; contract PrismProxyImplementation is Initializable { /** * @notice Accept invitation to be implementation contract for proxy * @param prism Prism Proxy contract */ function become(PrismProxy prism) public { require(msg.sender == prism.proxyAdmin(), "Prism::become: only proxy admin can change implementation"); require(prism.acceptProxyImplementation() == true, "Prism::become: change not authorized"); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; import "./Initializable.sol"; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ contract ReentrancyGuardUpgradeSafe is Initializable { bool private _notEntered; function __ReentrancyGuard_init() internal initializer { __ReentrancyGuard_init_unchained(); } function __ReentrancyGuard_init_unchained() internal initializer { // Storing an initial non-zero value makes deployment a bit more // expensive, but in exchange the refund on every call to nonReentrant // will be lower in amount. Since refunds are capped to a percetange of // the total transaction's gas, it is best to keep them low in cases // like this one, to increase the likelihood of the full refund coming // into effect. _notEntered = true; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and make it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_notEntered, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _notEntered = false; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _notEntered = true; } uint256[49] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; import "../interfaces/IERC20.sol"; import "./SafeMath.sol"; import "./Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; // From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol // Subject to the MIT license. /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the addition of two unsigned integers, reverting with custom message on overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, errorMessage); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot underflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction underflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot underflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, errorMessage); return c; } /** * @dev Returns the integer division of two unsigned integers. * Reverts on division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. * Reverts with custom message on division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; import "../interfaces/IArchToken.sol"; import "../interfaces/IVesting.sol"; /// @notice App metadata storage struct AppStorage { // A record of states for signing / validating signatures mapping (address => uint) nonces; // ARCH token IArchToken archToken; // Vesting contract IVesting vesting; } /// @notice A checkpoint for marking number of votes from a given block struct Checkpoint { uint32 fromBlock; uint256 votes; } /// @notice All storage variables related to checkpoints struct CheckpointStorage { // A record of vote checkpoints for each account, by index mapping (address => mapping (uint32 => Checkpoint)) checkpoints; // The number of checkpoints for each account mapping (address => uint32) numCheckpoints; } /// @notice The amount of a given token that has been staked, and the resulting voting power struct Stake { uint256 amount; uint256 votingPower; } /// @notice All storage variables related to staking struct StakeStorage { // Official record of staked balances for each account > token > stake mapping (address => mapping (address => Stake)) stakes; } library VotingPowerStorage { bytes32 constant VOTING_POWER_APP_STORAGE_POSITION = keccak256("voting.power.app.storage"); bytes32 constant VOTING_POWER_CHECKPOINT_STORAGE_POSITION = keccak256("voting.power.checkpoint.storage"); bytes32 constant VOTING_POWER_STAKE_STORAGE_POSITION = keccak256("voting.power.stake.storage"); /** * @notice Load app storage struct from specified VOTING_POWER_APP_STORAGE_POSITION * @return app AppStorage struct */ function appStorage() internal pure returns (AppStorage storage app) { bytes32 position = VOTING_POWER_APP_STORAGE_POSITION; assembly { app.slot := position } } /** * @notice Load checkpoint storage struct from specified VOTING_POWER_CHECKPOINT_STORAGE_POSITION * @return cs CheckpointStorage struct */ function checkpointStorage() internal pure returns (CheckpointStorage storage cs) { bytes32 position = VOTING_POWER_CHECKPOINT_STORAGE_POSITION; assembly { cs.slot := position } } /** * @notice Load stake storage struct from specified VOTING_POWER_STAKE_STORAGE_POSITION * @return ss StakeStorage struct */ function stakeStorage() internal pure returns (StakeStorage storage ss) { bytes32 position = VOTING_POWER_STAKE_STORAGE_POSITION; assembly { ss.slot := position } } }
{ "evmVersion": "istanbul", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 999999 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"votingPower","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"voter","type":"address"},{"indexed":true,"internalType":"uint256","name":"previousBalance","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"newBalance","type":"uint256"}],"name":"VotingPowerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"votingPower","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"addVotingPowerForVestingTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"archToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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":"account","type":"address"},{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"balanceOfAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract PrismProxy","name":"prism","type":"address"}],"name":"become","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"staker","type":"address"}],"name":"getARCHAmountStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"staker","type":"address"}],"name":"getARCHStake","outputs":[{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"votingPower","type":"uint256"}],"internalType":"struct Stake","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"staker","type":"address"},{"internalType":"address","name":"stakedToken","type":"address"}],"name":"getAmountStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"staker","type":"address"},{"internalType":"address","name":"stakedToken","type":"address"}],"name":"getStake","outputs":[{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"votingPower","type":"uint256"}],"internalType":"struct Stake","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_archToken","type":"address"},{"internalType":"address","name":"_vestingContract","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"removeVotingPowerForClaimedTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"stakeWithPermit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vestingContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b506129ad806100206000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806375a70bb611610097578063a1194c8e11610066578063a1194c8e146101e7578063a694fc3a146101fa578063a7dec8491461020d578063ecd9ba8214610220576100f5565b806375a70bb61461018e5780637741459e146101ae57806382dda22d146101c15780639b92ac4a146101d4576100f5565b80634ee2cd7e116100d35780634ee2cd7e146101355780635e6f60451461015e57806361500aa61461017357806370a082311461017b576100f5565b80631efaa442146100fa5780632e1a7d4d1461010f578063485cc95514610122575b600080fd5b61010d6101083660046121db565b610233565b005b61010d61011d366004612226565b6103a8565b61010d6101303660046121a3565b6104dc565b6101486101433660046121db565b61065c565b60405161015591906128c2565b60405180910390f35b610166610915565b60405161015591906122a3565b610166610940565b61014861018936600461216b565b61096b565b6101a161019c36600461216b565b610a16565b60405161015591906128ab565b6101486101bc3660046121a3565b610a58565b6101a16101cf3660046121a3565b610a6c565b61010d6101e23660046121db565b610ad0565b61010d6101f536600461216b565b610c0c565b61010d610208366004612226565b610dac565b61014861021b36600461216b565b611075565b61010d61022e366004612256565b611087565b60335460ff166102a457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905560006102d6611337565b90506000821161031b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610312906123e1565b60405180910390fd5b600281015473ffffffffffffffffffffffffffffffffffffffff16331461036e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161031290612794565b610378838361135b565b5050603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905550565b60335460ff1661041957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905580610478576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103129061258c565b6000610482611337565b60018101549091506104ad90339073ffffffffffffffffffffffffffffffffffffffff168480611424565b5050603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b600054610100900460ff16806104f557506104f5611640565b80610503575060005460ff16155b610558576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001806128ee602e913960400191505060405180910390fd5b600054610100900460ff161580156105be57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff909116610100171660011790555b6105c6611646565b60006105d0611337565b60018101805473ffffffffffffffffffffffffffffffffffffffff8088167fffffffffffffffffffffffff000000000000000000000000000000000000000092831617909255600290920180549186169190921617905550801561065757600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690555b505050565b6000438210610697576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610312906124f8565b60006106a1611784565b73ffffffffffffffffffffffffffffffffffffffff8516600090815260018201602052604090205490915063ffffffff16806106e25760009250505061090f565b73ffffffffffffffffffffffffffffffffffffffff851660009081526020838152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8601811685529252909120541684106107a55773ffffffffffffffffffffffffffffffffffffffff85166000908152602092835260408082207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9390930163ffffffff16825291909252902060010154905061090f565b73ffffffffffffffffffffffffffffffffffffffff851660009081526020838152604080832083805290915290205463ffffffff168410156107ec5760009250505061090f565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82015b8163ffffffff168163ffffffff1611156108cf57600282820363ffffffff1604810361083c61213a565b5073ffffffffffffffffffffffffffffffffffffffff881660009081526020868152604080832063ffffffff8086168552908352928190208151808301909252805490931680825260019093015491810191909152908814156108aa5760200151955061090f945050505050565b805163ffffffff168811156108c1578193506108c8565b6001820392505b5050610812565b5073ffffffffffffffffffffffffffffffffffffffff861660009081526020938452604080822063ffffffff909316825291909352909120600101549150505b92915050565b600080610920611337565b6002015473ffffffffffffffffffffffffffffffffffffffff1691505090565b60008061094b611337565b6001015473ffffffffffffffffffffffffffffffffffffffff1691505090565b600080610976611784565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260018201602052604090205490915063ffffffff16806109b3576000610a0e565b73ffffffffffffffffffffffffffffffffffffffff841660009081526020838152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff86011684529091529020600101545b949350505050565b610a1e612151565b6000610a28611337565b6001810154909150610a5190849073ffffffffffffffffffffffffffffffffffffffff16610a6c565b9392505050565b6000610a648383610a6c565b519392505050565b610a74612151565b6000610a7e6117a8565b73ffffffffffffffffffffffffffffffffffffffff8086166000908152602092835260408082209287168252918352819020815180830190925280548252600101549181019190915291505092915050565b60335460ff16610b4157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690556000610b73611337565b905060008211610baf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610312906125c3565b600281015473ffffffffffffffffffffffffffffffffffffffff163314610c02576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103129061267d565b61037883836117cc565b8073ffffffffffffffffffffffffffffffffffffffff16633e47158c6040518163ffffffff1660e01b815260040160206040518083038186803b158015610c5257600080fd5b505afa158015610c66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8a9190612187565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610cee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103129061243e565b8073ffffffffffffffffffffffffffffffffffffffff166394d8fbd06040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610d3657600080fd5b505af1158015610d4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6e9190612206565b1515600114610da9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610312906126da565b50565b60335460ff16610e1d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690556000610e4f611337565b905060008211610e8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610312906123aa565b60018101546040517f70a08231000000000000000000000000000000000000000000000000000000008152839173ffffffffffffffffffffffffffffffffffffffff16906370a0823190610ee39033906004016122a3565b60206040518083038186803b158015610efb57600080fd5b505afa158015610f0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f33919061223e565b1015610f6b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161031290612555565b60018101546040517fdd62ed3e000000000000000000000000000000000000000000000000000000008152839173ffffffffffffffffffffffffffffffffffffffff169063dd62ed3e90610fc590339030906004016122c4565b60206040518083038186803b158015610fdd57600080fd5b505afa158015610ff1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611015919061223e565b101561104d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610312906127f1565b60018101546104ad90339073ffffffffffffffffffffffffffffffffffffffff16848061187f565b600061108082610a16565b5192915050565b60335460ff166110f857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905584611157576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161031290612620565b6000611161611337565b60018101546040517f70a08231000000000000000000000000000000000000000000000000000000008152919250879173ffffffffffffffffffffffffffffffffffffffff909116906370a08231906111be9033906004016122a3565b60206040518083038186803b1580156111d657600080fd5b505afa1580156111ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120e919061223e565b1015611246576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103129061249b565b60018101546040517fd505accf00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063d505accf906112aa90339030908b908b908b908b908b906004016122eb565b600060405180830381600087803b1580156112c457600080fd5b505af11580156112d8573d6000803e3d6000fd5b50505060018201546113049150339073ffffffffffffffffffffffffffffffffffffffff16888061187f565b5050603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905550505050565b7f6d6a6fc321e0562f469846e9b1d74d90faeed9d71336854ad7fe2be150ff9f2090565b6000611365611784565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260018201602052604081205491925063ffffffff90911690816113a5576000611400565b73ffffffffffffffffffffffffffffffffffffffff851660009081526020848152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff87011684529091529020600101545b9050600061140e82866119aa565b905061141c868484846119ec565b505050505050565b600061142e6117a8565b73ffffffffffffffffffffffffffffffffffffffff8087166000908152602083815260408083209389168352929052205490915083111561149b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161031290612737565b73ffffffffffffffffffffffffffffffffffffffff80861660009081526020838152604080832093881683529290522060010154821115611508576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103129061284e565b73ffffffffffffffffffffffffffffffffffffffff8086166000908152602083815260408083209388168352929052205461154390846119aa565b73ffffffffffffffffffffffffffffffffffffffff8681166000908152602084815260408083209389168352929052209081556001015461158490836119aa565b73ffffffffffffffffffffffffffffffffffffffff808716600090815260208481526040808320938916808452939091529020600101919091556115c9908685611bda565b828473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167f91fb9d98b786c57d74c099ccd2beca1739e9f6a81fb49001ca465c4b7591bbe28560405161162791906128c2565b60405180910390a4611639858361135b565b5050505050565b303b1590565b600054610100900460ff168061165f575061165f611640565b8061166d575060005460ff16155b6116c2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001806128ee602e913960400191505060405180910390fd5b600054610100900460ff1615801561172857600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff909116610100171660011790555b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610da957600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16905550565b7f97ada73c2617b57999fe0c39e0cd251038e142d18fa592f9135b3c4884c92cf190565b7fb436861a9ea50c2256cd6ef2eb5e3092874d3eddb554844f2d197b6df51da09890565b60006117d6611784565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260018201602052604081205491925063ffffffff9091169081611816576000611871565b73ffffffffffffffffffffffffffffffffffffffff851660009081526020848152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff87011684529091529020600101545b9050600061140e8286611c67565b6118a173ffffffffffffffffffffffffffffffffffffffff8416853085611cdb565b60006118ab6117a8565b73ffffffffffffffffffffffffffffffffffffffff808716600090815260208381526040808320938916835292905220549091506118e99084611c67565b73ffffffffffffffffffffffffffffffffffffffff8681166000908152602084815260408083209389168352929052209081556001015461192a9083611c67565b73ffffffffffffffffffffffffffffffffffffffff808716600081815260208581526040808320948a1680845294909152908190206001019390935591518592907f6c86f3fd5118b3aa8bb4f389a617046de0a3d3d477de1a1673d227f802f616dc906119989087906128c2565b60405180910390a461163985836117cc565b6000610a5183836040518060400160405280601f81526020017f536166654d6174683a207375627472616374696f6e20756e646572666c6f7700815250611d76565b6000611a104360405180606001604052806032815260200161294660329139611e27565b90506000611a1c611784565b905060008563ffffffff16118015611a8e575073ffffffffffffffffffffffffffffffffffffffff861660009081526020828152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8a01811685529252909120548382169116145b15611af45773ffffffffffffffffffffffffffffffffffffffff861660009081526020828152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8a011684529091529020600101839055611b8d565b60408051808201825263ffffffff8085168252602080830187815273ffffffffffffffffffffffffffffffffffffffff8b1660008181528784528681208c861682528452868120955186549086167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000091821617875592516001968701559081528487019092529390208054928901909116919092161790555b82848773ffffffffffffffffffffffffffffffffffffffff167f53ed7954de66613e30dd29b46ab783aa594e6309d021d8854c76bb3325d03aa360405160405180910390a4505050505050565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610657908490611e71565b600082820183811015610a5157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6040805173ffffffffffffffffffffffffffffffffffffffff80861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052611d70908590611e71565b50505050565b60008184841115611e1f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611de4578181015183820152602001611dcc565b50505050905090810190601f168015611e115780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6000816401000000008410611e69576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103129190612339565b509192915050565b6060611ed3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16611f499092919063ffffffff16565b80519091501561065757808060200190516020811015611ef257600080fd5b5051610657576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a81526020018061291c602a913960400191505060405180910390fd5b6060610a0e848460008585611f5d856120b4565b611fc857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b6020831061203257805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101611ff5565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114612094576040519150601f19603f3d011682016040523d82523d6000602084013e612099565b606091505b50915091506120a98282866120ba565b979650505050505050565b3b151590565b606083156120c9575081610a51565b8251156120d95782518084602001fd5b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201818152845160248401528451859391928392604401919085019080838360008315611de4578181015183820152602001611dcc565b604080518082019091526000808252602082015290565b604051806040016040528060008152602001600081525090565b60006020828403121561217c578081fd5b8135610a51816128cb565b600060208284031215612198578081fd5b8151610a51816128cb565b600080604083850312156121b5578081fd5b82356121c0816128cb565b915060208301356121d0816128cb565b809150509250929050565b600080604083850312156121ed578182fd5b82356121f8816128cb565b946020939093013593505050565b600060208284031215612217578081fd5b81518015158114610a51578182fd5b600060208284031215612237578081fd5b5035919050565b60006020828403121561224f578081fd5b5051919050565b600080600080600060a0868803121561226d578081fd5b8535945060208601359350604086013560ff8116811461228b578182fd5b94979396509394606081013594506080013592915050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff92831681529116602082015260400190565b73ffffffffffffffffffffffffffffffffffffffff97881681529590961660208601526040850193909352606084019190915260ff16608083015260a082015260c081019190915260e00190565b6000602080835283518082850152825b8181101561236557858101830151858201604001528201612349565b818111156123765783604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b60208082526019908201527f56503a3a7374616b653a2063616e6e6f74207374616b65203000000000000000604082015260600190565b6020808252602f908201527f56503a3a72656d6f76655650666f7256543a2063616e6e6f742072656d6f766560408201527f203020766f74696e6720706f7765720000000000000000000000000000000000606082015260800190565b60208082526039908201527f507269736d3a3a6265636f6d653a206f6e6c792070726f78792061646d696e2060408201527f63616e206368616e676520696d706c656d656e746174696f6e00000000000000606082015260800190565b60208082526026908201527f56503a3a7374616b65576974685065726d69743a206e6f7420656e6f7567682060408201527f746f6b656e730000000000000000000000000000000000000000000000000000606082015260800190565b60208082526023908201527f56503a3a62616c616e63654f6641743a206e6f74207965742064657465726d6960408201527f6e65640000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601c908201527f56503a3a7374616b653a206e6f7420656e6f75676820746f6b656e7300000000604082015260600190565b6020808252601f908201527f56503a3a77697468647261773a2063616e6e6f74207769746864726177203000604082015260600190565b60208082526029908201527f56503a3a6164645650666f7256543a2063616e6e6f7420616464203020766f7460408201527f696e6720706f7765720000000000000000000000000000000000000000000000606082015260800190565b60208082526023908201527f56503a3a7374616b65576974685065726d69743a2063616e6e6f74207374616b60408201527f6520300000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526025908201527f56503a3a6164645650666f7256543a206f6e6c792076657374696e6720636f6e60408201527f7472616374000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526024908201527f507269736d3a3a6265636f6d653a206368616e6765206e6f7420617574686f7260408201527f697a656400000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526027908201527f56503a3a5f77697468647261773a206e6f7420656e6f75676820746f6b656e7360408201527f207374616b656400000000000000000000000000000000000000000000000000606082015260800190565b60208082526028908201527f56503a3a72656d6f76655650666f7256543a206f6e6c792076657374696e672060408201527f636f6e7472616374000000000000000000000000000000000000000000000000606082015260800190565b6020808252602d908201527f56503a3a7374616b653a206d75737420617070726f766520746f6b656e73206260408201527f65666f7265207374616b696e6700000000000000000000000000000000000000606082015260800190565b60208082526026908201527f56503a3a5f77697468647261773a206e6f7420656e6f75676820766f74696e6760408201527f20706f7765720000000000000000000000000000000000000000000000000000606082015260800190565b815181526020918201519181019190915260400190565b90815260200190565b73ffffffffffffffffffffffffffffffffffffffff81168114610da957600080fdfe436f6e747261637420696e7374616e63652068617320616c7265616479206265656e20696e697469616c697a65645361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656456503a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473a2646970667358221220b95b61d8c8064351c3d8cfa4eb7338a5a84f2e97c4d7fbb508759b88b6a45b8a64736f6c63430007040033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806375a70bb611610097578063a1194c8e11610066578063a1194c8e146101e7578063a694fc3a146101fa578063a7dec8491461020d578063ecd9ba8214610220576100f5565b806375a70bb61461018e5780637741459e146101ae57806382dda22d146101c15780639b92ac4a146101d4576100f5565b80634ee2cd7e116100d35780634ee2cd7e146101355780635e6f60451461015e57806361500aa61461017357806370a082311461017b576100f5565b80631efaa442146100fa5780632e1a7d4d1461010f578063485cc95514610122575b600080fd5b61010d6101083660046121db565b610233565b005b61010d61011d366004612226565b6103a8565b61010d6101303660046121a3565b6104dc565b6101486101433660046121db565b61065c565b60405161015591906128c2565b60405180910390f35b610166610915565b60405161015591906122a3565b610166610940565b61014861018936600461216b565b61096b565b6101a161019c36600461216b565b610a16565b60405161015591906128ab565b6101486101bc3660046121a3565b610a58565b6101a16101cf3660046121a3565b610a6c565b61010d6101e23660046121db565b610ad0565b61010d6101f536600461216b565b610c0c565b61010d610208366004612226565b610dac565b61014861021b36600461216b565b611075565b61010d61022e366004612256565b611087565b60335460ff166102a457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905560006102d6611337565b90506000821161031b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610312906123e1565b60405180910390fd5b600281015473ffffffffffffffffffffffffffffffffffffffff16331461036e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161031290612794565b610378838361135b565b5050603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905550565b60335460ff1661041957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905580610478576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103129061258c565b6000610482611337565b60018101549091506104ad90339073ffffffffffffffffffffffffffffffffffffffff168480611424565b5050603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b600054610100900460ff16806104f557506104f5611640565b80610503575060005460ff16155b610558576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001806128ee602e913960400191505060405180910390fd5b600054610100900460ff161580156105be57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff909116610100171660011790555b6105c6611646565b60006105d0611337565b60018101805473ffffffffffffffffffffffffffffffffffffffff8088167fffffffffffffffffffffffff000000000000000000000000000000000000000092831617909255600290920180549186169190921617905550801561065757600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690555b505050565b6000438210610697576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610312906124f8565b60006106a1611784565b73ffffffffffffffffffffffffffffffffffffffff8516600090815260018201602052604090205490915063ffffffff16806106e25760009250505061090f565b73ffffffffffffffffffffffffffffffffffffffff851660009081526020838152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8601811685529252909120541684106107a55773ffffffffffffffffffffffffffffffffffffffff85166000908152602092835260408082207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9390930163ffffffff16825291909252902060010154905061090f565b73ffffffffffffffffffffffffffffffffffffffff851660009081526020838152604080832083805290915290205463ffffffff168410156107ec5760009250505061090f565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82015b8163ffffffff168163ffffffff1611156108cf57600282820363ffffffff1604810361083c61213a565b5073ffffffffffffffffffffffffffffffffffffffff881660009081526020868152604080832063ffffffff8086168552908352928190208151808301909252805490931680825260019093015491810191909152908814156108aa5760200151955061090f945050505050565b805163ffffffff168811156108c1578193506108c8565b6001820392505b5050610812565b5073ffffffffffffffffffffffffffffffffffffffff861660009081526020938452604080822063ffffffff909316825291909352909120600101549150505b92915050565b600080610920611337565b6002015473ffffffffffffffffffffffffffffffffffffffff1691505090565b60008061094b611337565b6001015473ffffffffffffffffffffffffffffffffffffffff1691505090565b600080610976611784565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260018201602052604090205490915063ffffffff16806109b3576000610a0e565b73ffffffffffffffffffffffffffffffffffffffff841660009081526020838152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff86011684529091529020600101545b949350505050565b610a1e612151565b6000610a28611337565b6001810154909150610a5190849073ffffffffffffffffffffffffffffffffffffffff16610a6c565b9392505050565b6000610a648383610a6c565b519392505050565b610a74612151565b6000610a7e6117a8565b73ffffffffffffffffffffffffffffffffffffffff8086166000908152602092835260408082209287168252918352819020815180830190925280548252600101549181019190915291505092915050565b60335460ff16610b4157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690556000610b73611337565b905060008211610baf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610312906125c3565b600281015473ffffffffffffffffffffffffffffffffffffffff163314610c02576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103129061267d565b61037883836117cc565b8073ffffffffffffffffffffffffffffffffffffffff16633e47158c6040518163ffffffff1660e01b815260040160206040518083038186803b158015610c5257600080fd5b505afa158015610c66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8a9190612187565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610cee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103129061243e565b8073ffffffffffffffffffffffffffffffffffffffff166394d8fbd06040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610d3657600080fd5b505af1158015610d4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6e9190612206565b1515600114610da9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610312906126da565b50565b60335460ff16610e1d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690556000610e4f611337565b905060008211610e8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610312906123aa565b60018101546040517f70a08231000000000000000000000000000000000000000000000000000000008152839173ffffffffffffffffffffffffffffffffffffffff16906370a0823190610ee39033906004016122a3565b60206040518083038186803b158015610efb57600080fd5b505afa158015610f0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f33919061223e565b1015610f6b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161031290612555565b60018101546040517fdd62ed3e000000000000000000000000000000000000000000000000000000008152839173ffffffffffffffffffffffffffffffffffffffff169063dd62ed3e90610fc590339030906004016122c4565b60206040518083038186803b158015610fdd57600080fd5b505afa158015610ff1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611015919061223e565b101561104d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610312906127f1565b60018101546104ad90339073ffffffffffffffffffffffffffffffffffffffff16848061187f565b600061108082610a16565b5192915050565b60335460ff166110f857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905584611157576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161031290612620565b6000611161611337565b60018101546040517f70a08231000000000000000000000000000000000000000000000000000000008152919250879173ffffffffffffffffffffffffffffffffffffffff909116906370a08231906111be9033906004016122a3565b60206040518083038186803b1580156111d657600080fd5b505afa1580156111ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120e919061223e565b1015611246576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103129061249b565b60018101546040517fd505accf00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063d505accf906112aa90339030908b908b908b908b908b906004016122eb565b600060405180830381600087803b1580156112c457600080fd5b505af11580156112d8573d6000803e3d6000fd5b50505060018201546113049150339073ffffffffffffffffffffffffffffffffffffffff16888061187f565b5050603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905550505050565b7f6d6a6fc321e0562f469846e9b1d74d90faeed9d71336854ad7fe2be150ff9f2090565b6000611365611784565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260018201602052604081205491925063ffffffff90911690816113a5576000611400565b73ffffffffffffffffffffffffffffffffffffffff851660009081526020848152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff87011684529091529020600101545b9050600061140e82866119aa565b905061141c868484846119ec565b505050505050565b600061142e6117a8565b73ffffffffffffffffffffffffffffffffffffffff8087166000908152602083815260408083209389168352929052205490915083111561149b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161031290612737565b73ffffffffffffffffffffffffffffffffffffffff80861660009081526020838152604080832093881683529290522060010154821115611508576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103129061284e565b73ffffffffffffffffffffffffffffffffffffffff8086166000908152602083815260408083209388168352929052205461154390846119aa565b73ffffffffffffffffffffffffffffffffffffffff8681166000908152602084815260408083209389168352929052209081556001015461158490836119aa565b73ffffffffffffffffffffffffffffffffffffffff808716600090815260208481526040808320938916808452939091529020600101919091556115c9908685611bda565b828473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167f91fb9d98b786c57d74c099ccd2beca1739e9f6a81fb49001ca465c4b7591bbe28560405161162791906128c2565b60405180910390a4611639858361135b565b5050505050565b303b1590565b600054610100900460ff168061165f575061165f611640565b8061166d575060005460ff16155b6116c2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001806128ee602e913960400191505060405180910390fd5b600054610100900460ff1615801561172857600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff909116610100171660011790555b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610da957600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16905550565b7f97ada73c2617b57999fe0c39e0cd251038e142d18fa592f9135b3c4884c92cf190565b7fb436861a9ea50c2256cd6ef2eb5e3092874d3eddb554844f2d197b6df51da09890565b60006117d6611784565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260018201602052604081205491925063ffffffff9091169081611816576000611871565b73ffffffffffffffffffffffffffffffffffffffff851660009081526020848152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff87011684529091529020600101545b9050600061140e8286611c67565b6118a173ffffffffffffffffffffffffffffffffffffffff8416853085611cdb565b60006118ab6117a8565b73ffffffffffffffffffffffffffffffffffffffff808716600090815260208381526040808320938916835292905220549091506118e99084611c67565b73ffffffffffffffffffffffffffffffffffffffff8681166000908152602084815260408083209389168352929052209081556001015461192a9083611c67565b73ffffffffffffffffffffffffffffffffffffffff808716600081815260208581526040808320948a1680845294909152908190206001019390935591518592907f6c86f3fd5118b3aa8bb4f389a617046de0a3d3d477de1a1673d227f802f616dc906119989087906128c2565b60405180910390a461163985836117cc565b6000610a5183836040518060400160405280601f81526020017f536166654d6174683a207375627472616374696f6e20756e646572666c6f7700815250611d76565b6000611a104360405180606001604052806032815260200161294660329139611e27565b90506000611a1c611784565b905060008563ffffffff16118015611a8e575073ffffffffffffffffffffffffffffffffffffffff861660009081526020828152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8a01811685529252909120548382169116145b15611af45773ffffffffffffffffffffffffffffffffffffffff861660009081526020828152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8a011684529091529020600101839055611b8d565b60408051808201825263ffffffff8085168252602080830187815273ffffffffffffffffffffffffffffffffffffffff8b1660008181528784528681208c861682528452868120955186549086167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000091821617875592516001968701559081528487019092529390208054928901909116919092161790555b82848773ffffffffffffffffffffffffffffffffffffffff167f53ed7954de66613e30dd29b46ab783aa594e6309d021d8854c76bb3325d03aa360405160405180910390a4505050505050565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610657908490611e71565b600082820183811015610a5157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6040805173ffffffffffffffffffffffffffffffffffffffff80861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052611d70908590611e71565b50505050565b60008184841115611e1f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611de4578181015183820152602001611dcc565b50505050905090810190601f168015611e115780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6000816401000000008410611e69576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103129190612339565b509192915050565b6060611ed3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16611f499092919063ffffffff16565b80519091501561065757808060200190516020811015611ef257600080fd5b5051610657576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a81526020018061291c602a913960400191505060405180910390fd5b6060610a0e848460008585611f5d856120b4565b611fc857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b6020831061203257805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101611ff5565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114612094576040519150601f19603f3d011682016040523d82523d6000602084013e612099565b606091505b50915091506120a98282866120ba565b979650505050505050565b3b151590565b606083156120c9575081610a51565b8251156120d95782518084602001fd5b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201818152845160248401528451859391928392604401919085019080838360008315611de4578181015183820152602001611dcc565b604080518082019091526000808252602082015290565b604051806040016040528060008152602001600081525090565b60006020828403121561217c578081fd5b8135610a51816128cb565b600060208284031215612198578081fd5b8151610a51816128cb565b600080604083850312156121b5578081fd5b82356121c0816128cb565b915060208301356121d0816128cb565b809150509250929050565b600080604083850312156121ed578182fd5b82356121f8816128cb565b946020939093013593505050565b600060208284031215612217578081fd5b81518015158114610a51578182fd5b600060208284031215612237578081fd5b5035919050565b60006020828403121561224f578081fd5b5051919050565b600080600080600060a0868803121561226d578081fd5b8535945060208601359350604086013560ff8116811461228b578182fd5b94979396509394606081013594506080013592915050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff92831681529116602082015260400190565b73ffffffffffffffffffffffffffffffffffffffff97881681529590961660208601526040850193909352606084019190915260ff16608083015260a082015260c081019190915260e00190565b6000602080835283518082850152825b8181101561236557858101830151858201604001528201612349565b818111156123765783604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b60208082526019908201527f56503a3a7374616b653a2063616e6e6f74207374616b65203000000000000000604082015260600190565b6020808252602f908201527f56503a3a72656d6f76655650666f7256543a2063616e6e6f742072656d6f766560408201527f203020766f74696e6720706f7765720000000000000000000000000000000000606082015260800190565b60208082526039908201527f507269736d3a3a6265636f6d653a206f6e6c792070726f78792061646d696e2060408201527f63616e206368616e676520696d706c656d656e746174696f6e00000000000000606082015260800190565b60208082526026908201527f56503a3a7374616b65576974685065726d69743a206e6f7420656e6f7567682060408201527f746f6b656e730000000000000000000000000000000000000000000000000000606082015260800190565b60208082526023908201527f56503a3a62616c616e63654f6641743a206e6f74207965742064657465726d6960408201527f6e65640000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601c908201527f56503a3a7374616b653a206e6f7420656e6f75676820746f6b656e7300000000604082015260600190565b6020808252601f908201527f56503a3a77697468647261773a2063616e6e6f74207769746864726177203000604082015260600190565b60208082526029908201527f56503a3a6164645650666f7256543a2063616e6e6f7420616464203020766f7460408201527f696e6720706f7765720000000000000000000000000000000000000000000000606082015260800190565b60208082526023908201527f56503a3a7374616b65576974685065726d69743a2063616e6e6f74207374616b60408201527f6520300000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526025908201527f56503a3a6164645650666f7256543a206f6e6c792076657374696e6720636f6e60408201527f7472616374000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526024908201527f507269736d3a3a6265636f6d653a206368616e6765206e6f7420617574686f7260408201527f697a656400000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526027908201527f56503a3a5f77697468647261773a206e6f7420656e6f75676820746f6b656e7360408201527f207374616b656400000000000000000000000000000000000000000000000000606082015260800190565b60208082526028908201527f56503a3a72656d6f76655650666f7256543a206f6e6c792076657374696e672060408201527f636f6e7472616374000000000000000000000000000000000000000000000000606082015260800190565b6020808252602d908201527f56503a3a7374616b653a206d75737420617070726f766520746f6b656e73206260408201527f65666f7265207374616b696e6700000000000000000000000000000000000000606082015260800190565b60208082526026908201527f56503a3a5f77697468647261773a206e6f7420656e6f75676820766f74696e6760408201527f20706f7765720000000000000000000000000000000000000000000000000000606082015260800190565b815181526020918201519181019190915260400190565b90815260200190565b73ffffffffffffffffffffffffffffffffffffffff81168114610da957600080fdfe436f6e747261637420696e7374616e63652068617320616c7265616479206265656e20696e697469616c697a65645361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656456503a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473a2646970667358221220b95b61d8c8064351c3d8cfa4eb7338a5a84f2e97c4d7fbb508759b88b6a45b8a64736f6c63430007040033
Loading...
Loading
Loading...
Loading
OVERVIEW
The Voting Power Implementation determines the logic for updating voting power snapshots.Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.