RadicleToken

Deploy on Alchemy
Verified
Ethereum
Verified, Token
Solidity
Verified
Ethereum

Contract Information

The following smart contract is for the RadicleToken, an ERC20 token. It includes functions for transferring tokens, approving spending limits, and delegating voting power. It also includes functions for burning tokens and getting voting power information. The contract uses SafeMath to prevent integer overflow/underflow and includes a DOMAIN_SEPARATOR for EIP-712 signatures. The purpose of the contract is to provide a token for the Radicle decentralized code collaboration platform.
More Info

RadicleToken Source Code

// SPDX-License-Identifier: GPL-3.0-only // Copyright 2020 Compound Labs, Inc. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // 3. Neither the name of the copyright holder nor the names of its // contributors may be used to endorse or promote products derived from this // software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. pragma solidity ^0.7.5; pragma experimental ABIEncoderV2; contract RadicleToken { /// @notice EIP-20 token name for this token string public constant NAME = "Radicle"; /// @notice EIP-20 token symbol for this token string public constant SYMBOL = "RAD"; /// @notice EIP-20 token decimals for this token uint8 public constant DECIMALS = 18; /// @notice Total number of tokens in circulation uint256 public totalSupply = 100000000e18; // 100 million tokens // Allowance amounts on behalf of others mapping(address => mapping(address => uint96)) internal allowances; // Official record of token balances for each account mapping(address => uint96) internal balances; /// @notice A record of each accounts delegate mapping(address => address) public delegates; /// @notice A checkpoint for marking number of votes from a given block struct Checkpoint { uint32 fromBlock; uint96 votes; } /// @notice A record of votes checkpoints for each account, by index mapping(address => mapping(uint32 => Checkpoint)) public checkpoints; /// @notice The number of checkpoints for each account mapping(address => uint32) public numCheckpoints; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @notice The EIP-712 typehash for the delegation struct used by the contract bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); /// @notice The EIP-712 typehash for EIP-2612 permit bytes32 public constant PERMIT_TYPEHASH = keccak256( "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)" ); /// @notice A record of states for signing / validating signatures mapping(address => uint256) public nonces; /// @notice An event thats emitted when an account changes its delegate event DelegateChanged( address indexed delegator, address indexed fromDelegate, address indexed toDelegate ); /// @notice An event thats emitted when a delegate account's vote balance changes event DelegateVotesChanged( address indexed delegate, uint256 previousBalance, uint256 newBalance ); /// @notice The standard EIP-20 transfer event event Transfer(address indexed from, address indexed to, uint256 amount); /// @notice The standard EIP-20 approval event event Approval(address indexed owner, address indexed spender, uint256 amount); /** * @notice Construct a new token * @param account The initial account to grant all the tokens */ constructor(address account) { balances[account] = uint96(totalSupply); emit Transfer(address(0), account, totalSupply); } /* @notice Token name */ function name() public pure returns (string memory) { return NAME; } /* @notice Token symbol */ function symbol() public pure returns (string memory) { return SYMBOL; } /* @notice Token decimals */ function decimals() public pure returns (uint8) { return DECIMALS; } /* @notice domainSeparator */ // solhint-disable func-name-mixedcase function DOMAIN_SEPARATOR() public view returns (bytes32) { return keccak256( abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(NAME)), getChainId(), address(this)) ); } /** * @notice Get the number of tokens `spender` is approved to spend on behalf of `account` * @param account The address of the account holding the funds * @param spender The address of the account spending the funds * @return The number of tokens approved */ function allowance(address account, address spender) external view returns (uint256) { return allowances[account][spender]; } /** * @notice Approve `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param rawAmount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint256 rawAmount) external returns (bool) { _approve(msg.sender, spender, rawAmount); return true; } function _approve( address owner, address spender, uint256 rawAmount ) internal { uint96 amount; if (rawAmount == uint256(-1)) { amount = uint96(-1); } else { amount = safe96(rawAmount, "RadicleToken::approve: amount exceeds 96 bits"); } allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @notice Get the number of tokens held by the `account` * @param account The address of the account to get the balance of * @return The number of tokens held */ function balanceOf(address account) external view returns (uint256) { return balances[account]; } /** * @notice Transfer `amount` tokens from `msg.sender` to `dst` * @param dst The address of the destination account * @param rawAmount The number of tokens to transfer * @return Whether or not the transfer succeeded */ function transfer(address dst, uint256 rawAmount) external returns (bool) { uint96 amount = safe96(rawAmount, "RadicleToken::transfer: amount exceeds 96 bits"); _transferTokens(msg.sender, dst, amount); return true; } /** * @notice Transfer `amount` tokens from `src` to `dst` * @param src The address of the source account * @param dst The address of the destination account * @param rawAmount The number of tokens to transfer * @return Whether or not the transfer succeeded */ function transferFrom( address src, address dst, uint256 rawAmount ) external returns (bool) { address spender = msg.sender; uint96 spenderAllowance = allowances[src][spender]; uint96 amount = safe96(rawAmount, "RadicleToken::approve: amount exceeds 96 bits"); if (spender != src && spenderAllowance != uint96(-1)) { uint96 newAllowance = sub96( spenderAllowance, amount, "RadicleToken::transferFrom: transfer amount exceeds spender allowance" ); allowances[src][spender] = newAllowance; emit Approval(src, spender, newAllowance); } _transferTokens(src, dst, amount); return true; } /** * @notice Burn `rawAmount` tokens from `account` * @param account The address of the account to burn * @param rawAmount The number of tokens to burn */ function burnFrom(address account, uint256 rawAmount) public { require(account != address(0), "RadicleToken::burnFrom: cannot burn from the zero address"); uint96 amount = safe96(rawAmount, "RadicleToken::burnFrom: amount exceeds 96 bits"); address spender = msg.sender; uint96 spenderAllowance = allowances[account][spender]; if (spender != account && spenderAllowance != uint96(-1)) { uint96 newAllowance = sub96( spenderAllowance, amount, "RadicleToken::burnFrom: burn amount exceeds allowance" ); allowances[account][spender] = newAllowance; emit Approval(account, spender, newAllowance); } balances[account] = sub96( balances[account], amount, "RadicleToken::burnFrom: burn amount exceeds balance" ); emit Transfer(account, address(0), amount); _moveDelegates(delegates[account], address(0), amount); totalSupply -= rawAmount; } /** * @notice Delegate votes from `msg.sender` to `delegatee` * @param delegatee The address to delegate votes to */ function delegate(address delegatee) public { return _delegate(msg.sender, delegatee); } /** * @notice Delegates votes from signatory to `delegatee` * @param delegatee The address to delegate votes to * @param nonce The contract state required to match the signature * @param expiry 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 delegateBySig( address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s ) public { bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry)); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", DOMAIN_SEPARATOR(), structHash)); address signatory = ecrecover(digest, v, r, s); require(signatory != address(0), "RadicleToken::delegateBySig: invalid signature"); require(nonce == nonces[signatory]++, "RadicleToken::delegateBySig: invalid nonce"); require(block.timestamp <= expiry, "RadicleToken::delegateBySig: signature expired"); _delegate(signatory, delegatee); } /** * @notice Approves spender to spend on behalf of owner. * @param owner The signer of the permit * @param spender The address to approve * @param deadline The time at which the signature expires * @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 permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public { bytes32 structHash = keccak256( abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline) ); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", DOMAIN_SEPARATOR(), structHash)); require(owner == ecrecover(digest, v, r, s), "RadicleToken::permit: invalid signature"); require(owner != address(0), "RadicleToken::permit: invalid signature"); require(block.timestamp <= deadline, "RadicleToken::permit: signature expired"); _approve(owner, spender, value); } /** * @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 getCurrentVotes(address account) external view returns (uint96) { uint32 nCheckpoints = numCheckpoints[account]; return nCheckpoints > 0 ? 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 getPriorVotes(address account, uint256 blockNumber) public view returns (uint96) { require(blockNumber < block.number, "RadicleToken::getPriorVotes: not yet determined"); uint32 nCheckpoints = numCheckpoints[account]; if (nCheckpoints == 0) { return 0; } // First check most recent balance if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) { return checkpoints[account][nCheckpoints - 1].votes; } // Next check implicit zero balance if (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 = checkpoints[account][center]; if (cp.fromBlock == blockNumber) { return cp.votes; } else if (cp.fromBlock < blockNumber) { lower = center; } else { upper = center - 1; } } return checkpoints[account][lower].votes; } function _delegate(address delegator, address delegatee) internal { address currentDelegate = delegates[delegator]; uint96 delegatorBalance = balances[delegator]; delegates[delegator] = delegatee; emit DelegateChanged(delegator, currentDelegate, delegatee); _moveDelegates(currentDelegate, delegatee, delegatorBalance); } function _transferTokens( address src, address dst, uint96 amount ) internal { require( src != address(0), "RadicleToken::_transferTokens: cannot transfer from the zero address" ); require( dst != address(0), "RadicleToken::_transferTokens: cannot transfer to the zero address" ); balances[src] = sub96( balances[src], amount, "RadicleToken::_transferTokens: transfer amount exceeds balance" ); balances[dst] = add96( balances[dst], amount, "RadicleToken::_transferTokens: transfer amount overflows" ); emit Transfer(src, dst, amount); _moveDelegates(delegates[src], delegates[dst], amount); } function _moveDelegates( address srcRep, address dstRep, uint96 amount ) internal { if (srcRep != dstRep && amount > 0) { if (srcRep != address(0)) { uint32 srcRepNum = numCheckpoints[srcRep]; uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0; uint96 srcRepNew = sub96(srcRepOld, amount, "RadicleToken::_moveVotes: vote amount underflows"); _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew); } if (dstRep != address(0)) { uint32 dstRepNum = numCheckpoints[dstRep]; uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0; uint96 dstRepNew = add96(dstRepOld, amount, "RadicleToken::_moveVotes: vote amount overflows"); _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew); } } } function _writeCheckpoint( address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes ) internal { uint32 blockNumber = safe32(block.number, "RadicleToken::_writeCheckpoint: block number exceeds 32 bits"); if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) { checkpoints[delegatee][nCheckpoints - 1].votes = newVotes; } else { checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes); numCheckpoints[delegatee] = nCheckpoints + 1; } emit DelegateVotesChanged(delegatee, oldVotes, newVotes); } function safe32(uint256 n, string memory errorMessage) internal pure returns (uint32) { require(n < 2**32, errorMessage); return uint32(n); } function safe96(uint256 n, string memory errorMessage) internal pure returns (uint96) { require(n < 2**96, errorMessage); return uint96(n); } function add96( uint96 a, uint96 b, string memory errorMessage ) internal pure returns (uint96) { uint96 c = a + b; require(c >= a, errorMessage); return c; } function sub96( uint96 a, uint96 b, string memory errorMessage ) internal pure returns (uint96) { require(b <= a, errorMessage); return a - b; } function getChainId() internal pure returns (uint256) { uint256 chainId; // solhint-disable no-inline-assembly assembly { chainId := chainid() } return chainId; } }
< // SPDX-License-Identifier: GPL-3.0-only
// Copyright 2020 Compound Labs, Inc.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// 3. Neither the name of the copyright holder nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

pragma solidity ^0.7.5;
pragma experimental ABIEncoderV2;

contract RadicleToken {
    /// @notice EIP-20 token name for this token
    string public constant NAME = "Radicle";

    /// @notice EIP-20 token symbol for this token
    string public constant SYMBOL = "RAD";

    /// @notice EIP-20 token decimals for this token
    uint8 public constant DECIMALS = 18;

    /// @notice Total number of tokens in circulation
    uint256 public totalSupply = 100000000e18; // 100 million tokens

    // Allowance amounts on behalf of others
    mapping(address => mapping(address => uint96)) internal allowances;

    // Official record of token balances for each account
    mapping(address => uint96) internal balances;

    /// @notice A record of each accounts delegate
    mapping(address => address) public delegates;

    /// @notice A checkpoint for marking number of votes from a given block
    struct Checkpoint {
        uint32 fromBlock;
        uint96 votes;
    }

    /// @notice A record of votes checkpoints for each account, by index
    mapping(address => mapping(uint32 => Checkpoint)) public checkpoints;

    /// @notice The number of checkpoints for each account
    mapping(address => uint32) public numCheckpoints;

    /// @notice The EIP-712 typehash for the contract's domain
    bytes32 public constant DOMAIN_TYPEHASH =
        keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");

    /// @notice The EIP-712 typehash for the delegation struct used by the contract
    bytes32 public constant DELEGATION_TYPEHASH =
        keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");

    /// @notice The EIP-712 typehash for EIP-2612 permit
    bytes32 public constant PERMIT_TYPEHASH =
        keccak256(
            "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
        );
    /// @notice A record of states for signing / validating signatures
    mapping(address => uint256) public nonces;

    /// @notice An event thats emitted when an account changes its delegate
    event DelegateChanged(
        address indexed delegator,
        address indexed fromDelegate,
        address indexed toDelegate
    );

    /// @notice An event thats emitted when a delegate account's vote balance changes
    event DelegateVotesChanged(
        address indexed delegate,
        uint256 previousBalance,
        uint256 newBalance
    );

    /// @notice The standard EIP-20 transfer event
    event Transfer(address indexed from, address indexed to, uint256 amount);

    /// @notice The standard EIP-20 approval event
    event Approval(address indexed owner, address indexed spender, uint256 amount);

    /**
     * @notice Construct a new token
     * @param account The initial account to grant all the tokens
     */
    constructor(address account) {
        balances[account] = uint96(totalSupply);
        emit Transfer(address(0), account, totalSupply);
    }

    /* @notice Token name */
    function name() public pure returns (string memory) {
        return NAME;
    }

    /* @notice Token symbol */
    function symbol() public pure returns (string memory) {
        return SYMBOL;
    }

    /* @notice Token decimals */
    function decimals() public pure returns (uint8) {
        return DECIMALS;
    }

    /* @notice domainSeparator */
    // solhint-disable func-name-mixedcase
    function DOMAIN_SEPARATOR() public view returns (bytes32) {
        return
            keccak256(
                abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(NAME)), getChainId(), address(this))
            );
    }

    /**
     * @notice Get the number of tokens `spender` is approved to spend on behalf of `account`
     * @param account The address of the account holding the funds
     * @param spender The address of the account spending the funds
     * @return The number of tokens approved
     */
    function allowance(address account, address spender) external view returns (uint256) {
        return allowances[account][spender];
    }

    /**
     * @notice Approve `spender` to transfer up to `amount` from `src`
     * @dev This will overwrite the approval amount for `spender`
     *  and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
     * @param spender The address of the account which may transfer tokens
     * @param rawAmount The number of tokens that are approved (2^256-1 means infinite)
     * @return Whether or not the approval succeeded
     */
    function approve(address spender, uint256 rawAmount) external returns (bool) {
        _approve(msg.sender, spender, rawAmount);
        return true;
    }

    function _approve(
        address owner,
        address spender,
        uint256 rawAmount
    ) internal {
        uint96 amount;
        if (rawAmount == uint256(-1)) {
            amount = uint96(-1);
        } else {
            amount = safe96(rawAmount, "RadicleToken::approve: amount exceeds 96 bits");
        }

        allowances[owner][spender] = amount;

        emit Approval(owner, spender, amount);
    }

    /**
     * @notice Get the number of tokens held by the `account`
     * @param account The address of the account to get the balance of
     * @return The number of tokens held
     */
    function balanceOf(address account) external view returns (uint256) {
        return balances[account];
    }

    /**
     * @notice Transfer `amount` tokens from `msg.sender` to `dst`
     * @param dst The address of the destination account
     * @param rawAmount The number of tokens to transfer
     * @return Whether or not the transfer succeeded
     */
    function transfer(address dst, uint256 rawAmount) external returns (bool) {
        uint96 amount = safe96(rawAmount, "RadicleToken::transfer: amount exceeds 96 bits");
        _transferTokens(msg.sender, dst, amount);
        return true;
    }

    /**
     * @notice Transfer `amount` tokens from `src` to `dst`
     * @param src The address of the source account
     * @param dst The address of the destination account
     * @param rawAmount The number of tokens to transfer
     * @return Whether or not the transfer succeeded
     */
    function transferFrom(
        address src,
        address dst,
        uint256 rawAmount
    ) external returns (bool) {
        address spender = msg.sender;
        uint96 spenderAllowance = allowances[src][spender];
        uint96 amount = safe96(rawAmount, "RadicleToken::approve: amount exceeds 96 bits");

        if (spender != src && spenderAllowance != uint96(-1)) {
            uint96 newAllowance =
                sub96(
                    spenderAllowance,
                    amount,
                    "RadicleToken::transferFrom: transfer amount exceeds spender allowance"
                );
            allowances[src][spender] = newAllowance;

            emit Approval(src, spender, newAllowance);
        }

        _transferTokens(src, dst, amount);
        return true;
    }

    /**
     * @notice Burn `rawAmount` tokens from `account`
     * @param account The address of the account to burn
     * @param rawAmount The number of tokens to burn
     */
    function burnFrom(address account, uint256 rawAmount) public {
        require(account != address(0), "RadicleToken::burnFrom: cannot burn from the zero address");
        uint96 amount = safe96(rawAmount, "RadicleToken::burnFrom: amount exceeds 96 bits");

        address spender = msg.sender;
        uint96 spenderAllowance = allowances[account][spender];
        if (spender != account && spenderAllowance != uint96(-1)) {
            uint96 newAllowance =
                sub96(
                    spenderAllowance,
                    amount,
                    "RadicleToken::burnFrom: burn amount exceeds allowance"
                );
            allowances[account][spender] = newAllowance;
            emit Approval(account, spender, newAllowance);
        }

        balances[account] = sub96(
            balances[account],
            amount,
            "RadicleToken::burnFrom: burn amount exceeds balance"
        );
        emit Transfer(account, address(0), amount);

        _moveDelegates(delegates[account], address(0), amount);

        totalSupply -= rawAmount;
    }

    /**
     * @notice Delegate votes from `msg.sender` to `delegatee`
     * @param delegatee The address to delegate votes to
     */
    function delegate(address delegatee) public {
        return _delegate(msg.sender, delegatee);
    }

    /**
     * @notice Delegates votes from signatory to `delegatee`
     * @param delegatee The address to delegate votes to
     * @param nonce The contract state required to match the signature
     * @param expiry 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 delegateBySig(
        address delegatee,
        uint256 nonce,
        uint256 expiry,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public {
        bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry));
        bytes32 digest = keccak256(abi.encodePacked("\x19\x01", DOMAIN_SEPARATOR(), structHash));
        address signatory = ecrecover(digest, v, r, s);
        require(signatory != address(0), "RadicleToken::delegateBySig: invalid signature");
        require(nonce == nonces[signatory]++, "RadicleToken::delegateBySig: invalid nonce");
        require(block.timestamp <= expiry, "RadicleToken::delegateBySig: signature expired");
        _delegate(signatory, delegatee);
    }

    /**
     * @notice Approves spender to spend on behalf of owner.
     * @param owner The signer of the permit
     * @param spender The address to approve
     * @param deadline The time at which the signature expires
     * @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 permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public {
        bytes32 structHash =
            keccak256(
                abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline)
            );
        bytes32 digest = keccak256(abi.encodePacked("\x19\x01", DOMAIN_SEPARATOR(), structHash));
        require(owner == ecrecover(digest, v, r, s), "RadicleToken::permit: invalid signature");
        require(owner != address(0), "RadicleToken::permit: invalid signature");
        require(block.timestamp <= deadline, "RadicleToken::permit: signature expired");
        _approve(owner, spender, value);
    }

    /**
     * @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 getCurrentVotes(address account) external view returns (uint96) {
        uint32 nCheckpoints = numCheckpoints[account];
        return nCheckpoints > 0 ? 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 getPriorVotes(address account, uint256 blockNumber) public view returns (uint96) {
        require(blockNumber < block.number, "RadicleToken::getPriorVotes: not yet determined");

        uint32 nCheckpoints = numCheckpoints[account];
        if (nCheckpoints == 0) {
            return 0;
        }

        // First check most recent balance
        if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {
            return checkpoints[account][nCheckpoints - 1].votes;
        }

        // Next check implicit zero balance
        if (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 = checkpoints[account][center];
            if (cp.fromBlock == blockNumber) {
                return cp.votes;
            } else if (cp.fromBlock < blockNumber) {
                lower = center;
            } else {
                upper = center - 1;
            }
        }
        return checkpoints[account][lower].votes;
    }

    function _delegate(address delegator, address delegatee) internal {
        address currentDelegate = delegates[delegator];
        uint96 delegatorBalance = balances[delegator];
        delegates[delegator] = delegatee;

        emit DelegateChanged(delegator, currentDelegate, delegatee);

        _moveDelegates(currentDelegate, delegatee, delegatorBalance);
    }

    function _transferTokens(
        address src,
        address dst,
        uint96 amount
    ) internal {
        require(
            src != address(0),
            "RadicleToken::_transferTokens: cannot transfer from the zero address"
        );
        require(
            dst != address(0),
            "RadicleToken::_transferTokens: cannot transfer to the zero address"
        );

        balances[src] = sub96(
            balances[src],
            amount,
            "RadicleToken::_transferTokens: transfer amount exceeds balance"
        );
        balances[dst] = add96(
            balances[dst],
            amount,
            "RadicleToken::_transferTokens: transfer amount overflows"
        );
        emit Transfer(src, dst, amount);

        _moveDelegates(delegates[src], delegates[dst], amount);
    }

    function _moveDelegates(
        address srcRep,
        address dstRep,
        uint96 amount
    ) internal {
        if (srcRep != dstRep && amount > 0) {
            if (srcRep != address(0)) {
                uint32 srcRepNum = numCheckpoints[srcRep];
                uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0;
                uint96 srcRepNew =
                    sub96(srcRepOld, amount, "RadicleToken::_moveVotes: vote amount underflows");
                _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
            }

            if (dstRep != address(0)) {
                uint32 dstRepNum = numCheckpoints[dstRep];
                uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0;
                uint96 dstRepNew =
                    add96(dstRepOld, amount, "RadicleToken::_moveVotes: vote amount overflows");
                _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
            }
        }
    }

    function _writeCheckpoint(
        address delegatee,
        uint32 nCheckpoints,
        uint96 oldVotes,
        uint96 newVotes
    ) internal {
        uint32 blockNumber =
            safe32(block.number, "RadicleToken::_writeCheckpoint: block number exceeds 32 bits");

        if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) {
            checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;
        } else {
            checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes);
            numCheckpoints[delegatee] = nCheckpoints + 1;
        }

        emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
    }

    function safe32(uint256 n, string memory errorMessage) internal pure returns (uint32) {
        require(n < 2**32, errorMessage);
        return uint32(n);
    }

    function safe96(uint256 n, string memory errorMessage) internal pure returns (uint96) {
        require(n < 2**96, errorMessage);
        return uint96(n);
    }

    function add96(
        uint96 a,
        uint96 b,
        string memory errorMessage
    ) internal pure returns (uint96) {
        uint96 c = a + b;
        require(c >= a, errorMessage);
        return c;
    }

    function sub96(
        uint96 a,
        uint96 b,
        string memory errorMessage
    ) internal pure returns (uint96) {
        require(b <= a, errorMessage);
        return a - b;
    }

    function getChainId() internal pure returns (uint256) {
        uint256 chainId;
        // solhint-disable no-inline-assembly
        assembly {
            chainId := chainid()
        }
        return chainId;
    }
} < 

RadicleToken ABI

[{"inputs":[{"internalType":"address","name":"account","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"fromDelegate","type":"address"},{"indexed":true,"internalType":"address","name":"toDelegate","type":"address"}],"name":"DelegateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegate","type":"address"},{"indexed":false,"internalType":"uint256","name":"previousBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newBalance","type":"uint256"}],"name":"DelegateVotesChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DECIMALS","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DELEGATION_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NAME","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SYMBOL","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"rawAmount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"rawAmount","type":"uint256"}],"name":"burnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint32","name":"","type":"uint32"}],"name":"checkpoints","outputs":[{"internalType":"uint32","name":"fromBlock","type":"uint32"},{"internalType":"uint96","name":"votes","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"}],"name":"delegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"delegateBySig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"delegates","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getCurrentVotes","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"getPriorVotes","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"numCheckpoints","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","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":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"rawAmount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"src","type":"address"},{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"rawAmount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]
[{"inputs":[{"internalType":"address","name":"account","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"fromDelegate","type":"address"},{"indexed":true,"internalType":"address","name":"toDelegate","type":"address"}],"name":"DelegateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegate","type":"address"},{"indexed":false,"internalType":"uint256","name":"previousBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newBalance","type":"uint256"}],"name":"DelegateVotesChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DECIMALS","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DELEGATION_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NAME","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SYMBOL","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"rawAmount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"rawAmount","type":"uint256"}],"name":"burnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint32","name":"","type":"uint32"}],"name":"checkpoints","outputs":[{"internalType":"uint32","name":"fromBlock","type":"uint32"},{"internalType":"uint96","name":"votes","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"}],"name":"delegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"delegateBySig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"delegates","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getCurrentVotes","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"getPriorVotes","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"numCheckpoints","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","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":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"rawAmount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"src","type":"address"},{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"rawAmount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]

RadicleToken Bytecode

60806040526a52b7d2dcc80cd2e40000006000553480156200002057600080fd5b5060405162002028380380620020288339810160408190526200004391620000c0565b600080546001600160a01b0383168083526002602052604080842080546001600160601b0319166001600160601b0390941693909317909255825491519092917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91620000b19190620000f0565b60405180910390a350620000f9565b600060208284031215620000d2578081fd5b81516001600160a01b0381168114620000e9578182fd5b9392505050565b90815260200190565b611f1f80620001096000396000f3fe608060405234801561001057600080fd5b506004361061018e5760003560e01c8063782d6fe1116100de578063b4b5ea5711610097578063dd62ed3e11610071578063dd62ed3e14610338578063e7a324dc1461034b578063f1127ed814610353578063f76f8d78146103745761018e565b8063b4b5ea57146102ff578063c3cda52014610312578063d505accf146103255761018e565b8063782d6fe11461029657806379cc6790146102b65780637ecebe00146102c957806395d89b41146102dc578063a3f4df7e146102e4578063a9059cbb146102ec5761018e565b806330adf81f1161014b578063587cde1e11610125578063587cde1e1461022e5780635c19a95c1461024e5780636fcfff451461026357806370a08231146102835761018e565b806330adf81f14610216578063313ce5671461021e5780633644e515146102265761018e565b806306fdde0314610193578063095ea7b3146101b157806318160ddd146101d157806320606b70146101e657806323b872dd146101ee5780632e0f262514610201575b600080fd5b61019b61037c565b6040516101a891906118f1565b60405180910390f35b6101c46101bf366004611756565b61039d565b6040516101a89190611843565b6101d96103b4565b6040516101a8919061184e565b6101d96103ba565b6101c46101fc3660046116b2565b6103de565b610209610525565b6040516101a89190611c66565b6101d961052a565b61020961054e565b6101d9610553565b61024161023c366004611666565b6105ed565b6040516101a8919061182f565b61026161025c366004611666565b610608565b005b610276610271366004611666565b610615565b6040516101a89190611c36565b6101d9610291366004611666565b61062d565b6102a96102a4366004611756565b610655565b6040516101a89190611c74565b6102616102c4366004611756565b610867565b6101d96102d7366004611666565b610a97565b61019b610aa9565b61019b610ac6565b6101c46102fa366004611756565b610ae9565b6102a961030d366004611666565b610b25565b61026161032036600461177f565b610b96565b6102616103333660046116ed565b610d09565b6101d9610346366004611680565b610e80565b6101d9610eb4565b6103666103613660046117d6565b610ed8565b6040516101a8929190611c47565b61019b610f0d565b60408051808201909152600781526652616469636c6560c81b602082015290565b60006103aa338484610f2c565b5060015b92915050565b60005481565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b6001600160a01b03831660009081526001602090815260408083203380855290835281842054825160608101909352602d80845291936001600160601b039091169285926104369288929190611de290830139610fe5565b9050866001600160a01b0316836001600160a01b03161415801561046357506001600160601b0382811614155b1561050d57600061048d8383604051806080016040528060458152602001611e4460459139611014565b6001600160a01b038981166000818152600160209081526040808320948a16808452949091529081902080546001600160601b0319166001600160601b0386161790555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610503908590611c74565b60405180910390a3505b610518878783611053565b5060019695505050505050565b601281565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601290565b60408051808201909152600781526652616469636c6560c81b60209091015260007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8667f5a723f70d68b91cd135c2a2a54c667f2b03f218c7e3eb3a7b4bc115ae7971fbf6105be6111fe565b306040516020016105d294939291906118af565b60405160208183030381529060405280519060200120905090565b6003602052600090815260409020546001600160a01b031681565b6106123382611202565b50565b60056020526000908152604090205463ffffffff1681565b6001600160a01b0381166000908152600260205260409020546001600160601b03165b919050565b600043821061067f5760405162461bcd60e51b815260040161067690611be7565b60405180910390fd5b6001600160a01b03831660009081526005602052604090205463ffffffff16806106ad5760009150506103ae565b6001600160a01b038416600090815260046020908152604080832063ffffffff600019860181168552925290912054168310610729576001600160a01b03841660009081526004602090815260408083206000199490940163ffffffff1683529290522054600160201b90046001600160601b031690506103ae565b6001600160a01b038416600090815260046020908152604080832083805290915290205463ffffffff168310156107645760009150506103ae565b600060001982015b8163ffffffff168163ffffffff161115610822576000600263ffffffff848403166001600160a01b038916600090815260046020908152604080832094909304860363ffffffff818116845294825291839020835180850190945254938416808452600160201b9094046001600160601b0316908301529250908714156107fd576020015194506103ae9350505050565b805163ffffffff168711156108145781935061081b565b6001820392505b505061076c565b506001600160a01b038516600090815260046020908152604080832063ffffffff909416835292905220546001600160601b03600160201b9091041691505092915050565b6001600160a01b03821661088d5760405162461bcd60e51b8152600401610676906119fa565b60006108b1826040518060600160405280602e8152602001611d49602e9139610fe5565b6001600160a01b038416600081815260016020908152604080832033808552925290912054929350916001600160601b03169082148015906108fc57506001600160601b0381811614155b156109a65760006109268285604051806060016040528060358152602001611e0f60359139611014565b6001600160a01b038781166000818152600160209081526040808320948916808452949091529081902080546001600160601b0319166001600160601b0386161790555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061099c908590611c74565b60405180910390a3505b6001600160a01b0385166000908152600260209081526040918290205482516060810190935260338084526109f1936001600160601b039092169287929190611eb790830139611014565b6001600160a01b03861660008181526002602052604080822080546001600160601b0319166001600160601b03959095169490941790935591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610a58908790611c74565b60405180910390a36001600160a01b03808616600090815260036020526040812054610a869216908561128c565b505060008054929092039091555050565b60066020526000908152604090205481565b60408051808201909152600381526214905160ea1b602082015290565b6040518060400160405280600781526020016652616469636c6560c81b81525081565b600080610b0e836040518060600160405280602e8152602001611e89602e9139610fe5565b9050610b1b338583611053565b5060019392505050565b6001600160a01b03811660009081526005602052604081205463ffffffff1680610b50576000610b8f565b6001600160a01b0383166000908152600460209081526040808320600019850163ffffffff168452909152902054600160201b90046001600160601b03165b9392505050565b60007fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf878787604051602001610bcf949392919061188b565b6040516020818303038152906040528051906020012090506000610bf1610553565b82604051602001610c03929190611814565b604051602081830303815290604052805190602001209050600060018287878760405160008152602001604052604051610c4094939291906118d3565b6020604051602081039080840390855afa158015610c62573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610c955760405162461bcd60e51b8152600401610676906119ac565b6001600160a01b03811660009081526006602052604090208054600181019091558814610cd45760405162461bcd60e51b815260040161067690611ac1565b86421115610cf45760405162461bcd60e51b815260040161067690611b0b565b610cfe818a611202565b505050505050505050565b6001600160a01b03871660009081526006602090815260408083208054600181019091559051610d64927f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9928c928c928c92918c9101611857565b6040516020818303038152906040528051906020012090506000610d86610553565b82604051602001610d98929190611814565b60405160208183030381529060405280519060200120905060018186868660405160008152602001604052604051610dd394939291906118d3565b6020604051602081039080840390855afa158015610df5573d6000803e3d6000fd5b505050602060405103516001600160a01b0316896001600160a01b031614610e2f5760405162461bcd60e51b815260040161067690611b59565b6001600160a01b038916610e555760405162461bcd60e51b815260040161067690611b59565b85421115610e755760405162461bcd60e51b815260040161067690611ba0565b610cfe898989610f2c565b6001600160a01b0391821660009081526001602090815260408083209390941682529190915220546001600160601b031690565b7fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf81565b600460209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160601b031682565b6040518060400160405280600381526020016214905160ea1b81525081565b6000600019821415610f415750600019610f66565b610f63826040518060600160405280602d8152602001611de2602d9139610fe5565b90505b6001600160a01b038481166000818152600160209081526040808320948816808452949091529081902080546001600160601b0319166001600160601b038616179055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610fd7908590611c74565b60405180910390a350505050565b600081600160601b841061100c5760405162461bcd60e51b815260040161067691906118f1565b509192915050565b6000836001600160601b0316836001600160601b03161115829061104b5760405162461bcd60e51b815260040161067691906118f1565b505050900390565b6001600160a01b0383166110795760405162461bcd60e51b815260040161067690611a57565b6001600160a01b03821661109f5760405162461bcd60e51b815260040161067690611944565b6001600160a01b03831660009081526002602090815260409182902054825160608101909352603e8084526110ea936001600160601b039092169285929190611d0b90830139611014565b6001600160a01b03848116600090815260026020908152604080832080546001600160601b0319166001600160601b039687161790559286168252908290205482516060810190935260388084526111529491909116928592909190611ca390830139611426565b6001600160a01b038381166000818152600260205260409081902080546001600160601b0319166001600160601b0395909516949094179093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906111bf908590611c74565b60405180910390a36001600160a01b038084166000908152600360205260408082205485841683529120546111f99291821691168361128c565b505050565b4690565b6001600160a01b03808316600081815260036020818152604080842080546002845282862054949093528787166001600160a01b031984168117909155905191909516946001600160601b039092169391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a461128682848361128c565b50505050565b816001600160a01b0316836001600160a01b0316141580156112b757506000816001600160601b0316115b156111f9576001600160a01b0383161561136f576001600160a01b03831660009081526005602052604081205463ffffffff1690816112f7576000611336565b6001600160a01b0385166000908152600460209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b9050600061135d8285604051806060016040528060308152602001611cdb60309139611014565b905061136b86848484611462565b5050505b6001600160a01b038216156111f9576001600160a01b03821660009081526005602052604081205463ffffffff1690816113aa5760006113e9565b6001600160a01b0384166000908152600460209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b9050600061141082856040518060600160405280602f8152602001611db3602f9139611426565b905061141e85848484611462565b505050505050565b6000838301826001600160601b0380871690831610156114595760405162461bcd60e51b815260040161067691906118f1565b50949350505050565b6000611486436040518060600160405280603c8152602001611d77603c9139611617565b905060008463ffffffff161180156114cf57506001600160a01b038516600090815260046020908152604080832063ffffffff6000198901811685529252909120548282169116145b1561152e576001600160a01b0385166000908152600460209081526040808320600019880163ffffffff168452909152902080546fffffffffffffffffffffffff000000001916600160201b6001600160601b038516021790556115cd565b60408051808201825263ffffffff80841682526001600160601b0380861660208085019182526001600160a01b038b166000818152600483528781208c871682528352878120965187549451909516600160201b026fffffffffffffffffffffffff000000001995871663ffffffff19958616179590951694909417909555938252600590935292909220805460018801909316929091169190911790555b846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248484604051611608929190611c88565b60405180910390a25050505050565b600081600160201b841061100c5760405162461bcd60e51b815260040161067691906118f1565b80356001600160a01b038116811461065057600080fd5b803560ff8116811461065057600080fd5b600060208284031215611677578081fd5b610b8f8261163e565b60008060408385031215611692578081fd5b61169b8361163e565b91506116a96020840161163e565b90509250929050565b6000806000606084860312156116c6578081fd5b6116cf8461163e565b92506116dd6020850161163e565b9150604084013590509250925092565b600080600080600080600060e0888a031215611707578283fd5b6117108861163e565b965061171e6020890161163e565b9550604088013594506060880135935061173a60808901611655565b925060a0880135915060c0880135905092959891949750929550565b60008060408385031215611768578182fd5b6117718361163e565b946020939093013593505050565b60008060008060008060c08789031215611797578182fd5b6117a08761163e565b955060208701359450604087013593506117bc60608801611655565b92506080870135915060a087013590509295509295509295565b600080604083850312156117e8578182fd5b6117f18361163e565b9150602083013563ffffffff81168114611809578182fd5b809150509250929050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b901515815260200190565b90815260200190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b9384526001600160a01b039290921660208401526040830152606082015260800190565b938452602084019290925260408301526001600160a01b0316606082015260800190565b93845260ff9290921660208401526040830152606082015260800190565b6000602080835283518082850152825b8181101561191d57858101830151858201604001528201611901565b8181111561192e5783604083870101525b50601f01601f1916929092016040019392505050565b60208082526042908201527f52616469636c65546f6b656e3a3a5f7472616e73666572546f6b656e733a206360408201527f616e6e6f74207472616e7366657220746f20746865207a65726f206164647265606082015261737360f01b608082015260a00190565b6020808252602e908201527f52616469636c65546f6b656e3a3a64656c656761746542795369673a20696e7660408201526d616c6964207369676e617475726560901b606082015260800190565b60208082526039908201527f52616469636c65546f6b656e3a3a6275726e46726f6d3a2063616e6e6f74206260408201527f75726e2066726f6d20746865207a65726f206164647265737300000000000000606082015260800190565b60208082526044908201527f52616469636c65546f6b656e3a3a5f7472616e73666572546f6b656e733a206360408201527f616e6e6f74207472616e736665722066726f6d20746865207a65726f206164646060820152637265737360e01b608082015260a00190565b6020808252602a908201527f52616469636c65546f6b656e3a3a64656c656761746542795369673a20696e76604082015269616c6964206e6f6e636560b01b606082015260800190565b6020808252602e908201527f52616469636c65546f6b656e3a3a64656c656761746542795369673a2073696760408201526d1b985d1d5c9948195e1c1a5c995960921b606082015260800190565b60208082526027908201527f52616469636c65546f6b656e3a3a7065726d69743a20696e76616c6964207369604082015266676e617475726560c81b606082015260800190565b60208082526027908201527f52616469636c65546f6b656e3a3a7065726d69743a207369676e617475726520604082015266195e1c1a5c995960ca1b606082015260800190565b6020808252602f908201527f52616469636c65546f6b656e3a3a6765745072696f72566f7465733a206e6f7460408201526e081e595d0819195d195c9b5a5b9959608a1b606082015260800190565b63ffffffff91909116815260200190565b63ffffffff9290921682526001600160601b0316602082015260400190565b60ff91909116815260200190565b6001600160601b0391909116815260200190565b6001600160601b039283168152911660208201526040019056fe52616469636c65546f6b656e3a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f777352616469636c65546f6b656e3a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f777352616469636c65546f6b656e3a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e636552616469636c65546f6b656e3a3a6275726e46726f6d3a20616d6f756e742065786365656473203936206269747352616469636c65546f6b656e3a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d6265722065786365656473203332206269747352616469636c65546f6b656e3a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f777352616469636c65546f6b656e3a3a617070726f76653a20616d6f756e742065786365656473203936206269747352616469636c65546f6b656e3a3a6275726e46726f6d3a206275726e20616d6f756e74206578636565647320616c6c6f77616e636552616469636c65546f6b656e3a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e636552616469636c65546f6b656e3a3a7472616e736665723a20616d6f756e742065786365656473203936206269747352616469636c65546f6b656e3a3a6275726e46726f6d3a206275726e20616d6f756e7420657863656564732062616c616e6365a26469706673582212201e9fe306fe53be7e6d22e3455d0139cd5e870299dbf219ba35fee5276c0dddd264736f6c634300070600330000000000000000000000006838f63899728816f602b3e9bf73952e2bd6dc35
60806040526a52b7d2dcc80cd2e40000006000553480156200002057600080fd5b5060405162002028380380620020288339810160408190526200004391620000c0565b600080546001600160a01b0383168083526002602052604080842080546001600160601b0319166001600160601b0390941693909317909255825491519092917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91620000b19190620000f0565b60405180910390a350620000f9565b600060208284031215620000d2578081fd5b81516001600160a01b0381168114620000e9578182fd5b9392505050565b90815260200190565b611f1f80620001096000396000f3fe608060405234801561001057600080fd5b506004361061018e5760003560e01c8063782d6fe1116100de578063b4b5ea5711610097578063dd62ed3e11610071578063dd62ed3e14610338578063e7a324dc1461034b578063f1127ed814610353578063f76f8d78146103745761018e565b8063b4b5ea57146102ff578063c3cda52014610312578063d505accf146103255761018e565b8063782d6fe11461029657806379cc6790146102b65780637ecebe00146102c957806395d89b41146102dc578063a3f4df7e146102e4578063a9059cbb146102ec5761018e565b806330adf81f1161014b578063587cde1e11610125578063587cde1e1461022e5780635c19a95c1461024e5780636fcfff451461026357806370a08231146102835761018e565b806330adf81f14610216578063313ce5671461021e5780633644e515146102265761018e565b806306fdde0314610193578063095ea7b3146101b157806318160ddd146101d157806320606b70146101e657806323b872dd146101ee5780632e0f262514610201575b600080fd5b61019b61037c565b6040516101a891906118f1565b60405180910390f35b6101c46101bf366004611756565b61039d565b6040516101a89190611843565b6101d96103b4565b6040516101a8919061184e565b6101d96103ba565b6101c46101fc3660046116b2565b6103de565b610209610525565b6040516101a89190611c66565b6101d961052a565b61020961054e565b6101d9610553565b61024161023c366004611666565b6105ed565b6040516101a8919061182f565b61026161025c366004611666565b610608565b005b610276610271366004611666565b610615565b6040516101a89190611c36565b6101d9610291366004611666565b61062d565b6102a96102a4366004611756565b610655565b6040516101a89190611c74565b6102616102c4366004611756565b610867565b6101d96102d7366004611666565b610a97565b61019b610aa9565b61019b610ac6565b6101c46102fa366004611756565b610ae9565b6102a961030d366004611666565b610b25565b61026161032036600461177f565b610b96565b6102616103333660046116ed565b610d09565b6101d9610346366004611680565b610e80565b6101d9610eb4565b6103666103613660046117d6565b610ed8565b6040516101a8929190611c47565b61019b610f0d565b60408051808201909152600781526652616469636c6560c81b602082015290565b60006103aa338484610f2c565b5060015b92915050565b60005481565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b6001600160a01b03831660009081526001602090815260408083203380855290835281842054825160608101909352602d80845291936001600160601b039091169285926104369288929190611de290830139610fe5565b9050866001600160a01b0316836001600160a01b03161415801561046357506001600160601b0382811614155b1561050d57600061048d8383604051806080016040528060458152602001611e4460459139611014565b6001600160a01b038981166000818152600160209081526040808320948a16808452949091529081902080546001600160601b0319166001600160601b0386161790555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610503908590611c74565b60405180910390a3505b610518878783611053565b5060019695505050505050565b601281565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601290565b60408051808201909152600781526652616469636c6560c81b60209091015260007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8667f5a723f70d68b91cd135c2a2a54c667f2b03f218c7e3eb3a7b4bc115ae7971fbf6105be6111fe565b306040516020016105d294939291906118af565b60405160208183030381529060405280519060200120905090565b6003602052600090815260409020546001600160a01b031681565b6106123382611202565b50565b60056020526000908152604090205463ffffffff1681565b6001600160a01b0381166000908152600260205260409020546001600160601b03165b919050565b600043821061067f5760405162461bcd60e51b815260040161067690611be7565b60405180910390fd5b6001600160a01b03831660009081526005602052604090205463ffffffff16806106ad5760009150506103ae565b6001600160a01b038416600090815260046020908152604080832063ffffffff600019860181168552925290912054168310610729576001600160a01b03841660009081526004602090815260408083206000199490940163ffffffff1683529290522054600160201b90046001600160601b031690506103ae565b6001600160a01b038416600090815260046020908152604080832083805290915290205463ffffffff168310156107645760009150506103ae565b600060001982015b8163ffffffff168163ffffffff161115610822576000600263ffffffff848403166001600160a01b038916600090815260046020908152604080832094909304860363ffffffff818116845294825291839020835180850190945254938416808452600160201b9094046001600160601b0316908301529250908714156107fd576020015194506103ae9350505050565b805163ffffffff168711156108145781935061081b565b6001820392505b505061076c565b506001600160a01b038516600090815260046020908152604080832063ffffffff909416835292905220546001600160601b03600160201b9091041691505092915050565b6001600160a01b03821661088d5760405162461bcd60e51b8152600401610676906119fa565b60006108b1826040518060600160405280602e8152602001611d49602e9139610fe5565b6001600160a01b038416600081815260016020908152604080832033808552925290912054929350916001600160601b03169082148015906108fc57506001600160601b0381811614155b156109a65760006109268285604051806060016040528060358152602001611e0f60359139611014565b6001600160a01b038781166000818152600160209081526040808320948916808452949091529081902080546001600160601b0319166001600160601b0386161790555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061099c908590611c74565b60405180910390a3505b6001600160a01b0385166000908152600260209081526040918290205482516060810190935260338084526109f1936001600160601b039092169287929190611eb790830139611014565b6001600160a01b03861660008181526002602052604080822080546001600160601b0319166001600160601b03959095169490941790935591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610a58908790611c74565b60405180910390a36001600160a01b03808616600090815260036020526040812054610a869216908561128c565b505060008054929092039091555050565b60066020526000908152604090205481565b60408051808201909152600381526214905160ea1b602082015290565b6040518060400160405280600781526020016652616469636c6560c81b81525081565b600080610b0e836040518060600160405280602e8152602001611e89602e9139610fe5565b9050610b1b338583611053565b5060019392505050565b6001600160a01b03811660009081526005602052604081205463ffffffff1680610b50576000610b8f565b6001600160a01b0383166000908152600460209081526040808320600019850163ffffffff168452909152902054600160201b90046001600160601b03165b9392505050565b60007fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf878787604051602001610bcf949392919061188b565b6040516020818303038152906040528051906020012090506000610bf1610553565b82604051602001610c03929190611814565b604051602081830303815290604052805190602001209050600060018287878760405160008152602001604052604051610c4094939291906118d3565b6020604051602081039080840390855afa158015610c62573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610c955760405162461bcd60e51b8152600401610676906119ac565b6001600160a01b03811660009081526006602052604090208054600181019091558814610cd45760405162461bcd60e51b815260040161067690611ac1565b86421115610cf45760405162461bcd60e51b815260040161067690611b0b565b610cfe818a611202565b505050505050505050565b6001600160a01b03871660009081526006602090815260408083208054600181019091559051610d64927f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9928c928c928c92918c9101611857565b6040516020818303038152906040528051906020012090506000610d86610553565b82604051602001610d98929190611814565b60405160208183030381529060405280519060200120905060018186868660405160008152602001604052604051610dd394939291906118d3565b6020604051602081039080840390855afa158015610df5573d6000803e3d6000fd5b505050602060405103516001600160a01b0316896001600160a01b031614610e2f5760405162461bcd60e51b815260040161067690611b59565b6001600160a01b038916610e555760405162461bcd60e51b815260040161067690611b59565b85421115610e755760405162461bcd60e51b815260040161067690611ba0565b610cfe898989610f2c565b6001600160a01b0391821660009081526001602090815260408083209390941682529190915220546001600160601b031690565b7fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf81565b600460209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160601b031682565b6040518060400160405280600381526020016214905160ea1b81525081565b6000600019821415610f415750600019610f66565b610f63826040518060600160405280602d8152602001611de2602d9139610fe5565b90505b6001600160a01b038481166000818152600160209081526040808320948816808452949091529081902080546001600160601b0319166001600160601b038616179055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610fd7908590611c74565b60405180910390a350505050565b600081600160601b841061100c5760405162461bcd60e51b815260040161067691906118f1565b509192915050565b6000836001600160601b0316836001600160601b03161115829061104b5760405162461bcd60e51b815260040161067691906118f1565b505050900390565b6001600160a01b0383166110795760405162461bcd60e51b815260040161067690611a57565b6001600160a01b03821661109f5760405162461bcd60e51b815260040161067690611944565b6001600160a01b03831660009081526002602090815260409182902054825160608101909352603e8084526110ea936001600160601b039092169285929190611d0b90830139611014565b6001600160a01b03848116600090815260026020908152604080832080546001600160601b0319166001600160601b039687161790559286168252908290205482516060810190935260388084526111529491909116928592909190611ca390830139611426565b6001600160a01b038381166000818152600260205260409081902080546001600160601b0319166001600160601b0395909516949094179093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906111bf908590611c74565b60405180910390a36001600160a01b038084166000908152600360205260408082205485841683529120546111f99291821691168361128c565b505050565b4690565b6001600160a01b03808316600081815260036020818152604080842080546002845282862054949093528787166001600160a01b031984168117909155905191909516946001600160601b039092169391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a461128682848361128c565b50505050565b816001600160a01b0316836001600160a01b0316141580156112b757506000816001600160601b0316115b156111f9576001600160a01b0383161561136f576001600160a01b03831660009081526005602052604081205463ffffffff1690816112f7576000611336565b6001600160a01b0385166000908152600460209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b9050600061135d8285604051806060016040528060308152602001611cdb60309139611014565b905061136b86848484611462565b5050505b6001600160a01b038216156111f9576001600160a01b03821660009081526005602052604081205463ffffffff1690816113aa5760006113e9565b6001600160a01b0384166000908152600460209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b9050600061141082856040518060600160405280602f8152602001611db3602f9139611426565b905061141e85848484611462565b505050505050565b6000838301826001600160601b0380871690831610156114595760405162461bcd60e51b815260040161067691906118f1565b50949350505050565b6000611486436040518060600160405280603c8152602001611d77603c9139611617565b905060008463ffffffff161180156114cf57506001600160a01b038516600090815260046020908152604080832063ffffffff6000198901811685529252909120548282169116145b1561152e576001600160a01b0385166000908152600460209081526040808320600019880163ffffffff168452909152902080546fffffffffffffffffffffffff000000001916600160201b6001600160601b038516021790556115cd565b60408051808201825263ffffffff80841682526001600160601b0380861660208085019182526001600160a01b038b166000818152600483528781208c871682528352878120965187549451909516600160201b026fffffffffffffffffffffffff000000001995871663ffffffff19958616179590951694909417909555938252600590935292909220805460018801909316929091169190911790555b846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248484604051611608929190611c88565b60405180910390a25050505050565b600081600160201b841061100c5760405162461bcd60e51b815260040161067691906118f1565b80356001600160a01b038116811461065057600080fd5b803560ff8116811461065057600080fd5b600060208284031215611677578081fd5b610b8f8261163e565b60008060408385031215611692578081fd5b61169b8361163e565b91506116a96020840161163e565b90509250929050565b6000806000606084860312156116c6578081fd5b6116cf8461163e565b92506116dd6020850161163e565b9150604084013590509250925092565b600080600080600080600060e0888a031215611707578283fd5b6117108861163e565b965061171e6020890161163e565b9550604088013594506060880135935061173a60808901611655565b925060a0880135915060c0880135905092959891949750929550565b60008060408385031215611768578182fd5b6117718361163e565b946020939093013593505050565b60008060008060008060c08789031215611797578182fd5b6117a08761163e565b955060208701359450604087013593506117bc60608801611655565b92506080870135915060a087013590509295509295509295565b600080604083850312156117e8578182fd5b6117f18361163e565b9150602083013563ffffffff81168114611809578182fd5b809150509250929050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b901515815260200190565b90815260200190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b9384526001600160a01b039290921660208401526040830152606082015260800190565b938452602084019290925260408301526001600160a01b0316606082015260800190565b93845260ff9290921660208401526040830152606082015260800190565b6000602080835283518082850152825b8181101561191d57858101830151858201604001528201611901565b8181111561192e5783604083870101525b50601f01601f1916929092016040019392505050565b60208082526042908201527f52616469636c65546f6b656e3a3a5f7472616e73666572546f6b656e733a206360408201527f616e6e6f74207472616e7366657220746f20746865207a65726f206164647265606082015261737360f01b608082015260a00190565b6020808252602e908201527f52616469636c65546f6b656e3a3a64656c656761746542795369673a20696e7660408201526d616c6964207369676e617475726560901b606082015260800190565b60208082526039908201527f52616469636c65546f6b656e3a3a6275726e46726f6d3a2063616e6e6f74206260408201527f75726e2066726f6d20746865207a65726f206164647265737300000000000000606082015260800190565b60208082526044908201527f52616469636c65546f6b656e3a3a5f7472616e73666572546f6b656e733a206360408201527f616e6e6f74207472616e736665722066726f6d20746865207a65726f206164646060820152637265737360e01b608082015260a00190565b6020808252602a908201527f52616469636c65546f6b656e3a3a64656c656761746542795369673a20696e76604082015269616c6964206e6f6e636560b01b606082015260800190565b6020808252602e908201527f52616469636c65546f6b656e3a3a64656c656761746542795369673a2073696760408201526d1b985d1d5c9948195e1c1a5c995960921b606082015260800190565b60208082526027908201527f52616469636c65546f6b656e3a3a7065726d69743a20696e76616c6964207369604082015266676e617475726560c81b606082015260800190565b60208082526027908201527f52616469636c65546f6b656e3a3a7065726d69743a207369676e617475726520604082015266195e1c1a5c995960ca1b606082015260800190565b6020808252602f908201527f52616469636c65546f6b656e3a3a6765745072696f72566f7465733a206e6f7460408201526e081e595d0819195d195c9b5a5b9959608a1b606082015260800190565b63ffffffff91909116815260200190565b63ffffffff9290921682526001600160601b0316602082015260400190565b60ff91909116815260200190565b6001600160601b0391909116815260200190565b6001600160601b039283168152911660208201526040019056fe52616469636c65546f6b656e3a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f777352616469636c65546f6b656e3a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f777352616469636c65546f6b656e3a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e636552616469636c65546f6b656e3a3a6275726e46726f6d3a20616d6f756e742065786365656473203936206269747352616469636c65546f6b656e3a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d6265722065786365656473203332206269747352616469636c65546f6b656e3a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f777352616469636c65546f6b656e3a3a617070726f76653a20616d6f756e742065786365656473203936206269747352616469636c65546f6b656e3a3a6275726e46726f6d3a206275726e20616d6f756e74206578636565647320616c6c6f77616e636552616469636c65546f6b656e3a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e636552616469636c65546f6b656e3a3a7472616e736665723a20616d6f756e742065786365656473203936206269747352616469636c65546f6b656e3a3a6275726e46726f6d3a206275726e20616d6f756e7420657863656564732062616c616e6365a26469706673582212201e9fe306fe53be7e6d22e3455d0139cd5e870299dbf219ba35fee5276c0dddd264736f6c634300070600330000000000000000000000006838f63899728816f602b3e9bf73952e2bd6dc35

Check out more smart contracts

Build blockchain magic with Alchemy

Alchemy combines the most powerful web3 developer products and tools with resources, community and legendary support.