More Info
Private Name Tags
ContractCreator
Latest 20 from a total of 20 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Release | 14643360 | 1026 days ago | IN | 0 ETH | 0.00545675 | ||||
Release | 11545059 | 1507 days ago | IN | 0 ETH | 0.01094669 | ||||
Release | 11505517 | 1513 days ago | IN | 0 ETH | 0.01887142 | ||||
Release | 11479200 | 1517 days ago | IN | 0 ETH | 0.00943571 | ||||
Release | 11459743 | 1520 days ago | IN | 0 ETH | 0.00834531 | ||||
Release | 11433537 | 1524 days ago | IN | 0 ETH | 0.0047221 | ||||
Deposit | 11433524 | 1524 days ago | IN | 0 ETH | 0.00047184 | ||||
Release | 11426542 | 1525 days ago | IN | 0 ETH | 0.00471785 | ||||
Release | 11420282 | 1526 days ago | IN | 0 ETH | 0.00943571 | ||||
Release | 11381388 | 1532 days ago | IN | 0 ETH | 0.00676647 | ||||
Release | 11354957 | 1536 days ago | IN | 0 ETH | 0.00379637 | ||||
Release | 11305398 | 1544 days ago | IN | 0 ETH | 0.01004922 | ||||
Release | 11278035 | 1548 days ago | IN | 0 ETH | 0.00947306 | ||||
Release | 11277704 | 1548 days ago | IN | 0 ETH | 0.01007155 | ||||
Release | 11257079 | 1551 days ago | IN | 0 ETH | 0.00696745 | ||||
Release | 11244570 | 1553 days ago | IN | 0 ETH | 0.00379637 | ||||
Release | 11241565 | 1553 days ago | IN | 0 ETH | 0.00672404 | ||||
Release | 11232864 | 1555 days ago | IN | 0 ETH | 0.00647616 | ||||
Release | 11231868 | 1555 days ago | IN | 0 ETH | 0.01193118 | ||||
Deposit | 11231471 | 1555 days ago | IN | 0 ETH | 0.00093434 |
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
11230757 | 1555 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
WhirlpoolManager
Compiler Version
v0.6.12+commit.27d51765
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2020-11-10 */ pragma solidity ^0.6.12; interface Callable { function tokenCallback(address _from, uint256 _tokens, bytes calldata _data) external returns (bool); } interface Router { function WETH() external pure returns (address); function swapExactETHForTokens(uint256 _amountOutMin, address[] calldata _path, address _to, uint256 _deadline) external payable returns (uint256[] memory); } interface SURF { function balanceOf(address) external view returns (uint256); function transfer(address, uint256) external returns (bool); function transferFrom(address, address, uint256) external returns (bool); } contract WhirlpoolManager { uint256 constant private BOARD_DIVIDENDS_PERCENT = 10; struct Info { address whirlpool; address boardDividends; SURF surf; SURF3d s3d; } Info private info; constructor(address _surf, address _whirlpool, address _boardDividends) public { info.whirlpool = _whirlpool; info.boardDividends = _boardDividends; info.surf = SURF(_surf); info.s3d = SURF3d(msg.sender); } receive() external payable {} function deposit() external { uint256 _balance = address(this).balance; if (_balance > 0) { info.s3d.deposit{value: _balance}(); } } function release() external { if (info.s3d.dividendsOf(address(this)) > 0) { info.s3d.withdraw(); } uint256 _balance = info.surf.balanceOf(address(this)); if (_balance > 0) { uint256 _boardDividends = _balance * BOARD_DIVIDENDS_PERCENT / 100; info.surf.transfer(info.boardDividends, _boardDividends); // Send 10% of divs to SURF Board holders info.surf.transfer(address(info.surf), _boardDividends); // Burn 10% of divs by sending them to the SURF token contract info.surf.transfer(info.whirlpool, _balance - _boardDividends - _boardDividends); // Send 80% of divs to the Whirlpool } } } contract SURF3d { uint256 constant private FLOAT_SCALAR = 2**64; uint256 constant private BUY_TAX = 15; uint256 constant private SELL_TAX = 15; uint256 constant private STARTING_PRICE = 1e17; uint256 constant private INCREMENT = 1e12; string constant public name = "SURF3d"; string constant public symbol = "S3D"; uint8 constant public decimals = 18; struct User { uint256 balance; mapping(address => uint256) allowance; int256 scaledPayout; } struct Info { uint256 totalSupply; mapping(address => User) users; uint256 scaledSurfPerToken; uint256 openingBlock; address whirlpool; address deployer; Router router; SURF surf; } Info private info; WhirlpoolManager public whirlpoolManager; event Transfer(address indexed from, address indexed to, uint256 tokens); event Approval(address indexed owner, address indexed spender, uint256 tokens); event Buy(address indexed buyer, uint256 amountSpent, uint256 tokensReceived); event Sell(address indexed seller, uint256 tokensSpent, uint256 amountReceived); event Withdraw(address indexed user, uint256 amount); event Reinvest(address indexed user, uint256 amount); constructor(address _surf, address _whirlpool, address _boardDividends) public { info.router = Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); info.surf = SURF(_surf); info.whirlpool = _whirlpool; info.deployer = msg.sender; whirlpoolManager = new WhirlpoolManager(_surf, _whirlpool, _boardDividends); } function setOpeningBlock(uint256 _openingBlock, uint256 _firstBuyAmount) external { require(info.openingBlock == 0 && msg.sender == info.deployer); require(_openingBlock >= block.number + 500); if (_firstBuyAmount > 0) { buyFor(_firstBuyAmount, address(whirlpoolManager)); } info.openingBlock = _openingBlock; } receive() external payable { if (msg.sender == tx.origin) { deposit(); } } function deposit() public payable returns (uint256) { return depositFor(msg.sender); } function depositFor(address _user) public payable returns (uint256) { require(msg.value > 0); return _deposit(msg.value, _user); } function buy(uint256 _amount) external returns (uint256) { return buyFor(_amount, msg.sender); } function buyFor(uint256 _amount, address _user) public returns (uint256) { require(_amount > 0); uint256 _balanceBefore = info.surf.balanceOf(address(this)); info.surf.transferFrom(msg.sender, address(this), _amount); uint256 _amountReceived = info.surf.balanceOf(address(this)) - _balanceBefore; return _buy(_amountReceived, _user); } function tokenCallback(address _from, uint256 _tokens, bytes calldata) external returns (bool) { require(msg.sender == address(info.surf)); require(_tokens > 0); _buy(_tokens, _from); return true; } function sell(uint256 _tokens) external returns (uint256) { require(balanceOf(msg.sender) >= _tokens); return _sell(_tokens); } function withdraw() external returns (uint256) { uint256 _dividends = dividendsOf(msg.sender); require(_dividends > 0); info.users[msg.sender].scaledPayout += int256(_dividends * FLOAT_SCALAR); info.surf.transfer(msg.sender, _dividends); emit Withdraw(msg.sender, _dividends); return _dividends; } function reinvest() external returns (uint256) { uint256 _dividends = dividendsOf(msg.sender); require(_dividends > 0); info.users[msg.sender].scaledPayout += int256(_dividends * FLOAT_SCALAR); emit Reinvest(msg.sender, _dividends); return _buy(_dividends, msg.sender); } function transfer(address _to, uint256 _tokens) external returns (bool) { return _transfer(msg.sender, _to, _tokens); } function approve(address _spender, uint256 _tokens) external returns (bool) { info.users[msg.sender].allowance[_spender] = _tokens; emit Approval(msg.sender, _spender, _tokens); return true; } function transferFrom(address _from, address _to, uint256 _tokens) external returns (bool) { require(info.users[_from].allowance[msg.sender] >= _tokens); info.users[_from].allowance[msg.sender] -= _tokens; return _transfer(_from, _to, _tokens); } function transferAndCall(address _to, uint256 _tokens, bytes calldata _data) external returns (bool) { _transfer(msg.sender, _to, _tokens); uint32 _size; assembly { _size := extcodesize(_to) } if (_size > 0) { require(Callable(_to).tokenCallback(msg.sender, _tokens, _data)); } return true; } function totalSupply() public view returns (uint256) { return info.totalSupply; } function currentPrices() public view returns (uint256 truePrice, uint256 buyPrice, uint256 sellPrice) { truePrice = STARTING_PRICE + INCREMENT * totalSupply() / 1e18; buyPrice = truePrice * 100 / (100 - BUY_TAX); sellPrice = truePrice * (100 - SELL_TAX) / 100; } function balanceOf(address _user) public view returns (uint256) { return info.users[_user].balance; } function dividendsOf(address _user) public view returns (uint256) { return uint256(int256(info.scaledSurfPerToken * balanceOf(_user)) - info.users[_user].scaledPayout) / FLOAT_SCALAR; } function allInfoFor(address _user) external view returns (uint256 contractBalance, uint256 totalTokenSupply, uint256 truePrice, uint256 buyPrice, uint256 sellPrice, uint256 openingBlock, uint256 currentBlock, uint256 userETH, uint256 userSURF, uint256 userBalance, uint256 userDividends, uint256 userLiquidValue) { contractBalance = info.surf.balanceOf(address(this)); totalTokenSupply = totalSupply(); (truePrice, buyPrice, sellPrice) = currentPrices(); openingBlock = info.openingBlock; currentBlock = block.number; userETH = _user.balance; userSURF = info.surf.balanceOf(_user); userBalance = balanceOf(_user); userDividends = dividendsOf(_user); userLiquidValue = calculateResult(userBalance, false, false) + userDividends; } function allowance(address _user, address _spender) external view returns (uint256) { return info.users[_user].allowance[_spender]; } function calculateResult(uint256 _amount, bool _buy, bool _inverse) public view returns (uint256) { uint256 _buyPrice; uint256 _sellPrice; ( , _buyPrice, _sellPrice) = currentPrices(); uint256 _rate = (_buy ? _buyPrice : _sellPrice); uint256 _increment = INCREMENT * (_buy ? 100 : (100 - SELL_TAX)) / (_buy ? (100 - BUY_TAX) : 100); if ((_buy && !_inverse) || (!_buy && _inverse)) { if (_inverse) { return (2 * _rate - _sqrt(4 * _rate * _rate + _increment * _increment - 4 * _rate * _increment - 8 * _amount * _increment) - _increment) * 1e18 / (2 * _increment); } else { return (_sqrt((_increment + 2 * _rate) * (_increment + 2 * _rate) + 8 * _amount * _increment) - _increment - 2 * _rate) * 1e18 / (2 * _increment); } } else { if (_inverse) { return (_rate * _amount + (_increment * (_amount + 1e18) / 2e18) * _amount) / 1e18; } else { return (_rate * _amount - (_increment * (_amount + 1e18) / 2e18) * _amount) / 1e18; } } } function _transfer(address _from, address _to, uint256 _tokens) internal returns (bool) { require(info.users[_from].balance >= _tokens); info.users[_from].balance -= _tokens; info.users[_from].scaledPayout -= int256(_tokens * info.scaledSurfPerToken); info.users[_to].balance += _tokens; info.users[_to].scaledPayout += int256(_tokens * info.scaledSurfPerToken); emit Transfer(_from, _to, _tokens); return true; } function _deposit(uint256 _value, address _user) internal returns (uint256) { uint256 _balanceBefore = info.surf.balanceOf(address(this)); address[] memory _poolPath = new address[](2); _poolPath[0] = info.router.WETH(); _poolPath[1] = address(info.surf); info.router.swapExactETHForTokens{value: _value}(0, _poolPath, address(this), block.timestamp + 5 minutes); uint256 _amount = info.surf.balanceOf(address(this)) - _balanceBefore; return _buy(_amount, _user); } function _buy(uint256 _amount, address _user) internal returns (uint256 tokens) { require((info.openingBlock == 0 && msg.sender == info.deployer) || (info.openingBlock != 0 && block.number >= info.openingBlock)); uint256 _tax = _amount * BUY_TAX / 100; tokens = calculateResult(_amount, true, false); info.totalSupply += tokens; info.users[_user].balance += tokens; info.users[_user].scaledPayout += int256(tokens * info.scaledSurfPerToken); info.scaledSurfPerToken += _tax * FLOAT_SCALAR / info.totalSupply; emit Transfer(address(0x0), _user, tokens); emit Buy(_user, _amount, tokens); } function _sell(uint256 _tokens) internal returns (uint256 amount) { require(info.users[msg.sender].balance >= _tokens); amount = calculateResult(_tokens, false, false); uint256 _tax = amount * SELL_TAX / (100 - SELL_TAX); info.totalSupply -= _tokens; info.users[msg.sender].balance -= _tokens; info.users[msg.sender].scaledPayout -= int256(_tokens * info.scaledSurfPerToken); info.scaledSurfPerToken += _tax * FLOAT_SCALAR / info.totalSupply; info.surf.transfer(msg.sender, amount); emit Transfer(msg.sender, address(0x0), _tokens); emit Sell(msg.sender, _tokens, amount); } function _sqrt(uint256 _n) internal pure returns (uint256 result) { uint256 _tmp = (_n + 1) / 2; result = _n; while (_tmp < result) { result = _tmp; _tmp = (_n / _tmp + _tmp) / 2; } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_surf","type":"address"},{"internalType":"address","name":"_whirlpool","type":"address"},{"internalType":"address","name":"_boardDividends","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"release","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
608060405234801561001057600080fd5b506040516104c43803806104c48339818101604052606081101561003357600080fd5b5080516020820151604090920151600080546001600160a01b039485166001600160a01b0319918216179091556001805492851692821692909217909155600280549390921692811692909217905560038054909116331790556104288061009c6000396000f3fe60806040526004361061002d5760003560e01c806386d1a69f14610039578063d0e30db01461005057610034565b3661003457005b600080fd5b34801561004557600080fd5b5061004e610065565b005b34801561005c57600080fd5b5061004e610374565b600354604080516265318b60e01b815230600482015290516000926001600160a01b0316916265318b916024808301926020929190829003018186803b1580156100ae57600080fd5b505afa1580156100c2573d6000803e3d6000fd5b505050506040513d60208110156100d857600080fd5b505111156101545760035460408051633ccfd60b60e01b815290516001600160a01b0390921691633ccfd60b916004808201926020929091908290030181600087803b15801561012757600080fd5b505af115801561013b573d6000803e3d6000fd5b505050506040513d602081101561015157600080fd5b50505b600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561019f57600080fd5b505afa1580156101b3573d6000803e3d6000fd5b505050506040513d60208110156101c957600080fd5b505190508015610371576002546001546040805163a9059cbb60e01b81526001600160a01b0392831660048201526064600a8602046024820181905291519193929092169163a9059cbb9160448083019260209291908290030181600087803b15801561023557600080fd5b505af1158015610249573d6000803e3d6000fd5b505050506040513d602081101561025f57600080fd5b50506002546040805163a9059cbb60e01b81526001600160a01b0390921660048301819052602483018490529051909163a9059cbb9160448083019260209291908290030181600087803b1580156102b657600080fd5b505af11580156102ca573d6000803e3d6000fd5b505050506040513d60208110156102e057600080fd5b5050600254600080546040805163a9059cbb60e01b81526001600160a01b03928316600482015285870386900360248201529051919093169263a9059cbb9260448083019360209390929083900390910190829087803b15801561034357600080fd5b505af1158015610357573d6000803e3d6000fd5b505050506040513d602081101561036d57600080fd5b5050505b50565b4780156103715760035460408051630d0e30db60e41b815290516001600160a01b039092169163d0e30db0918491600480830192602092919082900301818588803b1580156103c257600080fd5b505af11580156103d6573d6000803e3d6000fd5b50505050506040513d60208110156103ed57600080fd5b50505056fea2646970667358221220476d9f014dae398eca49a1422114a65b00d3ae3b861eaba0c8c8ca3e73b8080464736f6c634300060c0033000000000000000000000000ea319e87cf06203dae107dd8e5672175e3ee976c000000000000000000000000999b1e6edcb412b59ecf0c5e14c20948ce81f40b000000000000000000000000c456c79213d0d39fbb2bec1d8ec356c6d3970a2f
Deployed Bytecode
0x60806040526004361061002d5760003560e01c806386d1a69f14610039578063d0e30db01461005057610034565b3661003457005b600080fd5b34801561004557600080fd5b5061004e610065565b005b34801561005c57600080fd5b5061004e610374565b600354604080516265318b60e01b815230600482015290516000926001600160a01b0316916265318b916024808301926020929190829003018186803b1580156100ae57600080fd5b505afa1580156100c2573d6000803e3d6000fd5b505050506040513d60208110156100d857600080fd5b505111156101545760035460408051633ccfd60b60e01b815290516001600160a01b0390921691633ccfd60b916004808201926020929091908290030181600087803b15801561012757600080fd5b505af115801561013b573d6000803e3d6000fd5b505050506040513d602081101561015157600080fd5b50505b600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561019f57600080fd5b505afa1580156101b3573d6000803e3d6000fd5b505050506040513d60208110156101c957600080fd5b505190508015610371576002546001546040805163a9059cbb60e01b81526001600160a01b0392831660048201526064600a8602046024820181905291519193929092169163a9059cbb9160448083019260209291908290030181600087803b15801561023557600080fd5b505af1158015610249573d6000803e3d6000fd5b505050506040513d602081101561025f57600080fd5b50506002546040805163a9059cbb60e01b81526001600160a01b0390921660048301819052602483018490529051909163a9059cbb9160448083019260209291908290030181600087803b1580156102b657600080fd5b505af11580156102ca573d6000803e3d6000fd5b505050506040513d60208110156102e057600080fd5b5050600254600080546040805163a9059cbb60e01b81526001600160a01b03928316600482015285870386900360248201529051919093169263a9059cbb9260448083019360209390929083900390910190829087803b15801561034357600080fd5b505af1158015610357573d6000803e3d6000fd5b505050506040513d602081101561036d57600080fd5b5050505b50565b4780156103715760035460408051630d0e30db60e41b815290516001600160a01b039092169163d0e30db0918491600480830192602092919082900301818588803b1580156103c257600080fd5b505af11580156103d6573d6000803e3d6000fd5b50505050506040513d60208110156103ed57600080fd5b50505056fea2646970667358221220476d9f014dae398eca49a1422114a65b00d3ae3b861eaba0c8c8ca3e73b8080464736f6c634300060c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000ea319e87cf06203dae107dd8e5672175e3ee976c000000000000000000000000999b1e6edcb412b59ecf0c5e14c20948ce81f40b000000000000000000000000c456c79213d0d39fbb2bec1d8ec356c6d3970a2f
-----Decoded View---------------
Arg [0] : _surf (address): 0xEa319e87Cf06203DAe107Dd8E5672175e3Ee976c
Arg [1] : _whirlpool (address): 0x999b1e6EDCb412b59ECF0C5e14c20948Ce81F40b
Arg [2] : _boardDividends (address): 0xc456c79213D0d39Fbb2bec1d8Ec356c6d3970A2f
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000ea319e87cf06203dae107dd8e5672175e3ee976c
Arg [1] : 000000000000000000000000999b1e6edcb412b59ecf0c5e14c20948ce81f40b
Arg [2] : 000000000000000000000000c456c79213d0d39fbb2bec1d8ec356c6d3970a2f
Deployed Bytecode Sourcemap
619:1248:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1242:622;;;;;;;;;;;;;:::i;:::-;;1090:147;;;;;;;;;;;;;:::i;1242:622::-;1279:8;;:35;;;-1:-1:-1;;;1279:35:0;;1308:4;1279:35;;;;;;-1:-1:-1;;;;;;;1279:8:0;;-1:-1:-1;;1279:35:0;;;;;;;;;;;;;;:8;:35;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1279:35:0;:39;1275:76;;;1326:8;;:19;;;-1:-1:-1;;;1326:19:0;;;;-1:-1:-1;;;;;1326:8:0;;;;-1:-1:-1;;1326:19:0;;;;;;;;;;;;;;;:4;:8;:19;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;1275:76:0;1374:9;;:34;;;-1:-1:-1;;;1374:34:0;;1402:4;1374:34;;;;;;-1:-1:-1;;;;;;;1374:9:0;;-1:-1:-1;;1374:34:0;;;;;;;;;;;;;;:9;:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1374:34:0;;-1:-1:-1;1417:12:0;;1413:447;;1509:9;;;1528:19;1509:56;;;-1:-1:-1;;;1509:56:0;;-1:-1:-1;;;;;1528:19:0;;;1509:56;;;;1500:3;702:2;1463:34;;:40;1509:56;;;;;;;;1463:40;;1509:9;;;;;-1:-1:-1;;1509:56:0;;;;;;;;;;;;;;-1:-1:-1;1509:9:0;:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;1613:9:0;;:55;;;-1:-1:-1;;;1613:55:0;;-1:-1:-1;;;;;1613:9:0;;;:55;;;;;;;;;;;;;;:9;;-1:-1:-1;;1613:55:0;;;;;1509:56;;1613:55;;;;;;;-1:-1:-1;1613:9:0;:55;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;1737:9:0;;:4;1756:14;;1737:80;;;-1:-1:-1;;;1737:80:0;;-1:-1:-1;;;;;1756:14:0;;;1737:80;;;;1772:26;;;:44;;;1737:80;;;;;;:9;;;;;-1:-1:-1;;1737:80:0;;;;;1613:55;;1737:80;;;;;;;;;;;;:9;:80;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;1413:447:0;1242:622;:::o;1090:147::-;1142:21;1172:12;;1168:65;;1192:8;;:35;;;-1:-1:-1;;;1192:35:0;;;;-1:-1:-1;;;;;1192:8:0;;;;:16;;1216:8;;1192:35;;;;;;;;;;;;;;1216:8;1192;:35;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;1090:147:0;:::o
Swarm Source
ipfs://476d9f014dae398eca49a1422114a65b00d3ae3b861eaba0c8c8ca3e73b80804
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ 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.