ETH Price: $3,352.53 (-0.97%)

Contract

0x9CaC8B93D5cc43d253362E787ABa4d4EFf676170
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
VotingPower

Compiler Version
v0.7.4+commit.3f05b770

Optimization Enabled:
Yes with 999999 runs

Other Settings:
default evmVersion, MIT license
File 1 of 13 : VotingPower.sol
// 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 Decimals used for voting power
     * @return decimals
     */
    function decimals() public pure returns (uint8) {
        return 18;
    }

    /**
     * @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);
    }
}

File 2 of 13 : IArchToken.sol
// 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);
}

File 3 of 13 : IERC20.sol
// 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);
}

File 4 of 13 : IVesting.sol
// 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);

}

File 5 of 13 : IVotingPower.sol
// 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);
}

File 6 of 13 : Address.sol
// 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);
            }
        }
    }
}

File 7 of 13 : Initializable.sol
// 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;
}

File 8 of 13 : PrismProxy.sol
// 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()) }
        }
    }
}

File 9 of 13 : PrismProxyImplementation.sol
// 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");
    }
}

File 10 of 13 : ReentrancyGuardUpgradeSafe.sol
// 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;
}

File 11 of 13 : SafeERC20.sol
// 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");
        }
    }
}

File 12 of 13 : SafeMath.sol
// 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;
    }
}

File 13 of 13 : VotingPowerStorage.sol
// 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
        }
    }
}

Settings
{
  "evmVersion": "istanbul",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 999999
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"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":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","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"}]

608060405234801561001057600080fd5b506129e0806100206000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c806375a70bb611610097578063a1194c8e11610066578063a1194c8e14610207578063a694fc3a1461021a578063a7dec8491461022d578063ecd9ba821461024057610100565b806375a70bb6146101ae5780637741459e146101ce57806382dda22d146101e15780639b92ac4a146101f457610100565b80634ee2cd7e116100d35780634ee2cd7e1461015e5780635e6f60451461017e57806361500aa61461019357806370a082311461019b57610100565b80631efaa442146101055780632e1a7d4d1461011a578063313ce5671461012d578063485cc9551461014b575b600080fd5b610118610113366004612200565b610253565b005b61011861012836600461224b565b6103c8565b6101356104fc565b60405161014291906128f0565b60405180910390f35b6101186101593660046121c8565b610501565b61017161016c366004612200565b610681565b60405161014291906128e7565b61018661093a565b60405161014291906122c8565b610186610965565b6101716101a9366004612190565b610990565b6101c16101bc366004612190565b610a3b565b60405161014291906128d0565b6101716101dc3660046121c8565b610a7d565b6101c16101ef3660046121c8565b610a91565b610118610202366004612200565b610af5565b610118610215366004612190565b610c31565b61011861022836600461224b565b610dd1565b61017161023b366004612190565b61109a565b61011861024e36600461227b565b6110ac565b60335460ff166102c457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905560006102f661135c565b90506000821161033b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161033290612406565b60405180910390fd5b600281015473ffffffffffffffffffffffffffffffffffffffff16331461038e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610332906127b9565b6103988383611380565b5050603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905550565b60335460ff1661043957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905580610498576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610332906125b1565b60006104a261135c565b60018101549091506104cd90339073ffffffffffffffffffffffffffffffffffffffff168480611449565b5050603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b601290565b600054610100900460ff168061051a575061051a611665565b80610528575060005460ff16155b61057d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e815260200180612921602e913960400191505060405180910390fd5b600054610100900460ff161580156105e357600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff909116610100171660011790555b6105eb61166b565b60006105f561135c565b60018101805473ffffffffffffffffffffffffffffffffffffffff8088167fffffffffffffffffffffffff000000000000000000000000000000000000000092831617909255600290920180549186169190921617905550801561067c57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690555b505050565b60004382106106bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103329061251d565b60006106c66117a9565b73ffffffffffffffffffffffffffffffffffffffff8516600090815260018201602052604090205490915063ffffffff168061070757600092505050610934565b73ffffffffffffffffffffffffffffffffffffffff851660009081526020838152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8601811685529252909120541684106107ca5773ffffffffffffffffffffffffffffffffffffffff85166000908152602092835260408082207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9390930163ffffffff168252919092529020600101549050610934565b73ffffffffffffffffffffffffffffffffffffffff851660009081526020838152604080832083805290915290205463ffffffff1684101561081157600092505050610934565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82015b8163ffffffff168163ffffffff1611156108f457600282820363ffffffff1604810361086161215f565b5073ffffffffffffffffffffffffffffffffffffffff881660009081526020868152604080832063ffffffff8086168552908352928190208151808301909252805490931680825260019093015491810191909152908814156108cf57602001519550610934945050505050565b805163ffffffff168811156108e6578193506108ed565b6001820392505b5050610837565b5073ffffffffffffffffffffffffffffffffffffffff861660009081526020938452604080822063ffffffff909316825291909352909120600101549150505b92915050565b60008061094561135c565b6002015473ffffffffffffffffffffffffffffffffffffffff1691505090565b60008061097061135c565b6001015473ffffffffffffffffffffffffffffffffffffffff1691505090565b60008061099b6117a9565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260018201602052604090205490915063ffffffff16806109d8576000610a33565b73ffffffffffffffffffffffffffffffffffffffff841660009081526020838152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff86011684529091529020600101545b949350505050565b610a43612176565b6000610a4d61135c565b6001810154909150610a7690849073ffffffffffffffffffffffffffffffffffffffff16610a91565b9392505050565b6000610a898383610a91565b519392505050565b610a99612176565b6000610aa36117cd565b73ffffffffffffffffffffffffffffffffffffffff8086166000908152602092835260408082209287168252918352819020815180830190925280548252600101549181019190915291505092915050565b60335460ff16610b6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690556000610b9861135c565b905060008211610bd4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610332906125e8565b600281015473ffffffffffffffffffffffffffffffffffffffff163314610c27576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610332906126a2565b61039883836117f1565b8073ffffffffffffffffffffffffffffffffffffffff16633e47158c6040518163ffffffff1660e01b815260040160206040518083038186803b158015610c7757600080fd5b505afa158015610c8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610caf91906121ac565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d13576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161033290612463565b8073ffffffffffffffffffffffffffffffffffffffff166394d8fbd06040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610d5b57600080fd5b505af1158015610d6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d93919061222b565b1515600114610dce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610332906126ff565b50565b60335460ff16610e4257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690556000610e7461135c565b905060008211610eb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610332906123cf565b60018101546040517f70a08231000000000000000000000000000000000000000000000000000000008152839173ffffffffffffffffffffffffffffffffffffffff16906370a0823190610f089033906004016122c8565b60206040518083038186803b158015610f2057600080fd5b505afa158015610f34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f589190612263565b1015610f90576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103329061257a565b60018101546040517fdd62ed3e000000000000000000000000000000000000000000000000000000008152839173ffffffffffffffffffffffffffffffffffffffff169063dd62ed3e90610fea90339030906004016122e9565b60206040518083038186803b15801561100257600080fd5b505afa158015611016573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061103a9190612263565b1015611072576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161033290612816565b60018101546104cd90339073ffffffffffffffffffffffffffffffffffffffff1684806118a4565b60006110a582610a3b565b5192915050565b60335460ff1661111d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690558461117c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161033290612645565b600061118661135c565b60018101546040517f70a08231000000000000000000000000000000000000000000000000000000008152919250879173ffffffffffffffffffffffffffffffffffffffff909116906370a08231906111e39033906004016122c8565b60206040518083038186803b1580156111fb57600080fd5b505afa15801561120f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112339190612263565b101561126b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610332906124c0565b60018101546040517fd505accf00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063d505accf906112cf90339030908b908b908b908b908b90600401612310565b600060405180830381600087803b1580156112e957600080fd5b505af11580156112fd573d6000803e3d6000fd5b50505060018201546113299150339073ffffffffffffffffffffffffffffffffffffffff1688806118a4565b5050603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905550505050565b7f6d6a6fc321e0562f469846e9b1d74d90faeed9d71336854ad7fe2be150ff9f2090565b600061138a6117a9565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260018201602052604081205491925063ffffffff90911690816113ca576000611425565b73ffffffffffffffffffffffffffffffffffffffff851660009081526020848152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff87011684529091529020600101545b9050600061143382866119cf565b905061144186848484611a11565b505050505050565b60006114536117cd565b73ffffffffffffffffffffffffffffffffffffffff808716600090815260208381526040808320938916835292905220549091508311156114c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103329061275c565b73ffffffffffffffffffffffffffffffffffffffff8086166000908152602083815260408083209388168352929052206001015482111561152d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161033290612873565b73ffffffffffffffffffffffffffffffffffffffff8086166000908152602083815260408083209388168352929052205461156890846119cf565b73ffffffffffffffffffffffffffffffffffffffff868116600090815260208481526040808320938916835292905220908155600101546115a990836119cf565b73ffffffffffffffffffffffffffffffffffffffff808716600090815260208481526040808320938916808452939091529020600101919091556115ee908685611bff565b828473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167f91fb9d98b786c57d74c099ccd2beca1739e9f6a81fb49001ca465c4b7591bbe28560405161164c91906128e7565b60405180910390a461165e8583611380565b5050505050565b303b1590565b600054610100900460ff16806116845750611684611665565b80611692575060005460ff16155b6116e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e815260200180612921602e913960400191505060405180910390fd5b600054610100900460ff1615801561174d57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff909116610100171660011790555b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610dce57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16905550565b7f97ada73c2617b57999fe0c39e0cd251038e142d18fa592f9135b3c4884c92cf190565b7fb436861a9ea50c2256cd6ef2eb5e3092874d3eddb554844f2d197b6df51da09890565b60006117fb6117a9565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260018201602052604081205491925063ffffffff909116908161183b576000611896565b73ffffffffffffffffffffffffffffffffffffffff851660009081526020848152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff87011684529091529020600101545b905060006114338286611c8c565b6118c673ffffffffffffffffffffffffffffffffffffffff8416853085611d00565b60006118d06117cd565b73ffffffffffffffffffffffffffffffffffffffff8087166000908152602083815260408083209389168352929052205490915061190e9084611c8c565b73ffffffffffffffffffffffffffffffffffffffff8681166000908152602084815260408083209389168352929052209081556001015461194f9083611c8c565b73ffffffffffffffffffffffffffffffffffffffff808716600081815260208581526040808320948a1680845294909152908190206001019390935591518592907f6c86f3fd5118b3aa8bb4f389a617046de0a3d3d477de1a1673d227f802f616dc906119bd9087906128e7565b60405180910390a461165e85836117f1565b6000610a7683836040518060400160405280601f81526020017f536166654d6174683a207375627472616374696f6e20756e646572666c6f7700815250611d9b565b6000611a354360405180606001604052806032815260200161297960329139611e4c565b90506000611a416117a9565b905060008563ffffffff16118015611ab3575073ffffffffffffffffffffffffffffffffffffffff861660009081526020828152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8a01811685529252909120548382169116145b15611b195773ffffffffffffffffffffffffffffffffffffffff861660009081526020828152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8a011684529091529020600101839055611bb2565b60408051808201825263ffffffff8085168252602080830187815273ffffffffffffffffffffffffffffffffffffffff8b1660008181528784528681208c861682528452868120955186549086167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000091821617875592516001968701559081528487019092529390208054928901909116919092161790555b82848773ffffffffffffffffffffffffffffffffffffffff167f53ed7954de66613e30dd29b46ab783aa594e6309d021d8854c76bb3325d03aa360405160405180910390a4505050505050565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb0000000000000000000000000000000000000000000000000000000017905261067c908490611e96565b600082820183811015610a7657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6040805173ffffffffffffffffffffffffffffffffffffffff80861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052611d95908590611e96565b50505050565b60008184841115611e44576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611e09578181015183820152602001611df1565b50505050905090810190601f168015611e365780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6000816401000000008410611e8e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610332919061235e565b509192915050565b6060611ef8826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16611f6e9092919063ffffffff16565b80519091501561067c57808060200190516020811015611f1757600080fd5b505161067c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a81526020018061294f602a913960400191505060405180910390fd5b6060610a33848460008585611f82856120d9565b611fed57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b6020831061205757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161201a565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146120b9576040519150601f19603f3d011682016040523d82523d6000602084013e6120be565b606091505b50915091506120ce8282866120df565b979650505050505050565b3b151590565b606083156120ee575081610a76565b8251156120fe5782518084602001fd5b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201818152845160248401528451859391928392604401919085019080838360008315611e09578181015183820152602001611df1565b604080518082019091526000808252602082015290565b604051806040016040528060008152602001600081525090565b6000602082840312156121a1578081fd5b8135610a76816128fe565b6000602082840312156121bd578081fd5b8151610a76816128fe565b600080604083850312156121da578081fd5b82356121e5816128fe565b915060208301356121f5816128fe565b809150509250929050565b60008060408385031215612212578182fd5b823561221d816128fe565b946020939093013593505050565b60006020828403121561223c578081fd5b81518015158114610a76578182fd5b60006020828403121561225c578081fd5b5035919050565b600060208284031215612274578081fd5b5051919050565b600080600080600060a08688031215612292578081fd5b8535945060208601359350604086013560ff811681146122b0578182fd5b94979396509394606081013594506080013592915050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff92831681529116602082015260400190565b73ffffffffffffffffffffffffffffffffffffffff97881681529590961660208601526040850193909352606084019190915260ff16608083015260a082015260c081019190915260e00190565b6000602080835283518082850152825b8181101561238a5785810183015185820160400152820161236e565b8181111561239b5783604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b60208082526019908201527f56503a3a7374616b653a2063616e6e6f74207374616b65203000000000000000604082015260600190565b6020808252602f908201527f56503a3a72656d6f76655650666f7256543a2063616e6e6f742072656d6f766560408201527f203020766f74696e6720706f7765720000000000000000000000000000000000606082015260800190565b60208082526039908201527f507269736d3a3a6265636f6d653a206f6e6c792070726f78792061646d696e2060408201527f63616e206368616e676520696d706c656d656e746174696f6e00000000000000606082015260800190565b60208082526026908201527f56503a3a7374616b65576974685065726d69743a206e6f7420656e6f7567682060408201527f746f6b656e730000000000000000000000000000000000000000000000000000606082015260800190565b60208082526023908201527f56503a3a62616c616e63654f6641743a206e6f74207965742064657465726d6960408201527f6e65640000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601c908201527f56503a3a7374616b653a206e6f7420656e6f75676820746f6b656e7300000000604082015260600190565b6020808252601f908201527f56503a3a77697468647261773a2063616e6e6f74207769746864726177203000604082015260600190565b60208082526029908201527f56503a3a6164645650666f7256543a2063616e6e6f7420616464203020766f7460408201527f696e6720706f7765720000000000000000000000000000000000000000000000606082015260800190565b60208082526023908201527f56503a3a7374616b65576974685065726d69743a2063616e6e6f74207374616b60408201527f6520300000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526025908201527f56503a3a6164645650666f7256543a206f6e6c792076657374696e6720636f6e60408201527f7472616374000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526024908201527f507269736d3a3a6265636f6d653a206368616e6765206e6f7420617574686f7260408201527f697a656400000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526027908201527f56503a3a5f77697468647261773a206e6f7420656e6f75676820746f6b656e7360408201527f207374616b656400000000000000000000000000000000000000000000000000606082015260800190565b60208082526028908201527f56503a3a72656d6f76655650666f7256543a206f6e6c792076657374696e672060408201527f636f6e7472616374000000000000000000000000000000000000000000000000606082015260800190565b6020808252602d908201527f56503a3a7374616b653a206d75737420617070726f766520746f6b656e73206260408201527f65666f7265207374616b696e6700000000000000000000000000000000000000606082015260800190565b60208082526026908201527f56503a3a5f77697468647261773a206e6f7420656e6f75676820766f74696e6760408201527f20706f7765720000000000000000000000000000000000000000000000000000606082015260800190565b815181526020918201519181019190915260400190565b90815260200190565b60ff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff81168114610dce57600080fdfe436f6e747261637420696e7374616e63652068617320616c7265616479206265656e20696e697469616c697a65645361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656456503a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473a26469706673582212205103675c03fd5259997b6aefb426b39dcb90e81adb5e946a158fd72ea9f88bce64736f6c63430007040033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101005760003560e01c806375a70bb611610097578063a1194c8e11610066578063a1194c8e14610207578063a694fc3a1461021a578063a7dec8491461022d578063ecd9ba821461024057610100565b806375a70bb6146101ae5780637741459e146101ce57806382dda22d146101e15780639b92ac4a146101f457610100565b80634ee2cd7e116100d35780634ee2cd7e1461015e5780635e6f60451461017e57806361500aa61461019357806370a082311461019b57610100565b80631efaa442146101055780632e1a7d4d1461011a578063313ce5671461012d578063485cc9551461014b575b600080fd5b610118610113366004612200565b610253565b005b61011861012836600461224b565b6103c8565b6101356104fc565b60405161014291906128f0565b60405180910390f35b6101186101593660046121c8565b610501565b61017161016c366004612200565b610681565b60405161014291906128e7565b61018661093a565b60405161014291906122c8565b610186610965565b6101716101a9366004612190565b610990565b6101c16101bc366004612190565b610a3b565b60405161014291906128d0565b6101716101dc3660046121c8565b610a7d565b6101c16101ef3660046121c8565b610a91565b610118610202366004612200565b610af5565b610118610215366004612190565b610c31565b61011861022836600461224b565b610dd1565b61017161023b366004612190565b61109a565b61011861024e36600461227b565b6110ac565b60335460ff166102c457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905560006102f661135c565b90506000821161033b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161033290612406565b60405180910390fd5b600281015473ffffffffffffffffffffffffffffffffffffffff16331461038e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610332906127b9565b6103988383611380565b5050603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905550565b60335460ff1661043957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905580610498576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610332906125b1565b60006104a261135c565b60018101549091506104cd90339073ffffffffffffffffffffffffffffffffffffffff168480611449565b5050603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b601290565b600054610100900460ff168061051a575061051a611665565b80610528575060005460ff16155b61057d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e815260200180612921602e913960400191505060405180910390fd5b600054610100900460ff161580156105e357600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff909116610100171660011790555b6105eb61166b565b60006105f561135c565b60018101805473ffffffffffffffffffffffffffffffffffffffff8088167fffffffffffffffffffffffff000000000000000000000000000000000000000092831617909255600290920180549186169190921617905550801561067c57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690555b505050565b60004382106106bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103329061251d565b60006106c66117a9565b73ffffffffffffffffffffffffffffffffffffffff8516600090815260018201602052604090205490915063ffffffff168061070757600092505050610934565b73ffffffffffffffffffffffffffffffffffffffff851660009081526020838152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8601811685529252909120541684106107ca5773ffffffffffffffffffffffffffffffffffffffff85166000908152602092835260408082207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9390930163ffffffff168252919092529020600101549050610934565b73ffffffffffffffffffffffffffffffffffffffff851660009081526020838152604080832083805290915290205463ffffffff1684101561081157600092505050610934565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82015b8163ffffffff168163ffffffff1611156108f457600282820363ffffffff1604810361086161215f565b5073ffffffffffffffffffffffffffffffffffffffff881660009081526020868152604080832063ffffffff8086168552908352928190208151808301909252805490931680825260019093015491810191909152908814156108cf57602001519550610934945050505050565b805163ffffffff168811156108e6578193506108ed565b6001820392505b5050610837565b5073ffffffffffffffffffffffffffffffffffffffff861660009081526020938452604080822063ffffffff909316825291909352909120600101549150505b92915050565b60008061094561135c565b6002015473ffffffffffffffffffffffffffffffffffffffff1691505090565b60008061097061135c565b6001015473ffffffffffffffffffffffffffffffffffffffff1691505090565b60008061099b6117a9565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260018201602052604090205490915063ffffffff16806109d8576000610a33565b73ffffffffffffffffffffffffffffffffffffffff841660009081526020838152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff86011684529091529020600101545b949350505050565b610a43612176565b6000610a4d61135c565b6001810154909150610a7690849073ffffffffffffffffffffffffffffffffffffffff16610a91565b9392505050565b6000610a898383610a91565b519392505050565b610a99612176565b6000610aa36117cd565b73ffffffffffffffffffffffffffffffffffffffff8086166000908152602092835260408082209287168252918352819020815180830190925280548252600101549181019190915291505092915050565b60335460ff16610b6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690556000610b9861135c565b905060008211610bd4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610332906125e8565b600281015473ffffffffffffffffffffffffffffffffffffffff163314610c27576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610332906126a2565b61039883836117f1565b8073ffffffffffffffffffffffffffffffffffffffff16633e47158c6040518163ffffffff1660e01b815260040160206040518083038186803b158015610c7757600080fd5b505afa158015610c8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610caf91906121ac565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d13576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161033290612463565b8073ffffffffffffffffffffffffffffffffffffffff166394d8fbd06040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610d5b57600080fd5b505af1158015610d6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d93919061222b565b1515600114610dce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610332906126ff565b50565b60335460ff16610e4257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690556000610e7461135c565b905060008211610eb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610332906123cf565b60018101546040517f70a08231000000000000000000000000000000000000000000000000000000008152839173ffffffffffffffffffffffffffffffffffffffff16906370a0823190610f089033906004016122c8565b60206040518083038186803b158015610f2057600080fd5b505afa158015610f34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f589190612263565b1015610f90576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103329061257a565b60018101546040517fdd62ed3e000000000000000000000000000000000000000000000000000000008152839173ffffffffffffffffffffffffffffffffffffffff169063dd62ed3e90610fea90339030906004016122e9565b60206040518083038186803b15801561100257600080fd5b505afa158015611016573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061103a9190612263565b1015611072576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161033290612816565b60018101546104cd90339073ffffffffffffffffffffffffffffffffffffffff1684806118a4565b60006110a582610a3b565b5192915050565b60335460ff1661111d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690558461117c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161033290612645565b600061118661135c565b60018101546040517f70a08231000000000000000000000000000000000000000000000000000000008152919250879173ffffffffffffffffffffffffffffffffffffffff909116906370a08231906111e39033906004016122c8565b60206040518083038186803b1580156111fb57600080fd5b505afa15801561120f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112339190612263565b101561126b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610332906124c0565b60018101546040517fd505accf00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063d505accf906112cf90339030908b908b908b908b908b90600401612310565b600060405180830381600087803b1580156112e957600080fd5b505af11580156112fd573d6000803e3d6000fd5b50505060018201546113299150339073ffffffffffffffffffffffffffffffffffffffff1688806118a4565b5050603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905550505050565b7f6d6a6fc321e0562f469846e9b1d74d90faeed9d71336854ad7fe2be150ff9f2090565b600061138a6117a9565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260018201602052604081205491925063ffffffff90911690816113ca576000611425565b73ffffffffffffffffffffffffffffffffffffffff851660009081526020848152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff87011684529091529020600101545b9050600061143382866119cf565b905061144186848484611a11565b505050505050565b60006114536117cd565b73ffffffffffffffffffffffffffffffffffffffff808716600090815260208381526040808320938916835292905220549091508311156114c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103329061275c565b73ffffffffffffffffffffffffffffffffffffffff8086166000908152602083815260408083209388168352929052206001015482111561152d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161033290612873565b73ffffffffffffffffffffffffffffffffffffffff8086166000908152602083815260408083209388168352929052205461156890846119cf565b73ffffffffffffffffffffffffffffffffffffffff868116600090815260208481526040808320938916835292905220908155600101546115a990836119cf565b73ffffffffffffffffffffffffffffffffffffffff808716600090815260208481526040808320938916808452939091529020600101919091556115ee908685611bff565b828473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167f91fb9d98b786c57d74c099ccd2beca1739e9f6a81fb49001ca465c4b7591bbe28560405161164c91906128e7565b60405180910390a461165e8583611380565b5050505050565b303b1590565b600054610100900460ff16806116845750611684611665565b80611692575060005460ff16155b6116e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e815260200180612921602e913960400191505060405180910390fd5b600054610100900460ff1615801561174d57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff909116610100171660011790555b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610dce57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16905550565b7f97ada73c2617b57999fe0c39e0cd251038e142d18fa592f9135b3c4884c92cf190565b7fb436861a9ea50c2256cd6ef2eb5e3092874d3eddb554844f2d197b6df51da09890565b60006117fb6117a9565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260018201602052604081205491925063ffffffff909116908161183b576000611896565b73ffffffffffffffffffffffffffffffffffffffff851660009081526020848152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff87011684529091529020600101545b905060006114338286611c8c565b6118c673ffffffffffffffffffffffffffffffffffffffff8416853085611d00565b60006118d06117cd565b73ffffffffffffffffffffffffffffffffffffffff8087166000908152602083815260408083209389168352929052205490915061190e9084611c8c565b73ffffffffffffffffffffffffffffffffffffffff8681166000908152602084815260408083209389168352929052209081556001015461194f9083611c8c565b73ffffffffffffffffffffffffffffffffffffffff808716600081815260208581526040808320948a1680845294909152908190206001019390935591518592907f6c86f3fd5118b3aa8bb4f389a617046de0a3d3d477de1a1673d227f802f616dc906119bd9087906128e7565b60405180910390a461165e85836117f1565b6000610a7683836040518060400160405280601f81526020017f536166654d6174683a207375627472616374696f6e20756e646572666c6f7700815250611d9b565b6000611a354360405180606001604052806032815260200161297960329139611e4c565b90506000611a416117a9565b905060008563ffffffff16118015611ab3575073ffffffffffffffffffffffffffffffffffffffff861660009081526020828152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8a01811685529252909120548382169116145b15611b195773ffffffffffffffffffffffffffffffffffffffff861660009081526020828152604080832063ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8a011684529091529020600101839055611bb2565b60408051808201825263ffffffff8085168252602080830187815273ffffffffffffffffffffffffffffffffffffffff8b1660008181528784528681208c861682528452868120955186549086167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000091821617875592516001968701559081528487019092529390208054928901909116919092161790555b82848773ffffffffffffffffffffffffffffffffffffffff167f53ed7954de66613e30dd29b46ab783aa594e6309d021d8854c76bb3325d03aa360405160405180910390a4505050505050565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb0000000000000000000000000000000000000000000000000000000017905261067c908490611e96565b600082820183811015610a7657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6040805173ffffffffffffffffffffffffffffffffffffffff80861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052611d95908590611e96565b50505050565b60008184841115611e44576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611e09578181015183820152602001611df1565b50505050905090810190601f168015611e365780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6000816401000000008410611e8e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610332919061235e565b509192915050565b6060611ef8826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16611f6e9092919063ffffffff16565b80519091501561067c57808060200190516020811015611f1757600080fd5b505161067c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a81526020018061294f602a913960400191505060405180910390fd5b6060610a33848460008585611f82856120d9565b611fed57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b6020831061205757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161201a565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146120b9576040519150601f19603f3d011682016040523d82523d6000602084013e6120be565b606091505b50915091506120ce8282866120df565b979650505050505050565b3b151590565b606083156120ee575081610a76565b8251156120fe5782518084602001fd5b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201818152845160248401528451859391928392604401919085019080838360008315611e09578181015183820152602001611df1565b604080518082019091526000808252602082015290565b604051806040016040528060008152602001600081525090565b6000602082840312156121a1578081fd5b8135610a76816128fe565b6000602082840312156121bd578081fd5b8151610a76816128fe565b600080604083850312156121da578081fd5b82356121e5816128fe565b915060208301356121f5816128fe565b809150509250929050565b60008060408385031215612212578182fd5b823561221d816128fe565b946020939093013593505050565b60006020828403121561223c578081fd5b81518015158114610a76578182fd5b60006020828403121561225c578081fd5b5035919050565b600060208284031215612274578081fd5b5051919050565b600080600080600060a08688031215612292578081fd5b8535945060208601359350604086013560ff811681146122b0578182fd5b94979396509394606081013594506080013592915050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff92831681529116602082015260400190565b73ffffffffffffffffffffffffffffffffffffffff97881681529590961660208601526040850193909352606084019190915260ff16608083015260a082015260c081019190915260e00190565b6000602080835283518082850152825b8181101561238a5785810183015185820160400152820161236e565b8181111561239b5783604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b60208082526019908201527f56503a3a7374616b653a2063616e6e6f74207374616b65203000000000000000604082015260600190565b6020808252602f908201527f56503a3a72656d6f76655650666f7256543a2063616e6e6f742072656d6f766560408201527f203020766f74696e6720706f7765720000000000000000000000000000000000606082015260800190565b60208082526039908201527f507269736d3a3a6265636f6d653a206f6e6c792070726f78792061646d696e2060408201527f63616e206368616e676520696d706c656d656e746174696f6e00000000000000606082015260800190565b60208082526026908201527f56503a3a7374616b65576974685065726d69743a206e6f7420656e6f7567682060408201527f746f6b656e730000000000000000000000000000000000000000000000000000606082015260800190565b60208082526023908201527f56503a3a62616c616e63654f6641743a206e6f74207965742064657465726d6960408201527f6e65640000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601c908201527f56503a3a7374616b653a206e6f7420656e6f75676820746f6b656e7300000000604082015260600190565b6020808252601f908201527f56503a3a77697468647261773a2063616e6e6f74207769746864726177203000604082015260600190565b60208082526029908201527f56503a3a6164645650666f7256543a2063616e6e6f7420616464203020766f7460408201527f696e6720706f7765720000000000000000000000000000000000000000000000606082015260800190565b60208082526023908201527f56503a3a7374616b65576974685065726d69743a2063616e6e6f74207374616b60408201527f6520300000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526025908201527f56503a3a6164645650666f7256543a206f6e6c792076657374696e6720636f6e60408201527f7472616374000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526024908201527f507269736d3a3a6265636f6d653a206368616e6765206e6f7420617574686f7260408201527f697a656400000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526027908201527f56503a3a5f77697468647261773a206e6f7420656e6f75676820746f6b656e7360408201527f207374616b656400000000000000000000000000000000000000000000000000606082015260800190565b60208082526028908201527f56503a3a72656d6f76655650666f7256543a206f6e6c792076657374696e672060408201527f636f6e7472616374000000000000000000000000000000000000000000000000606082015260800190565b6020808252602d908201527f56503a3a7374616b653a206d75737420617070726f766520746f6b656e73206260408201527f65666f7265207374616b696e6700000000000000000000000000000000000000606082015260800190565b60208082526026908201527f56503a3a5f77697468647261773a206e6f7420656e6f75676820766f74696e6760408201527f20706f7765720000000000000000000000000000000000000000000000000000606082015260800190565b815181526020918201519181019190915260400190565b90815260200190565b60ff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff81168114610dce57600080fdfe436f6e747261637420696e7374616e63652068617320616c7265616479206265656e20696e697469616c697a65645361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656456503a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473a26469706673582212205103675c03fd5259997b6aefb426b39dcb90e81adb5e946a158fd72ea9f88bce64736f6c63430007040033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

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.