ETH Price: $2,055.26 (+1.85%)

Contract

0x32be193e8a9Fb1Bfb4b64c01f7F754b6cF81Da4E
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

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
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

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

Contract Source Code Verified (Exact Match)

Contract Name:
OrionVoting

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 100 runs

Other Settings:
default evmVersion
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import "./base/Staking.sol";
import "./libraries/TransferHelper.sol";
import "./interfaces/IveORN.sol";
import "./interfaces/IOrionVoting.sol";
import "./interfaces/IOrionFarmV2.sol";

import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
uint256 constant MAX_PERCENT = 10000;


contract OrionVoting is Staking {
    using EnumerableSet for EnumerableSet.Bytes32Set;

    struct Proposal {
        bytes32 name;
        EnumerableSet.Bytes32Set choices;
        uint256 timestampFinish;
    }

    uint256 public countPool; //number of pools
    mapping(uint256 => address) public poolList; //list of pools
    mapping(address => uint256) public poolIndex; //whether there is a pool in the list (index numbers starting from 1)

    mapping(address => uint256) public users; //user votes across all pools
    mapping(address => mapping(address => uint256)) public usersPool; //user votes by pool

    mapping(address => bool) public smarts; //white list of trusted farm contracts

    address public immutable veORN;
    address public immutable ORN;
    address public immutable smartOwner;

    mapping(bytes32 => Proposal) private proposals;
    mapping(bytes32 => uint256) public proposalVotes;
    mapping(bytes32 => mapping(address => uint256)) public voted;
    mapping(address => mapping(bytes32 => bytes32)) public userVotedChoice;

    modifier onlyOwner() {
        require(msg.sender == smartOwner, "Caller is not the owner");
        _;
    }

    event UsePool(address indexed pool, bool bUse);
    event Vote(address indexed pool, address indexed account, uint256 amount);
    event Unvote(address indexed pool, address indexed account, uint256 amount);
    event UnvoteAll(address indexed account);
    event ProposalCreated(
        bytes32 name,
        uint256 timestampFinish,
        bytes32[] choices
    );
    event ProposalVoted(
        address user,
        bytes32 name,
        bytes32 choice,
        uint256 votePower
    );
    event ProposalUnvoted(
        address user,
        bytes32 name,
        bytes32 choice,
        uint256 votePower
    );

    error MAX_PROPOSALS_EXCEED();
    error PROPOSAL_NOT_EXIST();
    error ALREADY_VOTED();
    error EMPTY_NAME();
    error EMPTY_CHOICES();
    error PROPOSAL_FINISHED();
    error CHOICE_NOT_EXIST();
    error DUPLICATED_CHOICES();
    error PROPOSAL_ALREADY_EXIST();
    error LOCK_WILL_EXPIRE();
    error ZERO_PREVIOUS_VOTE();
    error CANT_CHANGE_CHOICE();

    constructor(address veORN_, address owner) {
        veORN = veORN_;
        ORN = IveORN(veORN).ORN();
        smartOwner = owner;
    }

    //admin caller

    function setSmart(address addr, bool bUse) external onlyOwner {
        smarts[addr] = bUse;
    }

    function setRewards(uint64 rewards, uint64 duration) external onlyOwner {
        _setRewards(rewards, duration);
    }

    function addPool(address pool) public onlyOwner {
        countPool++;
        poolIndex[pool] = countPool;
        poolList[countPool] = pool;

        emit UsePool(pool, true);
    }

    function deletePool(address pool) external onlyOwner {
        uint256 index = poolIndex[pool];
        require(index > 0, "Pool not found");
        delete poolIndex[pool];

        //we move the last element to the place of the deleted one and delete the last element
        poolList[index] = poolList[countPool];
        poolIndex[poolList[countPool]] = index;
        delete poolList[countPool];
        countPool--;

        emit UsePool(pool, false);
    }

    //smart caller

    function claimReward(address pool, address to, uint256 amount) external {
        require(
            smarts[msg.sender],
            "claimReward: caller not found in white list"
        );

        _claimReward(pool, amount);

        TransferHelper.safeTransfer(ORN, to, amount);
    }

    //user caller
    function votePercent(address pool, uint256 percent) external {
        require(percent <= MAX_PERCENT, "Error percent");
        uint256 balanceVeORN = IveORN(veORN).balanceOf0(msg.sender);
        vote(pool, (balanceVeORN * percent) / MAX_PERCENT);
    }

    function vote(address pool, uint256 amount) public {
        require(poolIndex[pool] > 0, "Pool not found");

        //check balance
        uint256 balanceVeORN = IveORN(veORN).balanceOf0(msg.sender);
        uint256 balanceVotes = users[msg.sender];
        //require(balanceVeORN >= balanceVotes+amount,"Error user veORN balance");// and revert if overflow
        uint256 balanceRemained;
        if (balanceVeORN > balanceVotes)
            balanceRemained = balanceVeORN - balanceVotes;
        if (amount > balanceRemained) amount = balanceRemained;

        users[msg.sender] += amount;
        usersPool[msg.sender][pool] += amount;

        _stake(pool, amount);

        emit Vote(pool, msg.sender, amount);
    }

    function unvotePercent(address pool, uint256 percent) external {
        require(percent <= MAX_PERCENT, "Error percent");
        uint256 balanceVeORN = IveORN(veORN).balanceOf0(msg.sender);
        unvote(pool, (balanceVeORN * percent) / MAX_PERCENT);
    }

    function unvote(address pool, uint256 amount) public {
        if (usersPool[msg.sender][pool] > amount) {
            usersPool[msg.sender][pool] -= amount;
        } else {
            amount = usersPool[msg.sender][pool];
            delete usersPool[msg.sender][pool];
        }
        if (users[msg.sender] > amount) {
            users[msg.sender] -= amount;
        } else {
            amount = users[msg.sender];
            delete users[msg.sender];
        }

        _unstake(pool, amount);

        emit Unvote(pool, msg.sender, amount);
    }

    //array call support
    function voteArr(
        address[] calldata pools,
        uint256[] calldata amounts
    ) external {
        require(pools.length == amounts.length, "Pool not found");

        for (uint256 i = 0; i < pools.length; i++) vote(pools[i], amounts[i]);
    }

    //user or smart caller

    function unvoteAll(address account) external {
        require(
            msg.sender == veORN || msg.sender == account,
            "unvoteAll: caller is not the veORN contract"
        );

        uint256 balanceVotes = users[account];
        if (balanceVotes > 0) {
            uint256 _countPool = countPool;
            for (uint256 i = 1; i <= _countPool; i++) {
                address pool = poolList[i];
                uint256 amount = usersPool[account][pool];

                if (amount > 0) {
                    usersPool[account][pool] = 0;
                    _unstake(pool, amount);

                    balanceVotes -= amount;
                    if (balanceVotes == 0) break;
                }
            }
            users[account] = 0;

            emit UnvoteAll(account);
        }
    }

    function addPool2(address pool, address farmv2) external {
        //добавление пула и создание смарт-контракта наград для пулов v2
        addPool(pool); //check owner
        IOrionFarmV2(farmv2).createSmartReward(pool);
    }

    function createProposal(
        bytes32 name,
        bytes32[] memory choices,
        uint256 timestampFinish
    ) external onlyOwner {
        if (name == 0x0) revert EMPTY_NAME();
        if (choices.length > 10) revert MAX_PROPOSALS_EXCEED();
        if (choices.length == 0) revert EMPTY_CHOICES();
        if (timestampFinish <= block.timestamp) revert PROPOSAL_FINISHED();

        Proposal storage proposal = proposals[name];
        if (proposal.name != 0x0) revert PROPOSAL_ALREADY_EXIST();

        proposal.name = name;
        proposal.timestampFinish = timestampFinish;

        for (uint i = 0; i < choices.length; ++i) {
            bytes32 choice = choices[i];
            if (choice == 0x0) revert EMPTY_NAME();
            if (!proposal.choices.add(choice)) revert DUPLICATED_CHOICES();
        }

        emit ProposalCreated(name, timestampFinish, choices);
    }

    function voteProposal(bytes32 name, bytes32 choice) external {
        Proposal storage proposal = proposals[name];

        if (proposal.name == 0x0) revert PROPOSAL_NOT_EXIST();

        if (proposal.timestampFinish <= block.timestamp)
            revert PROPOSAL_FINISHED();

        if (!proposal.choices.contains(choice)) revert CHOICE_NOT_EXIST();

        uint256 lockFinish = IveORN(veORN).lockTime(msg.sender);
        if (lockFinish < proposal.timestampFinish)
            revert LOCK_WILL_EXPIRE();

        bytes32 currentChoice = userVotedChoice[msg.sender][name];
        if (currentChoice != bytes32(0) && currentChoice != choice) revert CANT_CHANGE_CHOICE();

        uint256 votePower = IveORN(veORN).balanceOf0(msg.sender); // votePower != 0 due to userInfo.time_lock != 0
        uint256 votedAmount = voted[name][msg.sender];

        if (votePower <= votedAmount) revert ALREADY_VOTED();

        bytes32 id = keccak256(abi.encode(name, choice));
        proposalVotes[id] += votePower - votedAmount;
        voted[name][msg.sender] = votePower;
        userVotedChoice[msg.sender][name] = choice;

        emit ProposalVoted(msg.sender, name, choice, votePower);
    }

    function changeVoteProposal(
        bytes32 name,
        bytes32 previousChoice,
        bytes32 newChoice
    ) external {
        Proposal storage proposal = proposals[name];

        if (proposal.name == 0x0) revert PROPOSAL_NOT_EXIST();

        if (proposal.timestampFinish <= block.timestamp)
            revert PROPOSAL_FINISHED();

        if (!proposal.choices.contains(previousChoice)) revert CHOICE_NOT_EXIST();
        if (!proposal.choices.contains(newChoice)) revert CHOICE_NOT_EXIST();

        uint256 votedAmount = voted[name][msg.sender];
        if (votedAmount == 0) revert ZERO_PREVIOUS_VOTE();

        uint256 votePower = IveORN(veORN).balanceOf0(msg.sender); // votePower >= votedAmount

        bytes32 previousId = keccak256(abi.encode(name, previousChoice));
        proposalVotes[previousId] -= votedAmount;

        bytes32 newId = keccak256(abi.encode(name, newChoice));
        proposalVotes[newId] += votePower;

        voted[name][msg.sender] = votePower;
        userVotedChoice[msg.sender][name] = newChoice;

        emit ProposalUnvoted(msg.sender, name, previousChoice, votedAmount);
        emit ProposalVoted(msg.sender, name, newChoice, votePower);
    }

    function proposalInfo(
        bytes32 name
    )
        external
        view
        returns (bytes32, uint256, bytes32[] memory, uint256[] memory)
    {
        Proposal storage proposal = proposals[name];
        uint256 choicesLength = proposal.choices.length();
        uint256[] memory votes = new uint256[](choicesLength);

        for (uint i = 0; i < choicesLength; ++i) {
            bytes32 id = keccak256(abi.encode(name, proposal.choices.at(i)));
            votes[i] = proposalVotes[id];
        }

        return (
            name,
            proposal.timestampFinish,
            proposal.choices.values(),
            votes
        );
    }

    //view
    function havePool(address account) external view returns (bool) {
        return poolIndex[account] > 0;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 amount) external returns (bool);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```solidity
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
 * unusable.
 * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
 * array of EnumerableSet.
 * ====
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        bytes32[] memory store = _values(set._inner);
        bytes32[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

//import "hardhat/console.sol";

abstract contract Staking {
    uint256 internal constant RATE_PRECISION = 1e40;

    uint256 public rewardRate; //скорость наград, например 1 ORN в секунду на всех (точность 10**48)

    struct UserState {
        uint256 stake;
        uint256 rateCumulative;
        uint256 reward;
        uint256 rewardWithdraw;
    }

    uint256 public allStake; //сумма всех стейков
    mapping(address => UserState) public poolStake; //стейки по пользователям

    uint256 public rateCumulative;
    uint256 public rateTime;
    uint256 private rewardCumulativeTotal; //сумма всех наград

    event SetRewards(
        uint64 rewards,
        uint64 duration,
        uint256 rewardCumulativeTotal,
        uint256 rateCumulative,
        uint256 timestamp
    );
    event Stake(
        address indexed account,
        uint256 amount,
        uint256 rewardCumulativeTotal,
        uint256 rateCumulative,
        uint256 reward,
        uint256 timestamp
    );
    event Unstake(
        address indexed account,
        uint256 amount,
        uint256 rewardCumulativeTotal,
        uint256 rateCumulative,
        uint256 reward,
        uint256 timestamp
    );
    event ClaimReward(
        address indexed account,
        uint256 amount,
        uint256 rewardCumulativeTotal,
        uint256 rateCumulative,
        uint256 reward,
        uint256 timestamp
    );

    //  Set the overall reward
    function _setRewards(uint64 rewards, uint64 duration) internal {
        require(duration > 0, "_setRewards: zero duration");

        _writeCumulative();

        //  ORN / sec
        rewardRate = (RATE_PRECISION * rewards) / duration;

        emit SetRewards(
            rewards,
            duration,
            rewardCumulativeTotal,
            rateCumulative,
            block.timestamp
        );
    }

    //Расчет нового курса награды
    function calcNewRate() public view virtual returns (uint256) {
        uint256 Rate = 0;
        if (allStake > 0) {
            Rate = rewardRate / allStake;
        }

        return Rate * (block.timestamp - rateTime);
    }

    function _writeCumulative() internal virtual {
        uint256 newRate = calcNewRate();

        rewardCumulativeTotal += (newRate * allStake) / RATE_PRECISION;
        rateCumulative += newRate;
        rateTime = block.timestamp;
    }

    function _stake(address account, uint256 amount) internal {
        require(amount > 0, "_stake: zero stake amount");

        _writeCumulative();

        UserState memory item = poolStake[account];
        item.reward = _calcReward(item, rateCumulative);
        item.stake += amount;
        item.rateCumulative = rateCumulative;
        poolStake[account] = item;

        allStake += amount;

        emit Stake(
            account,
            amount,
            rewardCumulativeTotal,
            rateCumulative,
            item.reward,
            block.timestamp
        );
    }

    function _claimReward(address account, uint256 amount) internal {
        _writeCumulative();

        UserState memory item = poolStake[account];

        item.reward = _calcReward(item, rateCumulative);
        require(
            item.reward - item.rewardWithdraw >= amount,
            "Error claim amount"
        );
        item.rewardWithdraw += amount;
        item.rateCumulative = rateCumulative;
        poolStake[account] = item;

        emit ClaimReward(
            account,
            amount,
            rewardCumulativeTotal,
            rateCumulative,
            item.reward,
            block.timestamp
        );
    }

    function _unstake(address account, uint256 amount) internal {
        _writeCumulative();

        UserState memory item = poolStake[account];
        require(item.stake >= amount, "Error unstake amount");

        item.reward = _calcReward(item, rateCumulative);
        item.stake -= amount;
        item.rateCumulative = rateCumulative;
        poolStake[account] = item;

        allStake -= amount;

        emit Unstake(
            account,
            amount,
            rewardCumulativeTotal,
            rateCumulative,
            item.reward,
            block.timestamp
        );
    }

    function _calcReward(
        UserState memory item,
        uint256 _rateCumulative
    ) internal pure returns (uint256) {
        return
            item.reward +
            ((_rateCumulative - item.rateCumulative) * item.stake) /
            RATE_PRECISION;
    }

    function getReward(address account) public view virtual returns (uint256) {
        UserState memory item = poolStake[account];
        uint256 _rateCumulative = rateCumulative + calcNewRate();
        return _calcReward(item, _rateCumulative) - item.rewardWithdraw;
    }

    function getStake(address account) public view returns (uint256) {
        return poolStake[account].stake;
    }

    function getRewardWithdraw(
        address account
    ) external view returns (uint256) {
        return poolStake[account].rewardWithdraw;
    }

    function getRewardCumulative(
        address account
    ) external view returns (uint256) {
        return getReward(account) + poolStake[account].rewardWithdraw;
    }

    function getRewardCumulativeAll() public view returns (uint256) {
        uint256 newRate = calcNewRate();
        return rewardCumulativeTotal + (newRate * allStake) / RATE_PRECISION;
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;


interface IOrionFarmV2
{
    //Action
    function create_lock_period(address pool, uint256 amount, uint256 lock_period) external;
    function increase_amount(address pool, uint256 amount) external;
    function increase_lock_period(address pool, uint256 new_lock_period) external;
    function withdraw(address pool) external;
    function claimReward(address pool) external;

    function createSmartReward(address pool) external;

    //View
    function getReward(address pool, address account) external view returns (uint256);
    function getBoost(address pool, address account) external view returns (uint256);
    function getStake(address pool, address account) external view returns (uint256);
    function allStake(address pool) external view returns (uint256);
    function lockTimeStart(address pool, address account) external view returns (uint48);
    function lockTimePeriod(address pool, address account) external view returns (uint48);

    function libStakingReward() external view returns(address);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import "./IStaking.sol";

interface IOrionVoting is IStaking
{

    //admin
    function setSmart(address addr, bool bUse) external;
    function setRewards(uint64 rewards, uint64 duration) external;
    function addPool(address pool) external;
    function deletePool(address pool) external;


    //user
    function vote(address pool, uint256 amount) external;
    function voteArr(address[] calldata pools, uint256[] calldata amounts) external;
    function unvote(address pool, uint256 amount) external;
    function unvoteAll(address account) external;

    //smart
    function claimReward(address pool, address to, uint256 amount) external;

    //vew
    function countPool() external view returns (uint256);//number of pools
    function poolList(uint256) external view returns (address);//list of pools
    function poolIndex(address pool) external view returns (uint256);//whether there is a pool in the list (index numbers starting from 1)
    function users(address user) external view returns (uint256);//user votes across all pools
    function usersPool(address user,address pool) external view returns (uint256);//user votes by pool
    function smarts(address smart) external view returns (bool);//white list of trusted farm contracts

    function veORN() external view returns (address);
    function ORN() external view returns (address);

    function havePool(address account) external view returns (bool);



}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;


interface IStaking
{
    //staking
    function getReward(address account) external view returns (uint256);
    function getStake(address account) external view returns (uint256);
    function allStake() external view returns (uint256);
    function rewardRate() external view returns (uint256);
    function rateCumulative() external view returns (uint256);
    function rateTime() external view returns (uint256);


    function getRewardWithdraw(address account) external view returns (uint256);
    function getRewardCumulative(address account) external view returns (uint256);
    function getRewardCumulativeAll() external view returns (uint256);

}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

interface ITWBalance
{
    struct TWItem
    {
        // the block timestamp
        uint48  timestamp;        
        // the amount accumulator, i.e. amount * time elapsed
        uint208 amountTW;
    }

    /// @notice Returns the time weight (TW) amount of tokens in existence.
    function totalSupplyTW() external view returns (TWItem memory);

    /// @notice Calculates the average aamount of tokens in existence from the specified TW period
    function totalSupplyAvg(TWItem memory itemStart) view external returns (uint256);

    /// @notice Returns the time weight (TW) balance of a token
    /// @param user The account for which to look up the number of tokens it has, i.e. its balance
    /// @return The number of tokens held by the account
    function balanceOfTW(address user) external view returns (TWItem memory);
    
    /// @notice Calculates the average address balance from the specified TW period
    function balanceOfAvg(address user, TWItem memory itemStart) view external returns (uint256);

}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import "./ITWBalance.sol";
import "./IStaking.sol";

interface IveORN is ITWBalance,IStaking
{
    struct UserInfo {
        uint48 time_lock;
        uint128 balance;
        uint128 amount_token;
    }
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);
    function totalSupply(uint256 ts) external view returns (uint256);
    function totalSupply0() external view returns (uint256);//balance on start timestamp

    /// @notice Returns the balance of a token
    /// @param account The account for which to look up the number of tokens it has, i.e. its balance
    /// @return The number of tokens held by the account
    function balanceOf(address account) external view returns (uint256);
    function balanceOf(address account, uint256 ts) external view returns (uint256);
    function balanceOf0(address account) external view returns (uint256);//balance on start timestamp

    function balanceTokenOf(address account) external view  returns (uint256);

    /// @notice Returns the number of decimals used to get its user representation.
    function decimals() external view returns (uint8);
    
    function name() pure external returns(string memory);
    function symbol() pure external returns(string memory);
 

    function ORN() external view returns (address);

    function lockTime(address account) external view returns (uint48);

    
    //staking ORN
    function create_lock(uint256 _value, uint256 _unlock_time) external;
    //function deposit_for(address _addr, uint256 _value) external;
    function increase_amount(uint256 _value) external;
    function increase_unlock_time(uint256 _unlock_time) external;
    function increase_unlock_period(uint256 unlock_period) external;
    function create_lock_period(uint256 _value, uint256 unlock_period) external;

    function withdraw() external;
    function claimReward() external;

    function tokenMap(address user) external returns(UserInfo memory);

}

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.7;

import '@openzeppelin/contracts/token/ERC20/IERC20.sol';

library TransferHelper {
    /// @notice Transfers tokens from the targeted address to the given destination
    /// @notice Errors with 'STF' if transfer fails
    /// @param token The contract address of the token to be transferred
    /// @param from The originating address from which the tokens will be transferred
    /// @param to The destination address of the transfer
    /// @param value The amount to be transferred
    function safeTransferFrom(
        address token,
        address from,
        address to,
        uint256 value
    ) internal {
        (bool success, bytes memory data) =
            token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'STF');
    }

    /// @notice Transfers tokens from msg.sender to a recipient
    /// @dev Errors with ST if transfer fails
    /// @param token The contract address of the token which will be transferred
    /// @param to The recipient of the transfer
    /// @param value The value of the transfer
    function safeTransfer(
        address token,
        address to,
        uint256 value
    ) internal {
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'ST');
    }

    /// @notice Approves the stipulated contract to spend the given allowance in the given token
    /// @dev Errors with 'SA' if transfer fails
    /// @param token The contract address of the token to be approved
    /// @param to The target of the approval
    /// @param value The amount of the given token the target will be allowed to spend
    function safeApprove(
        address token,
        address to,
        uint256 value
    ) internal {
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.approve.selector, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'SA');
    }

    /// @notice Transfers ETH to the recipient address
    /// @dev Fails with `STE`
    /// @param to The destination of the transfer
    /// @param value The value to be transferred
    function safeTransferETH(address to, uint256 value) internal {
        (bool success, ) = to.call{value: value}(new bytes(0));
        require(success, 'STE');
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 100
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"veORN_","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ALREADY_VOTED","type":"error"},{"inputs":[],"name":"CANT_CHANGE_CHOICE","type":"error"},{"inputs":[],"name":"CHOICE_NOT_EXIST","type":"error"},{"inputs":[],"name":"DUPLICATED_CHOICES","type":"error"},{"inputs":[],"name":"EMPTY_CHOICES","type":"error"},{"inputs":[],"name":"EMPTY_NAME","type":"error"},{"inputs":[],"name":"LOCK_WILL_EXPIRE","type":"error"},{"inputs":[],"name":"MAX_PROPOSALS_EXCEED","type":"error"},{"inputs":[],"name":"PROPOSAL_ALREADY_EXIST","type":"error"},{"inputs":[],"name":"PROPOSAL_FINISHED","type":"error"},{"inputs":[],"name":"PROPOSAL_NOT_EXIST","type":"error"},{"inputs":[],"name":"ZERO_PREVIOUS_VOTE","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardCumulativeTotal","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rateCumulative","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"ClaimReward","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"name","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"timestampFinish","type":"uint256"},{"indexed":false,"internalType":"bytes32[]","name":"choices","type":"bytes32[]"}],"name":"ProposalCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"bytes32","name":"name","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"choice","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"votePower","type":"uint256"}],"name":"ProposalUnvoted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"bytes32","name":"name","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"choice","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"votePower","type":"uint256"}],"name":"ProposalVoted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"rewards","type":"uint64"},{"indexed":false,"internalType":"uint64","name":"duration","type":"uint64"},{"indexed":false,"internalType":"uint256","name":"rewardCumulativeTotal","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rateCumulative","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"SetRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardCumulativeTotal","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rateCumulative","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"Stake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardCumulativeTotal","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rateCumulative","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"Unstake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pool","type":"address"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Unvote","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"UnvoteAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pool","type":"address"},{"indexed":false,"internalType":"bool","name":"bUse","type":"bool"}],"name":"UsePool","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pool","type":"address"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Vote","type":"event"},{"inputs":[],"name":"ORN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"}],"name":"addPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"},{"internalType":"address","name":"farmv2","type":"address"}],"name":"addPool2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"allStake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"calcNewRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"name","type":"bytes32"},{"internalType":"bytes32","name":"previousChoice","type":"bytes32"},{"internalType":"bytes32","name":"newChoice","type":"bytes32"}],"name":"changeVoteProposal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"claimReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"countPool","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"name","type":"bytes32"},{"internalType":"bytes32[]","name":"choices","type":"bytes32[]"},{"internalType":"uint256","name":"timestampFinish","type":"uint256"}],"name":"createProposal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"}],"name":"deletePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getRewardCumulative","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRewardCumulativeAll","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getRewardWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getStake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"havePool","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"poolIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolList","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"poolStake","outputs":[{"internalType":"uint256","name":"stake","type":"uint256"},{"internalType":"uint256","name":"rateCumulative","type":"uint256"},{"internalType":"uint256","name":"reward","type":"uint256"},{"internalType":"uint256","name":"rewardWithdraw","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"name","type":"bytes32"}],"name":"proposalInfo","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes32[]","name":"","type":"bytes32[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"proposalVotes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rateCumulative","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"rewards","type":"uint64"},{"internalType":"uint64","name":"duration","type":"uint64"}],"name":"setRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"bool","name":"bUse","type":"bool"}],"name":"setSmart","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"smartOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"smarts","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"unvote","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"unvoteAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"},{"internalType":"uint256","name":"percent","type":"uint256"}],"name":"unvotePercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"userVotedChoice","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"users","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"usersPool","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"veORN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"vote","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"pools","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"voteArr","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"},{"internalType":"uint256","name":"percent","type":"uint256"}],"name":"votePercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"name","type":"bytes32"},{"internalType":"bytes32","name":"choice","type":"bytes32"}],"name":"voteProposal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"address","name":"","type":"address"}],"name":"voted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

60e06040523480156200001157600080fd5b5060405162002b9f38038062002b9f8339810160408190526200003491620000db565b6001600160a01b038216608081905260408051634272e7d760e01b81529051634272e7d7916004808201926020929091908290030181865afa1580156200007f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000a5919062000113565b6001600160a01b0390811660a0521660c0525062000138565b80516001600160a01b0381168114620000d657600080fd5b919050565b60008060408385031215620000ef57600080fd5b620000fa83620000be565b91506200010a60208401620000be565b90509250929050565b6000602082840312156200012657600080fd5b6200013182620000be565b9392505050565b60805160a05160c0516129dc620001c3600039600081816103680152818161081301528181610fbf01528181611102015281816112f4015261154401526000818161032e01526109060152600081816104cb015281816109c901528181610ad001528181610df10152818161118901528181611644015281816116e2015261197f01526129dc6000f3fe608060405234801561001057600080fd5b50600436106102485760003560e01c806397b0f2051161013b578063c00007b0116100b8578063d9a755721161007c578063d9a755721461060c578063e276edb314610637578063f9e912241461064a578063fc19fd8914610675578063fe4d47cf1461068857600080fd5b8063c00007b014610544578063cf5e551f14610557578063d14b85b914610582578063d6d31ae1146105a2578063d914cd4b146105f957600080fd5b8063b0d354ed116100ff578063b0d354ed146104ed578063b2884a0414610500578063b2d7601f14610509578063b42754a514610511578063be83808b1461053157600080fd5b806397b0f2051461046d578063a06e9eb114610480578063a87430ba14610493578063ad60346a146104b3578063ad8bd2c1146104c657600080fd5b806349516370116101c95780637a7664601161018d5780637a766460146103f35780637b0a47ee1461041c5780637ba625131461042557806382d692811461043857806389b688b31461046457600080fd5b8063495163701461036357806353da67f61461038a5780635b18107d146103ad5780635f74bbde146103b5578063722b0717146103c857600080fd5b80632a48235b116102105780632a48235b146102d75780632f2d783d1461030d5780633f3bd330146103205780634272e7d71461032957806342d79d9c1461035057600080fd5b806302aa9be21461024d57806316cc05cd1461026257806319287d53146102885780631d6e13411461029b57806320fb629d146102ce575b600080fd5b61026061025b366004612358565b61069b565b005b610275610270366004612382565b6107d3565b6040519081526020015b60405180910390f35b6102606102963660046123ae565b610808565b6102be6102a9366004612382565b600b6020526000908152604090205460ff1681565b604051901515815260200161027f565b61027560045481565b6103006102e53660046123e5565b6007602052600090815260409020546001600160a01b031681565b60405161027f91906123fe565b61026061031b366004612412565b610884565b61027560035481565b6103007f000000000000000000000000000000000000000000000000000000000000000081565b61026061035e36600461244e565b610931565b6103007f000000000000000000000000000000000000000000000000000000000000000081565b61039d6103983660046123e5565b610c4f565b60405161027f94939291906124ab565b610275610d65565b6102606103c3366004612358565b610da2565b6102756103d6366004612358565b600f60209081526000928352604080842090915290825290205481565b610275610401366004612382565b6001600160a01b031660009081526002602052604090205490565b61027560005481565b61026061043336600461250d565b610f49565b610275610446366004612382565b6001600160a01b031660009081526002602052604090206003015490565b61027560015481565b61026061047b366004612382565b610fb4565b61026061048e366004612557565b6110f7565b6102756104a1366004612382565b60096020526000908152604090205481565b6102606104c1366004612358565b61114d565b6103007f000000000000000000000000000000000000000000000000000000000000000081565b6102606104fb3660046125cc565b61121c565b61027560065481565b6102756112a7565b61027561051f366004612382565b60086020526000908152604090205481565b61026061053f36600461264d565b6112e9565b610275610552366004612382565b6114ba565b61027561056536600461250d565b600a60209081526000928352604080842090915290825290205481565b6102756105903660046123e5565b600d6020526000908152604090205481565b6105d96105b0366004612382565b600260208190526000918252604090912080546001820154928201546003909201549092919084565b60408051948552602085019390935291830152606082015260800161027f565b610260610607366004612382565b611539565b61027561061a36600461271e565b600e60209081526000928352604080842090915290825290205481565b610260610645366004612358565b611608565b6102be610658366004612382565b6001600160a01b0316600090815260086020526040902054151590565b610260610683366004612382565b6116d7565b610260610696366004612741565b611882565b336000908152600a602090815260408083206001600160a01b038616845290915290205481101561070457336000908152600a602090815260408083206001600160a01b0386168452909152812080548392906106f9908490612783565b9091555061072e9050565b50336000908152600a602090815260408083206001600160a01b0385168452909152812080549190555b3360009081526009602052604090205481101561076f573360009081526009602052604081208054839290610764908490612783565b909155506107859050565b5033600090815260096020526040812080549190555b61078f8282611b44565b60405181815233906001600160a01b038416907faa0e554f781c3c3b2be110a0557f260f11af9a8aa2c64bc1e7a31dbb21e32fa29060200160405180910390a35050565b6001600160a01b0381166000908152600260205260408120600301546107f8836114ba565b6108029190612796565b92915050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146108595760405162461bcd60e51b8152600401610850906127a9565b60405180910390fd5b6001600160a01b03919091166000908152600b60205260409020805460ff1916911515919091179055565b336000908152600b602052604090205460ff166108f75760405162461bcd60e51b815260206004820152602b60248201527f636c61696d5265776172643a2063616c6c6572206e6f7420666f756e6420696e60448201526a081dda1a5d19481b1a5cdd60aa1b6064820152608401610850565b6109018382611cba565b61092c7f00000000000000000000000000000000000000000000000000000000000000008383611e08565b505050565b6000828152600c6020526040812080549091036109615760405163168377c160e21b815260040160405180910390fd5b428160030154116109855760405163f81f40e760e01b815260040160405180910390fd5b6109926001820183611f01565b6109af5760405163171cd29360e11b815260040160405180910390fd5b60405163a4beda6360e01b81526000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063a4beda63906109fe9033906004016123fe565b602060405180830381865afa158015610a1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3f91906127da565b65ffffffffffff1690508160030154811015610a6e576040516301a20e9f60e21b815260040160405180910390fd5b336000908152600f602090815260408083208784529091529020548015801590610a985750838114155b15610ab657604051636ab144a760e01b815260040160405180910390fd5b60405163138cce3960e21b81526000906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690634e3338e490610b059033906004016123fe565b602060405180830381865afa158015610b22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b469190612802565b6000878152600e60209081526040808320338452909152902054909150808211610b835760405163eb20971160e01b815260040160405180910390fd5b6040805160208082018a905281830189905282518083038401815260609092019092528051910120610bb58284612783565b6000828152600d602052604081208054909190610bd3908490612796565b90915550506000888152600e6020908152604080832033808552908352818420879055600f83528184208c85529092529182902089905590517fe3d746913bf71cb9e517188584770f4a9d51da13a032cc59abcc0ebfc8a48bd391610c3d918b908b90889061281b565b60405180910390a15050505050505050565b6000818152600c602052604081208190606090819083610c7160018301611f1c565b90506000816001600160401b03811115610c8d57610c8d612637565b604051908082528060200260200182016040528015610cb6578160200160208202803683370190505b50905060005b82811015610d4057600089610cd46001870184611f26565b604080516020810193909352820152606001604051602081830303815290604052805190602001209050600d600082815260200190815260200160002054838381518110610d2457610d24612841565b602090810291909101015250610d3981612857565b9050610cbc565b50878360030154610d5385600101611f32565b91985096509450925050509193509193565b600154600090819015610d8557600154600054610d829190612870565b90505b600454610d929042612783565b610d9c9082612892565b91505090565b6001600160a01b038216600090815260086020526040902054610dd75760405162461bcd60e51b8152600401610850906128a9565b60405163138cce3960e21b81526000906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690634e3338e490610e269033906004016123fe565b602060405180830381865afa158015610e43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e679190612802565b3360009081526009602052604081205491925081831115610e8f57610e8c8284612783565b90505b80841115610e9b578093505b3360009081526009602052604081208054869290610eba908490612796565b9091555050336000908152600a602090815260408083206001600160a01b038916845290915281208054869290610ef2908490612796565b90915550610f0290508585611f3f565b60405184815233906001600160a01b038716907f66a9138482c99e9baf08860110ef332cc0c23b4a199a53593d8db0fc8f96fbfc9060200160405180910390a35050505050565b610f5282611539565b604051631ee1f46360e21b81526001600160a01b03821690637b87d18c90610f7e9085906004016123fe565b600060405180830381600087803b158015610f9857600080fd5b505af1158015610fac573d6000803e3d6000fd5b505050505050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610ffc5760405162461bcd60e51b8152600401610850906127a9565b6001600160a01b038116600090815260086020526040902054806110325760405162461bcd60e51b8152600401610850906128a9565b6001600160a01b03828116600090815260086020818152604080842084905560068054855260078084528286205488875283872080549189166001600160a01b031992831617905582548752838720549097168652938352818520879055805485529290915282208054909316909255815491906110af836128d1565b9091555050604051600081526001600160a01b038316907f378333f475b147b091d9370fe9192b22d3701547af05b7d0d5b37bb90eb1ee7b9060200160405180910390a25050565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461113f5760405162461bcd60e51b8152600401610850906127a9565b61114982826120ac565b5050565b61271081111561116f5760405162461bcd60e51b8152600401610850906128e8565b60405163138cce3960e21b81526000906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690634e3338e4906111be9033906004016123fe565b602060405180830381865afa1580156111db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ff9190612802565b905061092c836127106112128585612892565b6103c39190612870565b82811461123b5760405162461bcd60e51b8152600401610850906128a9565b60005b838110156112a05761128e85858381811061125b5761125b612841565b90506020020160208101906112709190612382565b84848481811061128257611282612841565b90506020020135610da2565b8061129881612857565b91505061123e565b5050505050565b6000806112b2610d65565b90506b1d6329f1c35ca4bfabb9f56160281b600154826112d29190612892565b6112dc9190612870565b600554610d9c9190612796565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146113315760405162461bcd60e51b8152600401610850906127a9565b6000839003611353576040516392bf449d60e01b815260040160405180910390fd5b600a8251111561137657604051630fb3e39160e21b815260040160405180910390fd5b8151600003611398576040516322d1e01760e21b815260040160405180910390fd5b4281116113b85760405163f81f40e760e01b815260040160405180910390fd5b6000838152600c602052604090208054156113e657604051635a624d3560e01b815260040160405180910390fd5b8381556003810182905560005b835181101561147857600084828151811061141057611410612841565b60200260200101519050806000801b0361143d576040516392bf449d60e01b815260040160405180910390fd5b61144a60018401826121a9565b61146757604051635573919d60e01b815260040160405180910390fd5b5061147181612857565b90506113f3565b507fa701e472fa152d5473dee7bfe18c621a6bdabe61460a9fb7b75e26e3cf3513be8483856040516114ac9392919061290f565b60405180910390a150505050565b6001600160a01b03811660009081526002602081815260408084208151608081018352815481526001820154938101939093529283015490820152600390910154606082015281611509610d65565b6003546115169190612796565b9050816060015161152783836121b5565b6115319190612783565b949350505050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146115815760405162461bcd60e51b8152600401610850906127a9565b6006805490600061159183612857565b90915550506006546001600160a01b0382166000818152600860209081526040808320859055938252600781529083902080546001600160a01b0319168317905591516001815290917f378333f475b147b091d9370fe9192b22d3701547af05b7d0d5b37bb90eb1ee7b910160405180910390a250565b61271081111561162a5760405162461bcd60e51b8152600401610850906128e8565b60405163138cce3960e21b81526000906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690634e3338e4906116799033906004016123fe565b602060405180830381865afa158015611696573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ba9190612802565b905061092c836127106116cd8585612892565b61025b9190612870565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806117165750336001600160a01b038216145b6117765760405162461bcd60e51b815260206004820152602b60248201527f756e766f7465416c6c3a2063616c6c6572206973206e6f74207468652076654f60448201526a14938818dbdb9d1c9858dd60aa1b6064820152608401610850565b6001600160a01b03811660009081526009602052604090205480156111495760065460015b81811161183b576000818152600760209081526040808320546001600160a01b038881168552600a845282852091168085529252909120548015611826576001600160a01b038087166000908152600a6020908152604080832093861683529290529081205561180b8282611b44565b6118158186612783565b94508460000361182657505061183b565b5050808061183390612857565b91505061179b565b506001600160a01b038316600081815260096020526040808220829055517f6c0ea4a9e85d6833d8071c741ee831d8793bad403b0de52072f8932ca1df8b819190a2505050565b6000838152600c6020526040812080549091036118b25760405163168377c160e21b815260040160405180910390fd5b428160030154116118d65760405163f81f40e760e01b815260040160405180910390fd5b6118e36001820184611f01565b6119005760405163171cd29360e11b815260040160405180910390fd5b61190d6001820183611f01565b61192a5760405163171cd29360e11b815260040160405180910390fd5b6000848152600e602090815260408083203384529091528120549081900361196557604051633daaf28760e11b815260040160405180910390fd5b60405163138cce3960e21b81526000906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690634e3338e4906119b49033906004016123fe565b602060405180830381865afa1580156119d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119f59190612802565b905060008686604051602001611a15929190918252602082015260400190565b60405160208183030381529060405280519060200120905082600d60008381526020019081526020016000206000828254611a509190612783565b90915550506040805160208082018a9052818301889052825180830384018152606090920183528151918101919091206000818152600d9092529181208054859290611a9d908490612796565b90915550506000888152600e6020908152604080832033808552908352818420879055600f83528184208c85529092529182902088905590517f174fc560a38f441b3fde0eb1817131d9f63632f5ff6662ec1cd9fff43eaa068291611b07918b908b90899061281b565b60405180910390a17fe3d746913bf71cb9e517188584770f4a9d51da13a032cc59abcc0ebfc8a48bd333898886604051610c3d949392919061281b565b611b4c6121fd565b6001600160a01b038216600090815260026020818152604092839020835160808101855281548082526001830154938201939093529281015493830193909352600390920154606082015290821115611bde5760405162461bcd60e51b8152602060048201526014602482015273115c9c9bdc881d5b9cdd185ad948185b5bdd5b9d60621b6044820152606401610850565b611bea816003546121b5565b6040820152805182908290611c00908390612783565b9052506003805460208084019182526001600160a01b038616600090815260029182905260408082208651815593516001808601919091559086015192840192909255606085015192909301919091558054849290611c60908490612783565b909155505060055460035460408084015190516001600160a01b038716937f2ae77851d374757c0aeee19fd5d8f75edac9f1f52043fb96992607c29373144193611cad9388934290612937565b60405180910390a2505050565b611cc26121fd565b6001600160a01b0382166000908152600260208181526040928390208351608081018552815481526001820154928101929092529182015492810192909252600390810154606083015254611d189082906121b5565b6040820181905260608201518391611d309190612783565b1015611d735760405162461bcd60e51b8152602060048201526012602482015271115c9c9bdc8818db185a5b48185b5bdd5b9d60721b6044820152606401610850565b8181606001818151611d859190612796565b9052506003805460208084019182526001600160a01b03861660008181526002928390526040908190208651815593516001850155808601519284018390556060860151938501939093556005549354925190937f2d6a69fc93ed912be3eade839130dcb9f9868b07fe52aefd5e6989dd239cf7c893611cad9388934290612937565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1790529151600092839290871691611e64919061295a565b6000604051808303816000865af19150503d8060008114611ea1576040519150601f19603f3d011682016040523d82523d6000602084013e611ea6565b606091505b5091509150818015611ed0575080511580611ed0575080806020019051810190611ed09190612989565b6112a05760405162461bcd60e51b815260206004820152600260248201526114d560f21b6044820152606401610850565b600081815260018301602052604081205415155b9392505050565b6000610802825490565b6000611f158383612267565b60606000611f1583612291565b60008111611f8b5760405162461bcd60e51b815260206004820152601960248201527817dcdd185ad94e881e995c9bc81cdd185ad948185b5bdd5b9d603a1b6044820152606401610850565b611f936121fd565b6001600160a01b0382166000908152600260208181526040928390208351608081018552815481526001820154928101929092529182015492810192909252600390810154606083015254611fe99082906121b5565b6040820152805182908290611fff908390612796565b9052506003805460208084019182526001600160a01b03861660009081526002918290526040808220865181559351600180860191909155908601519284019290925560608501519290930191909155805484929061205f908490612796565b909155505060055460035460408084015190516001600160a01b038716937fc6f8dbf1fa0a0918d52df74fa2b529a0a4da7011a24f263a28678e7504444cd693611cad9388934290612937565b6000816001600160401b0316116121055760405162461bcd60e51b815260206004820152601a60248201527f5f736574526577617264733a207a65726f206475726174696f6e0000000000006044820152606401610850565b61210d6121fd565b806001600160401b0316826001600160401b03166b1d6329f1c35ca4bfabb9f56160281b61213b9190612892565b6121459190612870565b600055600554600354604080516001600160401b038087168252851660208201529081019290925260608201524260808201527f47fbe7c141b1c839fb769baac6cfab5d1649ce17d04dd7c11db5c86b0d6a623e9060a00160405180910390a15050565b6000611f1583836122ed565b815160208301516000916b1d6329f1c35ca4bfabb9f56160281b916121da9085612783565b6121e49190612892565b6121ee9190612870565b8360400151611f159190612796565b6000612207610d65565b90506b1d6329f1c35ca4bfabb9f56160281b600154826122279190612892565b6122319190612870565b600560008282546122429190612796565b92505081905550806003600082825461225b9190612796565b90915550504260045550565b600082600001828154811061227e5761227e612841565b9060005260206000200154905092915050565b6060816000018054806020026020016040519081016040528092919081815260200182805480156122e157602002820191906000526020600020905b8154815260200190600101908083116122cd575b50505050509050919050565b600081815260018301602052604081205461233457508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610802565b506000610802565b80356001600160a01b038116811461235357600080fd5b919050565b6000806040838503121561236b57600080fd5b6123748361233c565b946020939093013593505050565b60006020828403121561239457600080fd5b611f158261233c565b80151581146123ab57600080fd5b50565b600080604083850312156123c157600080fd5b6123ca8361233c565b915060208301356123da8161239d565b809150509250929050565b6000602082840312156123f757600080fd5b5035919050565b6001600160a01b0391909116815260200190565b60008060006060848603121561242757600080fd5b6124308461233c565b925061243e6020850161233c565b9150604084013590509250925092565b6000806040838503121561246157600080fd5b50508035926020909101359150565b600081518084526020808501945080840160005b838110156124a057815187529582019590820190600101612484565b509495945050505050565b848152600060208581840152608060408401526124cb6080840186612470565b838103606085015284518082528286019183019060005b818110156124fe578351835292840192918401916001016124e2565b50909998505050505050505050565b6000806040838503121561252057600080fd5b6125298361233c565b91506125376020840161233c565b90509250929050565b80356001600160401b038116811461235357600080fd5b6000806040838503121561256a57600080fd5b61257383612540565b915061253760208401612540565b60008083601f84011261259357600080fd5b5081356001600160401b038111156125aa57600080fd5b6020830191508360208260051b85010111156125c557600080fd5b9250929050565b600080600080604085870312156125e257600080fd5b84356001600160401b03808211156125f957600080fd5b61260588838901612581565b9096509450602087013591508082111561261e57600080fd5b5061262b87828801612581565b95989497509550505050565b634e487b7160e01b600052604160045260246000fd5b60008060006060848603121561266257600080fd5b833592506020808501356001600160401b038082111561268157600080fd5b818701915087601f83011261269557600080fd5b8135818111156126a7576126a7612637565b8060051b604051601f19603f830116810181811085821117156126cc576126cc612637565b60405291825284820192508381018501918a8311156126ea57600080fd5b938501935b82851015612708578435845293850193928501926126ef565b979a979950505050604095909501359450505050565b6000806040838503121561273157600080fd5b823591506125376020840161233c565b60008060006060848603121561275657600080fd5b505081359360208301359350604090920135919050565b634e487b7160e01b600052601160045260246000fd5b818103818111156108025761080261276d565b808201808211156108025761080261276d565b60208082526017908201527621b0b63632b91034b9903737ba103a34329037bbb732b960491b604082015260600190565b6000602082840312156127ec57600080fd5b815165ffffffffffff81168114611f1557600080fd5b60006020828403121561281457600080fd5b5051919050565b6001600160a01b0394909416845260208401929092526040830152606082015260800190565b634e487b7160e01b600052603260045260246000fd5b6000600182016128695761286961276d565b5060010190565b60008261288d57634e487b7160e01b600052601260045260246000fd5b500490565b80820281158282048414176108025761080261276d565b6020808252600e908201526d141bdbdb081b9bdd08199bdd5b9960921b604082015260600190565b6000816128e0576128e061276d565b506000190190565b6020808252600d908201526c115c9c9bdc881c195c98d95b9d609a1b604082015260600190565b83815282602082015260606040820152600061292e6060830184612470565b95945050505050565b948552602085019390935260408401919091526060830152608082015260a00190565b6000825160005b8181101561297b5760208186018101518583015201612961565b506000920191825250919050565b60006020828403121561299b57600080fd5b8151611f158161239d56fea2646970667358221220a4fdd4acee9835031d2e8e5a70798866672f5f39bb4dbe7ec1768b63858553c664736f6c63430008130033000000000000000000000000f05f7a9f018b572aaf55e49d6cea49c3ac4bb51d000000000000000000000000857851ee6e398651cb7c72462cc7ce2a94d8f1c6

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102485760003560e01c806397b0f2051161013b578063c00007b0116100b8578063d9a755721161007c578063d9a755721461060c578063e276edb314610637578063f9e912241461064a578063fc19fd8914610675578063fe4d47cf1461068857600080fd5b8063c00007b014610544578063cf5e551f14610557578063d14b85b914610582578063d6d31ae1146105a2578063d914cd4b146105f957600080fd5b8063b0d354ed116100ff578063b0d354ed146104ed578063b2884a0414610500578063b2d7601f14610509578063b42754a514610511578063be83808b1461053157600080fd5b806397b0f2051461046d578063a06e9eb114610480578063a87430ba14610493578063ad60346a146104b3578063ad8bd2c1146104c657600080fd5b806349516370116101c95780637a7664601161018d5780637a766460146103f35780637b0a47ee1461041c5780637ba625131461042557806382d692811461043857806389b688b31461046457600080fd5b8063495163701461036357806353da67f61461038a5780635b18107d146103ad5780635f74bbde146103b5578063722b0717146103c857600080fd5b80632a48235b116102105780632a48235b146102d75780632f2d783d1461030d5780633f3bd330146103205780634272e7d71461032957806342d79d9c1461035057600080fd5b806302aa9be21461024d57806316cc05cd1461026257806319287d53146102885780631d6e13411461029b57806320fb629d146102ce575b600080fd5b61026061025b366004612358565b61069b565b005b610275610270366004612382565b6107d3565b6040519081526020015b60405180910390f35b6102606102963660046123ae565b610808565b6102be6102a9366004612382565b600b6020526000908152604090205460ff1681565b604051901515815260200161027f565b61027560045481565b6103006102e53660046123e5565b6007602052600090815260409020546001600160a01b031681565b60405161027f91906123fe565b61026061031b366004612412565b610884565b61027560035481565b6103007f0000000000000000000000000258f474786ddfd37abce6df6bbb1dd5dfc4434a81565b61026061035e36600461244e565b610931565b6103007f000000000000000000000000857851ee6e398651cb7c72462cc7ce2a94d8f1c681565b61039d6103983660046123e5565b610c4f565b60405161027f94939291906124ab565b610275610d65565b6102606103c3366004612358565b610da2565b6102756103d6366004612358565b600f60209081526000928352604080842090915290825290205481565b610275610401366004612382565b6001600160a01b031660009081526002602052604090205490565b61027560005481565b61026061043336600461250d565b610f49565b610275610446366004612382565b6001600160a01b031660009081526002602052604090206003015490565b61027560015481565b61026061047b366004612382565b610fb4565b61026061048e366004612557565b6110f7565b6102756104a1366004612382565b60096020526000908152604090205481565b6102606104c1366004612358565b61114d565b6103007f000000000000000000000000f05f7a9f018b572aaf55e49d6cea49c3ac4bb51d81565b6102606104fb3660046125cc565b61121c565b61027560065481565b6102756112a7565b61027561051f366004612382565b60086020526000908152604090205481565b61026061053f36600461264d565b6112e9565b610275610552366004612382565b6114ba565b61027561056536600461250d565b600a60209081526000928352604080842090915290825290205481565b6102756105903660046123e5565b600d6020526000908152604090205481565b6105d96105b0366004612382565b600260208190526000918252604090912080546001820154928201546003909201549092919084565b60408051948552602085019390935291830152606082015260800161027f565b610260610607366004612382565b611539565b61027561061a36600461271e565b600e60209081526000928352604080842090915290825290205481565b610260610645366004612358565b611608565b6102be610658366004612382565b6001600160a01b0316600090815260086020526040902054151590565b610260610683366004612382565b6116d7565b610260610696366004612741565b611882565b336000908152600a602090815260408083206001600160a01b038616845290915290205481101561070457336000908152600a602090815260408083206001600160a01b0386168452909152812080548392906106f9908490612783565b9091555061072e9050565b50336000908152600a602090815260408083206001600160a01b0385168452909152812080549190555b3360009081526009602052604090205481101561076f573360009081526009602052604081208054839290610764908490612783565b909155506107859050565b5033600090815260096020526040812080549190555b61078f8282611b44565b60405181815233906001600160a01b038416907faa0e554f781c3c3b2be110a0557f260f11af9a8aa2c64bc1e7a31dbb21e32fa29060200160405180910390a35050565b6001600160a01b0381166000908152600260205260408120600301546107f8836114ba565b6108029190612796565b92915050565b336001600160a01b037f000000000000000000000000857851ee6e398651cb7c72462cc7ce2a94d8f1c616146108595760405162461bcd60e51b8152600401610850906127a9565b60405180910390fd5b6001600160a01b03919091166000908152600b60205260409020805460ff1916911515919091179055565b336000908152600b602052604090205460ff166108f75760405162461bcd60e51b815260206004820152602b60248201527f636c61696d5265776172643a2063616c6c6572206e6f7420666f756e6420696e60448201526a081dda1a5d19481b1a5cdd60aa1b6064820152608401610850565b6109018382611cba565b61092c7f0000000000000000000000000258f474786ddfd37abce6df6bbb1dd5dfc4434a8383611e08565b505050565b6000828152600c6020526040812080549091036109615760405163168377c160e21b815260040160405180910390fd5b428160030154116109855760405163f81f40e760e01b815260040160405180910390fd5b6109926001820183611f01565b6109af5760405163171cd29360e11b815260040160405180910390fd5b60405163a4beda6360e01b81526000906001600160a01b037f000000000000000000000000f05f7a9f018b572aaf55e49d6cea49c3ac4bb51d169063a4beda63906109fe9033906004016123fe565b602060405180830381865afa158015610a1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3f91906127da565b65ffffffffffff1690508160030154811015610a6e576040516301a20e9f60e21b815260040160405180910390fd5b336000908152600f602090815260408083208784529091529020548015801590610a985750838114155b15610ab657604051636ab144a760e01b815260040160405180910390fd5b60405163138cce3960e21b81526000906001600160a01b037f000000000000000000000000f05f7a9f018b572aaf55e49d6cea49c3ac4bb51d1690634e3338e490610b059033906004016123fe565b602060405180830381865afa158015610b22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b469190612802565b6000878152600e60209081526040808320338452909152902054909150808211610b835760405163eb20971160e01b815260040160405180910390fd5b6040805160208082018a905281830189905282518083038401815260609092019092528051910120610bb58284612783565b6000828152600d602052604081208054909190610bd3908490612796565b90915550506000888152600e6020908152604080832033808552908352818420879055600f83528184208c85529092529182902089905590517fe3d746913bf71cb9e517188584770f4a9d51da13a032cc59abcc0ebfc8a48bd391610c3d918b908b90889061281b565b60405180910390a15050505050505050565b6000818152600c602052604081208190606090819083610c7160018301611f1c565b90506000816001600160401b03811115610c8d57610c8d612637565b604051908082528060200260200182016040528015610cb6578160200160208202803683370190505b50905060005b82811015610d4057600089610cd46001870184611f26565b604080516020810193909352820152606001604051602081830303815290604052805190602001209050600d600082815260200190815260200160002054838381518110610d2457610d24612841565b602090810291909101015250610d3981612857565b9050610cbc565b50878360030154610d5385600101611f32565b91985096509450925050509193509193565b600154600090819015610d8557600154600054610d829190612870565b90505b600454610d929042612783565b610d9c9082612892565b91505090565b6001600160a01b038216600090815260086020526040902054610dd75760405162461bcd60e51b8152600401610850906128a9565b60405163138cce3960e21b81526000906001600160a01b037f000000000000000000000000f05f7a9f018b572aaf55e49d6cea49c3ac4bb51d1690634e3338e490610e269033906004016123fe565b602060405180830381865afa158015610e43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e679190612802565b3360009081526009602052604081205491925081831115610e8f57610e8c8284612783565b90505b80841115610e9b578093505b3360009081526009602052604081208054869290610eba908490612796565b9091555050336000908152600a602090815260408083206001600160a01b038916845290915281208054869290610ef2908490612796565b90915550610f0290508585611f3f565b60405184815233906001600160a01b038716907f66a9138482c99e9baf08860110ef332cc0c23b4a199a53593d8db0fc8f96fbfc9060200160405180910390a35050505050565b610f5282611539565b604051631ee1f46360e21b81526001600160a01b03821690637b87d18c90610f7e9085906004016123fe565b600060405180830381600087803b158015610f9857600080fd5b505af1158015610fac573d6000803e3d6000fd5b505050505050565b336001600160a01b037f000000000000000000000000857851ee6e398651cb7c72462cc7ce2a94d8f1c61614610ffc5760405162461bcd60e51b8152600401610850906127a9565b6001600160a01b038116600090815260086020526040902054806110325760405162461bcd60e51b8152600401610850906128a9565b6001600160a01b03828116600090815260086020818152604080842084905560068054855260078084528286205488875283872080549189166001600160a01b031992831617905582548752838720549097168652938352818520879055805485529290915282208054909316909255815491906110af836128d1565b9091555050604051600081526001600160a01b038316907f378333f475b147b091d9370fe9192b22d3701547af05b7d0d5b37bb90eb1ee7b9060200160405180910390a25050565b336001600160a01b037f000000000000000000000000857851ee6e398651cb7c72462cc7ce2a94d8f1c6161461113f5760405162461bcd60e51b8152600401610850906127a9565b61114982826120ac565b5050565b61271081111561116f5760405162461bcd60e51b8152600401610850906128e8565b60405163138cce3960e21b81526000906001600160a01b037f000000000000000000000000f05f7a9f018b572aaf55e49d6cea49c3ac4bb51d1690634e3338e4906111be9033906004016123fe565b602060405180830381865afa1580156111db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ff9190612802565b905061092c836127106112128585612892565b6103c39190612870565b82811461123b5760405162461bcd60e51b8152600401610850906128a9565b60005b838110156112a05761128e85858381811061125b5761125b612841565b90506020020160208101906112709190612382565b84848481811061128257611282612841565b90506020020135610da2565b8061129881612857565b91505061123e565b5050505050565b6000806112b2610d65565b90506b1d6329f1c35ca4bfabb9f56160281b600154826112d29190612892565b6112dc9190612870565b600554610d9c9190612796565b336001600160a01b037f000000000000000000000000857851ee6e398651cb7c72462cc7ce2a94d8f1c616146113315760405162461bcd60e51b8152600401610850906127a9565b6000839003611353576040516392bf449d60e01b815260040160405180910390fd5b600a8251111561137657604051630fb3e39160e21b815260040160405180910390fd5b8151600003611398576040516322d1e01760e21b815260040160405180910390fd5b4281116113b85760405163f81f40e760e01b815260040160405180910390fd5b6000838152600c602052604090208054156113e657604051635a624d3560e01b815260040160405180910390fd5b8381556003810182905560005b835181101561147857600084828151811061141057611410612841565b60200260200101519050806000801b0361143d576040516392bf449d60e01b815260040160405180910390fd5b61144a60018401826121a9565b61146757604051635573919d60e01b815260040160405180910390fd5b5061147181612857565b90506113f3565b507fa701e472fa152d5473dee7bfe18c621a6bdabe61460a9fb7b75e26e3cf3513be8483856040516114ac9392919061290f565b60405180910390a150505050565b6001600160a01b03811660009081526002602081815260408084208151608081018352815481526001820154938101939093529283015490820152600390910154606082015281611509610d65565b6003546115169190612796565b9050816060015161152783836121b5565b6115319190612783565b949350505050565b336001600160a01b037f000000000000000000000000857851ee6e398651cb7c72462cc7ce2a94d8f1c616146115815760405162461bcd60e51b8152600401610850906127a9565b6006805490600061159183612857565b90915550506006546001600160a01b0382166000818152600860209081526040808320859055938252600781529083902080546001600160a01b0319168317905591516001815290917f378333f475b147b091d9370fe9192b22d3701547af05b7d0d5b37bb90eb1ee7b910160405180910390a250565b61271081111561162a5760405162461bcd60e51b8152600401610850906128e8565b60405163138cce3960e21b81526000906001600160a01b037f000000000000000000000000f05f7a9f018b572aaf55e49d6cea49c3ac4bb51d1690634e3338e4906116799033906004016123fe565b602060405180830381865afa158015611696573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ba9190612802565b905061092c836127106116cd8585612892565b61025b9190612870565b336001600160a01b037f000000000000000000000000f05f7a9f018b572aaf55e49d6cea49c3ac4bb51d1614806117165750336001600160a01b038216145b6117765760405162461bcd60e51b815260206004820152602b60248201527f756e766f7465416c6c3a2063616c6c6572206973206e6f74207468652076654f60448201526a14938818dbdb9d1c9858dd60aa1b6064820152608401610850565b6001600160a01b03811660009081526009602052604090205480156111495760065460015b81811161183b576000818152600760209081526040808320546001600160a01b038881168552600a845282852091168085529252909120548015611826576001600160a01b038087166000908152600a6020908152604080832093861683529290529081205561180b8282611b44565b6118158186612783565b94508460000361182657505061183b565b5050808061183390612857565b91505061179b565b506001600160a01b038316600081815260096020526040808220829055517f6c0ea4a9e85d6833d8071c741ee831d8793bad403b0de52072f8932ca1df8b819190a2505050565b6000838152600c6020526040812080549091036118b25760405163168377c160e21b815260040160405180910390fd5b428160030154116118d65760405163f81f40e760e01b815260040160405180910390fd5b6118e36001820184611f01565b6119005760405163171cd29360e11b815260040160405180910390fd5b61190d6001820183611f01565b61192a5760405163171cd29360e11b815260040160405180910390fd5b6000848152600e602090815260408083203384529091528120549081900361196557604051633daaf28760e11b815260040160405180910390fd5b60405163138cce3960e21b81526000906001600160a01b037f000000000000000000000000f05f7a9f018b572aaf55e49d6cea49c3ac4bb51d1690634e3338e4906119b49033906004016123fe565b602060405180830381865afa1580156119d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119f59190612802565b905060008686604051602001611a15929190918252602082015260400190565b60405160208183030381529060405280519060200120905082600d60008381526020019081526020016000206000828254611a509190612783565b90915550506040805160208082018a9052818301889052825180830384018152606090920183528151918101919091206000818152600d9092529181208054859290611a9d908490612796565b90915550506000888152600e6020908152604080832033808552908352818420879055600f83528184208c85529092529182902088905590517f174fc560a38f441b3fde0eb1817131d9f63632f5ff6662ec1cd9fff43eaa068291611b07918b908b90899061281b565b60405180910390a17fe3d746913bf71cb9e517188584770f4a9d51da13a032cc59abcc0ebfc8a48bd333898886604051610c3d949392919061281b565b611b4c6121fd565b6001600160a01b038216600090815260026020818152604092839020835160808101855281548082526001830154938201939093529281015493830193909352600390920154606082015290821115611bde5760405162461bcd60e51b8152602060048201526014602482015273115c9c9bdc881d5b9cdd185ad948185b5bdd5b9d60621b6044820152606401610850565b611bea816003546121b5565b6040820152805182908290611c00908390612783565b9052506003805460208084019182526001600160a01b038616600090815260029182905260408082208651815593516001808601919091559086015192840192909255606085015192909301919091558054849290611c60908490612783565b909155505060055460035460408084015190516001600160a01b038716937f2ae77851d374757c0aeee19fd5d8f75edac9f1f52043fb96992607c29373144193611cad9388934290612937565b60405180910390a2505050565b611cc26121fd565b6001600160a01b0382166000908152600260208181526040928390208351608081018552815481526001820154928101929092529182015492810192909252600390810154606083015254611d189082906121b5565b6040820181905260608201518391611d309190612783565b1015611d735760405162461bcd60e51b8152602060048201526012602482015271115c9c9bdc8818db185a5b48185b5bdd5b9d60721b6044820152606401610850565b8181606001818151611d859190612796565b9052506003805460208084019182526001600160a01b03861660008181526002928390526040908190208651815593516001850155808601519284018390556060860151938501939093556005549354925190937f2d6a69fc93ed912be3eade839130dcb9f9868b07fe52aefd5e6989dd239cf7c893611cad9388934290612937565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1790529151600092839290871691611e64919061295a565b6000604051808303816000865af19150503d8060008114611ea1576040519150601f19603f3d011682016040523d82523d6000602084013e611ea6565b606091505b5091509150818015611ed0575080511580611ed0575080806020019051810190611ed09190612989565b6112a05760405162461bcd60e51b815260206004820152600260248201526114d560f21b6044820152606401610850565b600081815260018301602052604081205415155b9392505050565b6000610802825490565b6000611f158383612267565b60606000611f1583612291565b60008111611f8b5760405162461bcd60e51b815260206004820152601960248201527817dcdd185ad94e881e995c9bc81cdd185ad948185b5bdd5b9d603a1b6044820152606401610850565b611f936121fd565b6001600160a01b0382166000908152600260208181526040928390208351608081018552815481526001820154928101929092529182015492810192909252600390810154606083015254611fe99082906121b5565b6040820152805182908290611fff908390612796565b9052506003805460208084019182526001600160a01b03861660009081526002918290526040808220865181559351600180860191909155908601519284019290925560608501519290930191909155805484929061205f908490612796565b909155505060055460035460408084015190516001600160a01b038716937fc6f8dbf1fa0a0918d52df74fa2b529a0a4da7011a24f263a28678e7504444cd693611cad9388934290612937565b6000816001600160401b0316116121055760405162461bcd60e51b815260206004820152601a60248201527f5f736574526577617264733a207a65726f206475726174696f6e0000000000006044820152606401610850565b61210d6121fd565b806001600160401b0316826001600160401b03166b1d6329f1c35ca4bfabb9f56160281b61213b9190612892565b6121459190612870565b600055600554600354604080516001600160401b038087168252851660208201529081019290925260608201524260808201527f47fbe7c141b1c839fb769baac6cfab5d1649ce17d04dd7c11db5c86b0d6a623e9060a00160405180910390a15050565b6000611f1583836122ed565b815160208301516000916b1d6329f1c35ca4bfabb9f56160281b916121da9085612783565b6121e49190612892565b6121ee9190612870565b8360400151611f159190612796565b6000612207610d65565b90506b1d6329f1c35ca4bfabb9f56160281b600154826122279190612892565b6122319190612870565b600560008282546122429190612796565b92505081905550806003600082825461225b9190612796565b90915550504260045550565b600082600001828154811061227e5761227e612841565b9060005260206000200154905092915050565b6060816000018054806020026020016040519081016040528092919081815260200182805480156122e157602002820191906000526020600020905b8154815260200190600101908083116122cd575b50505050509050919050565b600081815260018301602052604081205461233457508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610802565b506000610802565b80356001600160a01b038116811461235357600080fd5b919050565b6000806040838503121561236b57600080fd5b6123748361233c565b946020939093013593505050565b60006020828403121561239457600080fd5b611f158261233c565b80151581146123ab57600080fd5b50565b600080604083850312156123c157600080fd5b6123ca8361233c565b915060208301356123da8161239d565b809150509250929050565b6000602082840312156123f757600080fd5b5035919050565b6001600160a01b0391909116815260200190565b60008060006060848603121561242757600080fd5b6124308461233c565b925061243e6020850161233c565b9150604084013590509250925092565b6000806040838503121561246157600080fd5b50508035926020909101359150565b600081518084526020808501945080840160005b838110156124a057815187529582019590820190600101612484565b509495945050505050565b848152600060208581840152608060408401526124cb6080840186612470565b838103606085015284518082528286019183019060005b818110156124fe578351835292840192918401916001016124e2565b50909998505050505050505050565b6000806040838503121561252057600080fd5b6125298361233c565b91506125376020840161233c565b90509250929050565b80356001600160401b038116811461235357600080fd5b6000806040838503121561256a57600080fd5b61257383612540565b915061253760208401612540565b60008083601f84011261259357600080fd5b5081356001600160401b038111156125aa57600080fd5b6020830191508360208260051b85010111156125c557600080fd5b9250929050565b600080600080604085870312156125e257600080fd5b84356001600160401b03808211156125f957600080fd5b61260588838901612581565b9096509450602087013591508082111561261e57600080fd5b5061262b87828801612581565b95989497509550505050565b634e487b7160e01b600052604160045260246000fd5b60008060006060848603121561266257600080fd5b833592506020808501356001600160401b038082111561268157600080fd5b818701915087601f83011261269557600080fd5b8135818111156126a7576126a7612637565b8060051b604051601f19603f830116810181811085821117156126cc576126cc612637565b60405291825284820192508381018501918a8311156126ea57600080fd5b938501935b82851015612708578435845293850193928501926126ef565b979a979950505050604095909501359450505050565b6000806040838503121561273157600080fd5b823591506125376020840161233c565b60008060006060848603121561275657600080fd5b505081359360208301359350604090920135919050565b634e487b7160e01b600052601160045260246000fd5b818103818111156108025761080261276d565b808201808211156108025761080261276d565b60208082526017908201527621b0b63632b91034b9903737ba103a34329037bbb732b960491b604082015260600190565b6000602082840312156127ec57600080fd5b815165ffffffffffff81168114611f1557600080fd5b60006020828403121561281457600080fd5b5051919050565b6001600160a01b0394909416845260208401929092526040830152606082015260800190565b634e487b7160e01b600052603260045260246000fd5b6000600182016128695761286961276d565b5060010190565b60008261288d57634e487b7160e01b600052601260045260246000fd5b500490565b80820281158282048414176108025761080261276d565b6020808252600e908201526d141bdbdb081b9bdd08199bdd5b9960921b604082015260600190565b6000816128e0576128e061276d565b506000190190565b6020808252600d908201526c115c9c9bdc881c195c98d95b9d609a1b604082015260600190565b83815282602082015260606040820152600061292e6060830184612470565b95945050505050565b948552602085019390935260408401919091526060830152608082015260a00190565b6000825160005b8181101561297b5760208186018101518583015201612961565b506000920191825250919050565b60006020828403121561299b57600080fd5b8151611f158161239d56fea2646970667358221220a4fdd4acee9835031d2e8e5a70798866672f5f39bb4dbe7ec1768b63858553c664736f6c63430008130033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000f05f7a9f018b572aaf55e49d6cea49c3ac4bb51d000000000000000000000000857851ee6e398651cb7c72462cc7ce2a94d8f1c6

-----Decoded View---------------
Arg [0] : veORN_ (address): 0xF05f7a9f018B572aaF55E49d6ceA49C3Ac4bb51D
Arg [1] : owner (address): 0x857851EE6E398651Cb7C72462cc7Ce2A94d8f1C6

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000f05f7a9f018b572aaf55e49d6cea49c3ac4bb51d
Arg [1] : 000000000000000000000000857851ee6e398651cb7c72462cc7ce2a94d8f1c6


Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
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.