More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 80 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Cashout | 12270299 | 1434 days ago | IN | 0 ETH | 0.01029692 | ||||
Cashout | 12092315 | 1462 days ago | IN | 0 ETH | 0.01020591 | ||||
Cashout | 11920080 | 1488 days ago | IN | 0 ETH | 0.01720783 | ||||
Cashout | 11919650 | 1488 days ago | IN | 0 ETH | 0.00863577 | ||||
Cashout | 11916858 | 1489 days ago | IN | 0 ETH | 0.01159487 | ||||
Cashout | 11905200 | 1491 days ago | IN | 0 ETH | 0.00844802 | ||||
Cashout | 11882491 | 1494 days ago | IN | 0 ETH | 0.01358378 | ||||
Cashout | 11875753 | 1495 days ago | IN | 0 ETH | 0.02150661 | ||||
Cashout | 11860386 | 1498 days ago | IN | 0 ETH | 0.0078507 | ||||
Cashout | 11859753 | 1498 days ago | IN | 0 ETH | 0.00890358 | ||||
Claim Yield | 11811062 | 1505 days ago | IN | 0 ETH | 0.00791726 | ||||
Cashout | 11722815 | 1519 days ago | IN | 0 ETH | 0.00533847 | ||||
Cashout | 11712599 | 1520 days ago | IN | 0 ETH | 0.0058037 | ||||
Cashout | 11694380 | 1523 days ago | IN | 0 ETH | 0.00663984 | ||||
Claim Yield | 11690704 | 1524 days ago | IN | 0 ETH | 0.00249698 | ||||
Cashout | 11690572 | 1524 days ago | IN | 0 ETH | 0.00314028 | ||||
Cashout | 11682751 | 1525 days ago | IN | 0 ETH | 0.00698712 | ||||
Cashout | 11665585 | 1528 days ago | IN | 0 ETH | 0.00353281 | ||||
Cashout | 11648188 | 1530 days ago | IN | 0 ETH | 0.00402183 | ||||
Cashout | 11641899 | 1531 days ago | IN | 0 ETH | 0.00494669 | ||||
Cashout | 11622436 | 1534 days ago | IN | 0 ETH | 0.00478892 | ||||
Cashout | 11622433 | 1534 days ago | IN | 0 ETH | 0.00187 | ||||
Cashout | 11622426 | 1534 days ago | IN | 0 ETH | 0.00132 | ||||
Cashout | 11620808 | 1534 days ago | IN | 0 ETH | 0.00514288 | ||||
Cashout | 11607570 | 1536 days ago | IN | 0 ETH | 0.00701302 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
NutsStaking
Compiler Version
v0.4.26+commit.4563c3fc
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2020-11-02 */ pragma solidity ^0.4.25; /** * * NUTS Staking (v0.1 beta) * * For more info checkout: https://squirrel.finance * */ contract NutsStaking { using SafeMath for uint256; ERC20 nuts = ERC20(0x84294FC9710e1252d407d3D80A84bC39001bd4A8); ERC20 bond = ERC20(0x0391D2021f89DC339F60Fff84546EA23E337750f); mapping(address => uint256) public balances; mapping(address => int256) payoutsTo; uint256 public totalDeposits; uint256 profitPerShare; uint256 constant internal magnitude = 2 ** 64; function receiveApproval(address player, uint256 amount, address, bytes) external { require(msg.sender == address(nuts)); nuts.transferFrom(player, this, amount); totalDeposits += amount; balances[player] += amount; payoutsTo[player] += (int256) (profitPerShare * amount); } function cashout(uint256 amount) external { address recipient = msg.sender; claimYield(); balances[recipient] = balances[recipient].sub(amount); totalDeposits = totalDeposits.sub(amount); payoutsTo[recipient] -= (int256) (profitPerShare * amount); nuts.transfer(recipient, amount); } function claimYield() public { address recipient = msg.sender; uint256 dividends = (uint256) ((int256)(profitPerShare * balances[recipient]) - payoutsTo[recipient]) / magnitude; payoutsTo[recipient] += (int256) (dividends * magnitude); bond.transfer(recipient, dividends); } function shareYield(uint256 amount) external { require(bond.transferFrom(msg.sender, this, amount)); profitPerShare += (amount * magnitude) / totalDeposits; } function dividendsOf(address farmer) view public returns (uint256) { return (uint256) ((int256)(profitPerShare * balances[farmer]) - payoutsTo[farmer]) / magnitude; } } interface ERC20 { function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function approveAndCall(address spender, uint tokens, bytes data) external returns (bool success); function transferFrom(address from, address to, uint256 value) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"constant":true,"inputs":[{"name":"farmer","type":"address"}],"name":"dividendsOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balances","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"claimYield","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalDeposits","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"player","type":"address"},{"name":"amount","type":"uint256"},{"name":"","type":"address"},{"name":"","type":"bytes"}],"name":"receiveApproval","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"}],"name":"shareYield","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"}],"name":"cashout","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405260008054600160a060020a03199081167384294fc9710e1252d407d3d80a84bc39001bd4a81790915560018054909116730391d2021f89dc339f60fff84546ea23e337750f17905534801561005857600080fd5b50610592806100686000396000f3006080604052600436106100815763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166265318b811461008657806327e235e3146100b9578063406cf229146100da5780637d882097146100f15780638f4ffcb114610106578063a7fb01731461013e578063a9e732bb14610156575b600080fd5b34801561009257600080fd5b506100a7600160a060020a036004351661016e565b60408051918252519081900360200190f35b3480156100c557600080fd5b506100a7600160a060020a03600435166101a9565b3480156100e657600080fd5b506100ef6101bb565b005b3480156100fd57600080fd5b506100a7610290565b34801561011257600080fd5b506100ef60048035600160a060020a039081169160248035926044351691606435918201910135610296565b34801561014a57600080fd5b506100ef600435610394565b34801561016257600080fd5b506100ef600435610466565b600160a060020a0316600090815260036020908152604080832054600290925290912054600554680100000000000000009102919091030490565b60026020526000908152604090205481565b3360008181526003602081815260408084208054600284528286205460055495855268010000000000000000950281900385900494850201905560015481517fa9059cbb000000000000000000000000000000000000000000000000000000008152600481018790526024810185905291519394600160a060020a039091169363a9059cbb936044808501949193918390030190829087803b15801561026057600080fd5b505af1158015610274573d6000803e3d6000fd5b505050506040513d602081101561028a57600080fd5b50505050565b60045481565b600054600160a060020a031633146102ad57600080fd5b60008054604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a03898116600483015230602483015260448201899052915191909216926323b872dd92606480820193602093909283900390910190829087803b15801561032557600080fd5b505af1158015610339573d6000803e3d6000fd5b505050506040513d602081101561034f57600080fd5b50506004805485019055505050600160a060020a0390911660009081526002602090815260408083208054850190556005546003909252909120805491909202019055565b600154604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018490529051600160a060020a03909216916323b872dd916064808201926020929091908290030181600087803b15801561040757600080fd5b505af115801561041b573d6000803e3d6000fd5b505050506040513d602081101561043157600080fd5b5051151561043e57600080fd5b60045468010000000000000000820281151561045657fe5b6005805492909104909101905550565b3361046f6101bb565b600160a060020a038116600090815260026020526040902054610498908363ffffffff61055416565b600160a060020a0382166000908152600260205260409020556004546104c4908363ffffffff61055416565b6004908155600554600160a060020a0380841660008181526003602090815260408083208054968a02909603909555815485517fa9059cbb00000000000000000000000000000000000000000000000000000000815296870193909352602486018890529351919092169363a9059cbb936044808301949193928390030190829087803b15801561026057600080fd5b60008282111561056057fe5b509003905600a165627a7a72305820151d350bc28d64a7f37a266f3b2fd01de3a4fc7f63648abf0efa396763d5b89c0029
Deployed Bytecode
0x6080604052600436106100815763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166265318b811461008657806327e235e3146100b9578063406cf229146100da5780637d882097146100f15780638f4ffcb114610106578063a7fb01731461013e578063a9e732bb14610156575b600080fd5b34801561009257600080fd5b506100a7600160a060020a036004351661016e565b60408051918252519081900360200190f35b3480156100c557600080fd5b506100a7600160a060020a03600435166101a9565b3480156100e657600080fd5b506100ef6101bb565b005b3480156100fd57600080fd5b506100a7610290565b34801561011257600080fd5b506100ef60048035600160a060020a039081169160248035926044351691606435918201910135610296565b34801561014a57600080fd5b506100ef600435610394565b34801561016257600080fd5b506100ef600435610466565b600160a060020a0316600090815260036020908152604080832054600290925290912054600554680100000000000000009102919091030490565b60026020526000908152604090205481565b3360008181526003602081815260408084208054600284528286205460055495855268010000000000000000950281900385900494850201905560015481517fa9059cbb000000000000000000000000000000000000000000000000000000008152600481018790526024810185905291519394600160a060020a039091169363a9059cbb936044808501949193918390030190829087803b15801561026057600080fd5b505af1158015610274573d6000803e3d6000fd5b505050506040513d602081101561028a57600080fd5b50505050565b60045481565b600054600160a060020a031633146102ad57600080fd5b60008054604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a03898116600483015230602483015260448201899052915191909216926323b872dd92606480820193602093909283900390910190829087803b15801561032557600080fd5b505af1158015610339573d6000803e3d6000fd5b505050506040513d602081101561034f57600080fd5b50506004805485019055505050600160a060020a0390911660009081526002602090815260408083208054850190556005546003909252909120805491909202019055565b600154604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018490529051600160a060020a03909216916323b872dd916064808201926020929091908290030181600087803b15801561040757600080fd5b505af115801561041b573d6000803e3d6000fd5b505050506040513d602081101561043157600080fd5b5051151561043e57600080fd5b60045468010000000000000000820281151561045657fe5b6005805492909104909101905550565b3361046f6101bb565b600160a060020a038116600090815260026020526040902054610498908363ffffffff61055416565b600160a060020a0382166000908152600260205260409020556004546104c4908363ffffffff61055416565b6004908155600554600160a060020a0380841660008181526003602090815260408083208054968a02909603909555815485517fa9059cbb00000000000000000000000000000000000000000000000000000000815296870193909352602486018890529351919092169363a9059cbb936044808301949193928390030190829087803b15801561026057600080fd5b60008282111561056057fe5b509003905600a165627a7a72305820151d350bc28d64a7f37a266f3b2fd01de3a4fc7f63648abf0efa396763d5b89c0029
Deployed Bytecode Sourcemap
139:1825:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1781:180;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1781:180:0;-1:-1:-1;;;;;1781:180:0;;;;;;;;;;;;;;;;;;;;;350:43;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;350:43:0;-1:-1:-1;;;;;350:43:0;;;;;1261:315;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1261:315:0;;;;;;449:28;;8:9:-1;5:2;;;30:1;27;20:12;5:2;449:28:0;;;;571:324;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;571:324:0;;;;-1:-1:-1;;;;;571:324:0;;;;;;;;;;;;;;;;;;;;;;1588:181;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1588:181:0;;;;;907:342;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;907:342:0;;;;;1781:180;-1:-1:-1;;;;;1923:17:0;1839:7;1923:17;;;:9;:17;;;;;;;;;1903:8;:16;;;;;;;1886:14;;551:7;1886:33;;1877:63;;;;1866:87;;1781:180::o;350:43::-;;;;;;;;;;;;;:::o;1261:315::-;1321:10;1301:17;1422:20;;;:9;:20;;;;;;;;;;1399:8;:19;;;;;;1382:14;;1466:20;;;551:7;1382:36;;1373:69;;;1362:93;;;1500:21;;;1466:56;;;-1:-1:-1;1533:4:0;:35;;;;;;;;;;;;;;;;;;;1362:93;;-1:-1:-1;;;;;1533:4:0;;;;:13;;:35;;;;;1422:20;;1533:35;;;;;;;;:4;:35;;;5:2:-1;;;;30:1;27;20:12;5:2;1533:35:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1533:35:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;1261:315:0:o;449:28::-;;;;:::o;571:324::-;694:4;;-1:-1:-1;;;;;694:4:0;672:10;:27;664:36;;;;;;711:4;;;:39;;;;;;-1:-1:-1;;;;;711:39:0;;;;;;;737:4;711:39;;;;;;;;;;;;:4;;;;;:17;;:39;;;;;;;;;;;;;;;;;;:4;:39;;;5:2:-1;;;;30:1;27;20:12;5:2;711:39:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;711:39:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;761:13:0;:23;;;;;;-1:-1:-1;;;;;;;;795:16:0;;;761:13;795:16;;;:8;711:39;795:16;;;;;;;:26;;;;;;863:14;;832:9;:17;;;;;;:55;;863:23;;;;832:55;;;571:324::o;1588:181::-;1652:4;;:43;;;;;;1670:10;1652:43;;;;1682:4;1652:43;;;;;;;;;;;;-1:-1:-1;;;;;1652:4:0;;;;:17;;:43;;;;;;;;;;;;;;;:4;;:43;;;5:2:-1;;;;30:1;27;20:12;5:2;1652:43:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1652:43:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1652:43:0;1644:52;;;;;;;;1748:13;;551:7;1726:6;:18;1725:36;;;;;;;1707:14;:54;;1725:36;;;;1707:54;;;;;-1:-1:-1;1588:181:0:o;907:342::-;980:10;1001:12;:10;:12::i;:::-;-1:-1:-1;;;;;1046:19:0;;;;;;:8;:19;;;;;;:31;;1070:6;1046:31;:23;:31;:::i;:::-;-1:-1:-1;;;;;1024:19:0;;;;;;:8;:19;;;;;:53;1104:13;;:25;;1122:6;1104:25;:17;:25;:::i;:::-;1088:13;:41;;;1174:14;;-1:-1:-1;;;;;1140:20:0;;;;;;;:9;:20;;;;;;;;:58;;1174:23;;;1140:58;;;;;;1209:4;;:32;;;;;;;;;;;;;;;;;;;;:4;;;;;:13;;:32;;;;;1140:20;;1209:32;;;;;;;;:4;:32;;;5:2:-1;;;;30:1;27;20:12;3469:113:0;3527:7;3550:6;;;;3543:14;;;;-1:-1:-1;3571:5:0;;;3469:113::o
Swarm Source
bzzr://151d350bc28d64a7f37a266f3b2fd01de3a4fc7f63648abf0efa396763d5b89c
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 35 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.