@sharkpunks/contracts
Version:
[](http://www.wtfpl.net/)
534 lines • 46.9 kB
JSON
{
"address": "0xf62cd7C8f3A965c3252270d668c7BeBEa1DD1abb",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_vault",
"type": "address"
},
{
"internalType": "address",
"name": "_ve",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint256",
"name": "rewardId",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "veSupply",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "block",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"name": "AddReward",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint256",
"name": "rewardId",
"type": "uint256"
},
{
"indexed": true,
"internalType": "address",
"name": "account",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "address",
"name": "recipient",
"type": "address"
}
],
"name": "Claim",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "Receive",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint256",
"name": "rewardId",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "address",
"name": "recipient",
"type": "address"
}
],
"name": "Withdraw",
"type": "event"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"name": "addReward",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "amountClaimed",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "rewardId",
"type": "uint256"
},
{
"internalType": "address",
"name": "recipient",
"type": "address"
}
],
"name": "claim",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "rewards",
"outputs": [
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "veSupply",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "block",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountClaimed",
"type": "uint256"
},
{
"internalType": "bool",
"name": "withdrawn",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "rewardsLength",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "vault",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "ve",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "rewardId",
"type": "uint256"
},
{
"internalType": "address",
"name": "recipient",
"type": "address"
}
],
"name": "withdraw",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
}
],
"transactionHash": "0x962e793a30e18f94e3909909cede02ee8cf9c06fa7b24055cb57645ea4cd0206",
"receipt": {
"to": null,
"from": "0x5b8C253517b6Bd003369173109693B01cb6841B5",
"contractAddress": "0xf62cd7C8f3A965c3252270d668c7BeBEa1DD1abb",
"transactionIndex": 242,
"gasUsed": "840594",
"logsBloom": "0x00000000000000000100000000000000000000000000000000900000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000001000000000000080000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000020000000000000000000000000080000000000000000000000000000000000000000",
"blockHash": "0xb3c58428edfc1bf1c82167ff084e286841eab8f4ac8736613adab72dc304b874",
"transactionHash": "0x962e793a30e18f94e3909909cede02ee8cf9c06fa7b24055cb57645ea4cd0206",
"logs": [
{
"transactionIndex": 242,
"blockNumber": 15002654,
"transactionHash": "0x962e793a30e18f94e3909909cede02ee8cf9c06fa7b24055cb57645ea4cd0206",
"address": "0xf62cd7C8f3A965c3252270d668c7BeBEa1DD1abb",
"topics": [
"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000005b8c253517b6bd003369173109693b01cb6841b5"
],
"data": "0x",
"logIndex": 334,
"blockHash": "0xb3c58428edfc1bf1c82167ff084e286841eab8f4ac8736613adab72dc304b874"
}
],
"blockNumber": 15002654,
"cumulativeGasUsed": "17440220",
"status": 1,
"byzantium": true
},
"args": [
"0x293Ae5226D3Bda6969348D8b211A73Ad7Cafb7Ea",
"0x77D3d884FeA1E389150a26D4569b20ebA284A86d"
],
"solcInputHash": "d7b0c161d3b544074dfaa4c3a3ff6874",
"metadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vault\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_ve\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"rewardId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"veSupply\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"block\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"AddReward\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"rewardId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"Claim\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Receive\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"rewardId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"Withdraw\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"addReward\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"amountClaimed\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"rewardId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"claim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"rewards\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"veSupply\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"block\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountClaimed\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"withdrawn\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rewardsLength\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vault\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ve\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"rewardId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/VERewardDistributor.sol\":\"VERewardDistributor\"},\"evmVersion\":\"london\",\"libraries\":{\":__CACHE_BREAKER__\":\"0x00000000d41867734bbee4c6863d9255b2b06ac1\"},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@levxdao/ve/contracts/interfaces/IVotingEscrow.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\ninterface IVotingEscrow {\\n event SetMigrator(address indexed account);\\n event SetDelegate(address indexed account, bool isDelegate);\\n event Deposit(\\n address indexed provider,\\n uint256 value,\\n uint256 discount,\\n uint256 indexed unlockTime,\\n int128 indexed _type,\\n uint256 ts\\n );\\n event Cancel(address indexed provider, uint256 value, uint256 discount, uint256 penaltyRate, uint256 ts);\\n event Withdraw(address indexed provider, uint256 value, uint256 discount, uint256 ts);\\n event Migrate(address indexed provider, uint256 value, uint256 discount, uint256 ts);\\n event Supply(uint256 prevSupply, uint256 supply);\\n\\n function interval() external view returns (uint256);\\n\\n function maxDuration() external view returns (uint256);\\n\\n function token() external view returns (address);\\n\\n function name() external view returns (string memory);\\n\\n function symbol() external view returns (string memory);\\n\\n function decimals() external view returns (uint8);\\n\\n function migrator() external view returns (address);\\n\\n function isDelegate(address account) external view returns (bool);\\n\\n function supply() external view returns (uint256);\\n\\n function migrated(address account) external view returns (bool);\\n\\n function delegateAt(address account, uint256 index) external view returns (address);\\n\\n function locked(address account)\\n external\\n view\\n returns (\\n int128 amount,\\n int128 discount,\\n uint256 start,\\n uint256 end\\n );\\n\\n function epoch() external view returns (uint256);\\n\\n function pointHistory(uint256 epoch)\\n external\\n view\\n returns (\\n int128 bias,\\n int128 slope,\\n uint256 ts,\\n uint256 blk\\n );\\n\\n function userPointHistory(address account, uint256 epoch)\\n external\\n view\\n returns (\\n int128 bias,\\n int128 slope,\\n uint256 ts,\\n uint256 blk\\n );\\n\\n function userPointEpoch(address account) external view returns (uint256);\\n\\n function slopeChanges(uint256 epoch) external view returns (int128);\\n\\n function delegateLength(address addr) external view returns (uint256);\\n\\n function getLastUserSlope(address addr) external view returns (int128);\\n\\n function getCheckpointTime(address _addr, uint256 _idx) external view returns (uint256);\\n\\n function unlockTime(address _addr) external view returns (uint256);\\n\\n function setMigrator(address _migrator) external;\\n\\n function setDelegate(address account, bool _isDelegate) external;\\n\\n function checkpoint() external;\\n\\n function depositFor(address _addr, uint256 _value) external;\\n\\n function createLockFor(\\n address _addr,\\n uint256 _value,\\n uint256 _discount,\\n uint256 _duration\\n ) external;\\n\\n function createLock(uint256 _value, uint256 _duration) external;\\n\\n function increaseAmountFor(\\n address _addr,\\n uint256 _value,\\n uint256 _discount\\n ) external;\\n\\n function increaseAmount(uint256 _value) external;\\n\\n function increaseUnlockTime(uint256 _duration) external;\\n\\n function cancel() external;\\n\\n function withdraw() external;\\n\\n function migrate() external;\\n\\n function balanceOf(address addr) external view returns (uint256);\\n\\n function balanceOf(address addr, uint256 _t) external view returns (uint256);\\n\\n function balanceOfAt(address addr, uint256 _block) external view returns (uint256);\\n\\n function totalSupply() external view returns (uint256);\\n\\n function totalSupply(uint256 t) external view returns (uint256);\\n\\n function totalSupplyAt(uint256 _block) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x3ac00d3de6b34a0c5cb777b5e9477af3982061f7e9021848dc662508f1cf0f1b\",\"license\":\"UNLICENSED\"},\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0x24e0364e503a9bbde94c715d26573a76f14cd2a202d45f96f52134ab806b67b9\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/VERewardDistributor.sol\":{\"content\":\"// SPDX-License-Identifier: WTFPL\\n\\npragma solidity ^0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"@levxdao/ve/contracts/interfaces/IVotingEscrow.sol\\\";\\nimport \\\"./interfaces/IETHVault.sol\\\";\\n\\ncontract VERewardDistributor is Ownable {\\n struct Reward {\\n uint256 amount;\\n uint256 veSupply;\\n uint256 block;\\n uint256 deadline;\\n uint256 amountClaimed;\\n bool withdrawn;\\n }\\n\\n address public immutable vault;\\n address public immutable ve;\\n\\n Reward[] public rewards;\\n mapping(uint256 => mapping(address => uint256)) public amountClaimed;\\n\\n event Receive(address indexed from, uint256 amount);\\n event AddReward(uint256 indexed rewardId, uint256 amount, uint256 veSupply, uint256 block, uint256 deadline);\\n event Withdraw(uint256 indexed rewardId, uint256 amount, address recipient);\\n event Claim(uint256 indexed rewardId, address indexed account, uint256 amount, address recipient);\\n\\n constructor(address _vault, address _ve) {\\n vault = _vault;\\n ve = _ve;\\n }\\n\\n receive() external payable {\\n emit Receive(msg.sender, msg.value);\\n }\\n\\n function rewardsLength() external view returns (uint256) {\\n return rewards.length;\\n }\\n\\n function addReward(\\n uint256 amount,\\n uint256 blockNumber,\\n uint256 deadline\\n ) external onlyOwner {\\n require(amount > 0, \\\"VERD: INVALID_REWARD_ID\\\");\\n require(blockNumber <= block.number, \\\"VERD: INVALID_BLOCK_NUMBER\\\");\\n require(deadline > block.number, \\\"VERD: INVALID_DEADLINE\\\");\\n\\n IETHVault(vault).withdraw(amount, address(this));\\n\\n uint256 veSupply = IVotingEscrow(ve).totalSupplyAt(blockNumber);\\n uint256 rewardId = rewards.length;\\n rewards.push(Reward(amount, veSupply, blockNumber, deadline, 0, false));\\n\\n emit AddReward(rewardId, amount, veSupply, blockNumber, deadline);\\n }\\n\\n function withdraw(uint256 rewardId, address recipient) external onlyOwner {\\n Reward storage reward = rewards[rewardId];\\n require(!reward.withdrawn, \\\"VERD: WITHDRAWN\\\");\\n require(reward.deadline <= block.timestamp, \\\"VERD: NOT_EXPIRED\\\");\\n\\n reward.withdrawn = true;\\n\\n uint256 amount = reward.amount - reward.amountClaimed;\\n emit Withdraw(rewardId, amount, recipient);\\n payable(recipient).transfer(amount);\\n }\\n\\n function claim(uint256 rewardId, address recipient) external {\\n require(amountClaimed[rewardId][msg.sender] == 0, \\\"VERD: CLAIMED\\\");\\n\\n Reward storage reward = rewards[rewardId];\\n require(block.timestamp < reward.deadline, \\\"VERD: EXPIRED\\\");\\n\\n uint256 _block = reward.block;\\n uint256 balance = IVotingEscrow(ve).balanceOfAt(msg.sender, _block);\\n require(balance > 0, \\\"VERD: INSUFFICIENT_BALANCE\\\");\\n\\n uint256 amount = (balance * reward.amount) / reward.veSupply;\\n reward.amountClaimed += amount;\\n amountClaimed[rewardId][msg.sender] = amount;\\n\\n if (recipient == address(0)) recipient = msg.sender;\\n emit Claim(rewardId, msg.sender, amount, recipient);\\n payable(recipient).transfer(amount);\\n }\\n}\\n\",\"keccak256\":\"0xc31835047c1e9a05cbfb1f7ea6462f0e0290bc3e41de63a33f6d8b43b9af757d\",\"license\":\"WTFPL\"},\"contracts/interfaces/IETHVault.sol\":{\"content\":\"// SPDX-License-Identifier: WTFPL\\n\\npragma solidity >=0.5.0;\\n\\ninterface IETHVault {\\n event Receive(address indexed sender, uint256 amount);\\n event SetOperator(address indexed account, bool isOperator);\\n event Withdraw(address indexed operator, uint256 amount, address to);\\n\\n function isOperator(address account) external view returns (bool);\\n\\n function setOperator(address account, bool _isOperator) external;\\n\\n function withdraw(uint256 amount, address to) external;\\n}\\n\",\"keccak256\":\"0x278e06a7a5879b4935e13f006b3103622dcd11af36bfce9c9917970d8d3a43f8\",\"license\":\"WTFPL\"}},\"version\":1}",
"bytecode": "0x60c060405234801561001057600080fd5b50604051610eea380380610eea83398101604081905261002f916100bb565b6100383361004f565b6001600160a01b039182166080521660a0526100ee565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146100b657600080fd5b919050565b600080604083850312156100ce57600080fd5b6100d78361009f565b91506100e56020840161009f565b90509250929050565b60805160a051610dc261012860003960008181610114015281816105f7015261090e01526000818161029e015261057c0152610dc26000f3fe60806040526004361061009f5760003560e01c8063bbb356d511610064578063bbb356d5146101a6578063bbda7a60146101c5578063ddd5e1b2146101fd578063f2fde38b1461021d578063f301af421461023d578063fbfa77cf1461028c57600080fd5b8062f714ce146100e05780631f850716146101025780634681629014610153578063715018a6146101735780638da5cb5b1461018857600080fd5b366100db5760405134815233907fd6717f327e0cb88b4a97a7f67a453e9258252c34937ccbdd86de7cb840e7def39060200160405180910390a2005b600080fd5b3480156100ec57600080fd5b506101006100fb366004610c0f565b6102c0565b005b34801561010e57600080fd5b506101367f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561015f57600080fd5b5061010061016e366004610c3b565b61044f565b34801561017f57600080fd5b506101006107f5565b34801561019457600080fd5b506000546001600160a01b0316610136565b3480156101b257600080fd5b506001545b60405190815260200161014a565b3480156101d157600080fd5b506101b76101e0366004610c0f565b600260209081526000928352604080842090915290825290205481565b34801561020957600080fd5b50610100610218366004610c0f565b61082b565b34801561022957600080fd5b50610100610238366004610c67565b610abf565b34801561024957600080fd5b5061025d610258366004610c89565b610b5a565b6040805196875260208701959095529385019290925260608401526080830152151560a082015260c00161014a565b34801561029857600080fd5b506101367f000000000000000000000000000000000000000000000000000000000000000081565b6000546001600160a01b031633146102f35760405162461bcd60e51b81526004016102ea90610ca2565b60405180910390fd5b60006001838154811061030857610308610cd7565b60009182526020909120600690910201600581015490915060ff16156103625760405162461bcd60e51b815260206004820152600f60248201526e2b22a9221d102ba4aa24222920aba760891b60448201526064016102ea565b42816003015411156103aa5760405162461bcd60e51b8152602060048201526011602482015270159154910e881393d517d1561412549151607a1b60448201526064016102ea565b60058101805460ff19166001179055600481015481546000916103cc91610d03565b604080518281526001600160a01b038616602082015291925085917f71ef96c43343734b1d843bb85d52ef329f5e9143e4d35827771e3b0dd90c5f84910160405180910390a26040516001600160a01b0384169082156108fc029083906000818181858888f19350505050158015610448573d6000803e3d6000fd5b5050505050565b6000546001600160a01b031633146104795760405162461bcd60e51b81526004016102ea90610ca2565b600083116104c95760405162461bcd60e51b815260206004820152601760248201527f564552443a20494e56414c49445f5245574152445f494400000000000000000060448201526064016102ea565b438211156105195760405162461bcd60e51b815260206004820152601a60248201527f564552443a20494e56414c49445f424c4f434b5f4e554d42455200000000000060448201526064016102ea565b4381116105615760405162461bcd60e51b8152602060048201526016602482015275564552443a20494e56414c49445f444541444c494e4560501b60448201526064016102ea565b604051627b8a6760e11b8152600481018490523060248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169062f714ce90604401600060405180830381600087803b1580156105c757600080fd5b505af11580156105db573d6000803e3d6000fd5b5050604051630981b24d60e41b815260048101859052600092507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316915063981b24d090602401602060405180830381865afa158015610647573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061066b9190610d1a565b600180546040805160c08101825288815260208082018681528284018a815260608085018b81526000608080880182815260a089018381528b8d018d559b90925296517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf660068b029081019190915594517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf786015592517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf8850155517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf984015590517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cfa83015595517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cfb909101805460ff191691151591909117905582518a81529081018690529182018890529281018690529293509182917fa6b1fccac23badf41dc2a5755caaae2c69ddb7fbb8f1429510756f66d2819a6a910160405180910390a25050505050565b6000546001600160a01b0316331461081f5760405162461bcd60e51b81526004016102ea90610ca2565b6108296000610ba3565b565b6000828152600260209081526040808320338452909152902054156108825760405162461bcd60e51b815260206004820152600d60248201526c159154910e8810d31052535151609a1b60448201526064016102ea565b60006001838154811061089757610897610cd7565b90600052602060002090600602019050806003015442106108ea5760405162461bcd60e51b815260206004820152600d60248201526c159154910e8811561412549151609a1b60448201526064016102ea565b600281015460405163277166bf60e11b8152336004820152602481018290526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690634ee2cd7e90604401602060405180830381865afa15801561095d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109819190610d1a565b9050600081116109d35760405162461bcd60e51b815260206004820152601a60248201527f564552443a20494e53554646494349454e545f42414c414e434500000000000060448201526064016102ea565b60018301548354600091906109e89084610d33565b6109f29190610d52565b905080846004016000828254610a089190610d74565b9091555050600086815260026020908152604080832033845290915290208190556001600160a01b038516610a3b573394505b604080518281526001600160a01b0387166020820152339188917fb3e541dfcecf12a9a49633b6f58c2ea1a09b9fa7ea6ac95f2e3ca38fcdfc49ab910160405180910390a36040516001600160a01b0386169082156108fc029083906000818181858888f19350505050158015610ab6573d6000803e3d6000fd5b50505050505050565b6000546001600160a01b03163314610ae95760405162461bcd60e51b81526004016102ea90610ca2565b6001600160a01b038116610b4e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102ea565b610b5781610ba3565b50565b60018181548110610b6a57600080fd5b60009182526020909120600690910201805460018201546002830154600384015460048501546005909501549395509193909260ff1686565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b0381168114610c0a57600080fd5b919050565b60008060408385031215610c2257600080fd5b82359150610c3260208401610bf3565b90509250929050565b600080600060608486031215610c5057600080fd5b505081359360208301359350604090920135919050565b600060208284031215610c7957600080fd5b610c8282610bf3565b9392505050565b600060208284031215610c9b57600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082821015610d1557610d15610ced565b500390565b600060208284031215610d2c57600080fd5b5051919050565b6000816000190483118215151615610d4d57610d4d610ced565b500290565b600082610d6f57634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115610d8757610d87610ced565b50019056fea2646970667358221220ea6d8e84c7c64cbbbef1af2049fa301da1efbea4bdc9f1e6e0b0488f61e1248e64736f6c634300080d0033",
"deployedBytecode": "0x60806040526004361061009f5760003560e01c8063bbb356d511610064578063bbb356d5146101a6578063bbda7a60146101c5578063ddd5e1b2146101fd578063f2fde38b1461021d578063f301af421461023d578063fbfa77cf1461028c57600080fd5b8062f714ce146100e05780631f850716146101025780634681629014610153578063715018a6146101735780638da5cb5b1461018857600080fd5b366100db5760405134815233907fd6717f327e0cb88b4a97a7f67a453e9258252c34937ccbdd86de7cb840e7def39060200160405180910390a2005b600080fd5b3480156100ec57600080fd5b506101006100fb366004610c0f565b6102c0565b005b34801561010e57600080fd5b506101367f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561015f57600080fd5b5061010061016e366004610c3b565b61044f565b34801561017f57600080fd5b506101006107f5565b34801561019457600080fd5b506000546001600160a01b0316610136565b3480156101b257600080fd5b506001545b60405190815260200161014a565b3480156101d157600080fd5b506101b76101e0366004610c0f565b600260209081526000928352604080842090915290825290205481565b34801561020957600080fd5b50610100610218366004610c0f565b61082b565b34801561022957600080fd5b50610100610238366004610c67565b610abf565b34801561024957600080fd5b5061025d610258366004610c89565b610b5a565b6040805196875260208701959095529385019290925260608401526080830152151560a082015260c00161014a565b34801561029857600080fd5b506101367f000000000000000000000000000000000000000000000000000000000000000081565b6000546001600160a01b031633146102f35760405162461bcd60e51b81526004016102ea90610ca2565b60405180910390fd5b60006001838154811061030857610308610cd7565b60009182526020909120600690910201600581015490915060ff16156103625760405162461bcd60e51b815260206004820152600f60248201526e2b22a9221d102ba4aa24222920aba760891b60448201526064016102ea565b42816003015411156103aa5760405162461bcd60e51b8152602060048201526011602482015270159154910e881393d517d1561412549151607a1b60448201526064016102ea565b60058101805460ff19166001179055600481015481546000916103cc91610d03565b604080518281526001600160a01b038616602082015291925085917f71ef96c43343734b1d843bb85d52ef329f5e9143e4d35827771e3b0dd90c5f84910160405180910390a26040516001600160a01b0384169082156108fc029083906000818181858888f19350505050158015610448573d6000803e3d6000fd5b5050505050565b6000546001600160a01b031633146104795760405162461bcd60e51b81526004016102ea90610ca2565b600083116104c95760405162461bcd60e51b815260206004820152601760248201527f564552443a20494e56414c49445f5245574152445f494400000000000000000060448201526064016102ea565b438211156105195760405162461bcd60e51b815260206004820152601a60248201527f564552443a20494e56414c49445f424c4f434b5f4e554d42455200000000000060448201526064016102ea565b4381116105615760405162461bcd60e51b8152602060048201526016602482015275564552443a20494e56414c49445f444541444c494e4560501b60448201526064016102ea565b604051627b8a6760e11b8152600481018490523060248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169062f714ce90604401600060405180830381600087803b1580156105c757600080fd5b505af11580156105db573d6000803e3d6000fd5b5050604051630981b24d60e41b815260048101859052600092507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316915063981b24d090602401602060405180830381865afa158015610647573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061066b9190610d1a565b600180546040805160c08101825288815260208082018681528284018a815260608085018b81526000608080880182815260a089018381528b8d018d559b90925296517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf660068b029081019190915594517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf786015592517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf8850155517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf984015590517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cfa83015595517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cfb909101805460ff191691151591909117905582518a81529081018690529182018890529281018690529293509182917fa6b1fccac23badf41dc2a5755caaae2c69ddb7fbb8f1429510756f66d2819a6a910160405180910390a25050505050565b6000546001600160a01b0316331461081f5760405162461bcd60e51b81526004016102ea90610ca2565b6108296000610ba3565b565b6000828152600260209081526040808320338452909152902054156108825760405162461bcd60e51b815260206004820152600d60248201526c159154910e8810d31052535151609a1b60448201526064016102ea565b60006001838154811061089757610897610cd7565b90600052602060002090600602019050806003015442106108ea5760405162461bcd60e51b815260206004820152600d60248201526c159154910e8811561412549151609a1b60448201526064016102ea565b600281015460405163277166bf60e11b8152336004820152602481018290526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690634ee2cd7e90604401602060405180830381865afa15801561095d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109819190610d1a565b9050600081116109d35760405162461bcd60e51b815260206004820152601a60248201527f564552443a20494e53554646494349454e545f42414c414e434500000000000060448201526064016102ea565b60018301548354600091906109e89084610d33565b6109f29190610d52565b905080846004016000828254610a089190610d74565b9091555050600086815260026020908152604080832033845290915290208190556001600160a01b038516610a3b573394505b604080518281526001600160a01b0387166020820152339188917fb3e541dfcecf12a9a49633b6f58c2ea1a09b9fa7ea6ac95f2e3ca38fcdfc49ab910160405180910390a36040516001600160a01b0386169082156108fc029083906000818181858888f19350505050158015610ab6573d6000803e3d6000fd5b50505050505050565b6000546001600160a01b03163314610ae95760405162461bcd60e51b81526004016102ea90610ca2565b6001600160a01b038116610b4e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102ea565b610b5781610ba3565b50565b60018181548110610b6a57600080fd5b60009182526020909120600690910201805460018201546002830154600384015460048501546005909501549395509193909260ff1686565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b0381168114610c0a57600080fd5b919050565b60008060408385031215610c2257600080fd5b82359150610c3260208401610bf3565b90509250929050565b600080600060608486031215610c5057600080fd5b505081359360208301359350604090920135919050565b600060208284031215610c7957600080fd5b610c8282610bf3565b9392505050565b600060208284031215610c9b57600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082821015610d1557610d15610ced565b500390565b600060208284031215610d2c57600080fd5b5051919050565b6000816000190483118215151615610d4d57610d4d610ced565b500290565b600082610d6f57634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115610d8757610d87610ced565b50019056fea2646970667358221220ea6d8e84c7c64cbbbef1af2049fa301da1efbea4bdc9f1e6e0b0488f61e1248e64736f6c634300080d0033",
"devdoc": {
"kind": "dev",
"methods": {
"owner()": {
"details": "Returns the address of the current owner."
},
"renounceOwnership()": {
"details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner."
},
"transferOwnership(address)": {
"details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner."
}
},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 337,
"contract": "contracts/VERewardDistributor.sol:VERewardDistributor",
"label": "_owner",
"offset": 0,
"slot": "0",
"type": "t_address"
},
{
"astId": 2652,
"contract": "contracts/VERewardDistributor.sol:VERewardDistributor",
"label": "rewards",
"offset": 0,
"slot": "1",
"type": "t_array(t_struct(Reward)2644_storage)dyn_storage"
},
{
"astId": 2658,
"contract": "contracts/VERewardDistributor.sol:VERewardDistributor",
"label": "amountClaimed",
"offset": 0,
"slot": "2",
"type": "t_mapping(t_uint256,t_mapping(t_address,t_uint256))"
}
],
"types": {
"t_address": {
"encoding": "inplace",
"label": "address",
"numberOfBytes": "20"
},
"t_array(t_struct(Reward)2644_storage)dyn_storage": {
"base": "t_struct(Reward)2644_storage",
"encoding": "dynamic_array",
"label": "struct VERewardDistributor.Reward[]",
"numberOfBytes": "32"
},
"t_bool": {
"encoding": "inplace",
"label": "bool",
"numberOfBytes": "1"
},
"t_mapping(t_address,t_uint256)": {
"encoding": "mapping",
"key": "t_address",
"label": "mapping(address => uint256)",
"numberOfBytes": "32",
"value": "t_uint256"
},
"t_mapping(t_uint256,t_mapping(t_address,t_uint256))": {
"encoding": "mapping",
"key": "t_uint256",
"label": "mapping(uint256 => mapping(address => uint256))",
"numberOfBytes": "32",
"value": "t_mapping(t_address,t_uint256)"
},
"t_struct(Reward)2644_storage": {
"encoding": "inplace",
"label": "struct VERewardDistributor.Reward",
"members": [
{
"astId": 2633,
"contract": "contracts/VERewardDistributor.sol:VERewardDistributor",
"label": "amount",
"offset": 0,
"slot": "0",
"type": "t_uint256"
},
{
"astId": 2635,
"contract": "contracts/VERewardDistributor.sol:VERewardDistributor",
"label": "veSupply",
"offset": 0,
"slot": "1",
"type": "t_uint256"
},
{
"astId": 2637,
"contract": "contracts/VERewardDistributor.sol:VERewardDistributor",
"label": "block",
"offset": 0,
"slot": "2",
"type": "t_uint256"
},
{
"astId": 2639,
"contract": "contracts/VERewardDistributor.sol:VERewardDistributor",
"label": "deadline",
"offset": 0,
"slot": "3",
"type": "t_uint256"
},
{
"astId": 2641,
"contract": "contracts/VERewardDistributor.sol:VERewardDistributor",
"label": "amountClaimed",
"offset": 0,
"slot": "4",
"type": "t_uint256"
},
{
"astId": 2643,
"contract": "contracts/VERewardDistributor.sol:VERewardDistributor",
"label": "withdrawn",
"offset": 0,
"slot": "5",
"type": "t_bool"
}
],
"numberOfBytes": "192"
},
"t_uint256": {
"encoding": "inplace",
"label": "uint256",
"numberOfBytes": "32"
}
}
}
}