ETH Price: $2,134.76 (+4.03%)

Contract

0x3EA99c46a0f4deBdaa714ffBbaa3CBFd20679D31
 

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
Stream Withdraw123485122021-05-01 13:17:261787 days ago1619875046IN
0x3EA99c46...d20679D31
0 ETH0.0012307428
Stream Deposit123125802021-04-25 23:58:481793 days ago1619395128IN
0x3EA99c46...d20679D31
0.5 ETH0.0010767238.50000102
Transfer123125622021-04-25 23:53:591793 days ago1619394839IN
0x3EA99c46...d20679D31
0.5 ETH0.00134464

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Method Block
From
To
-123485122021-05-01 13:17:261787 days ago1619875046
0x3EA99c46...d20679D31
0.5 ETH
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:
SimpleStream

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license
/**
 *Submitted for verification at Etherscan.io on 2021-04-26
*/

pragma solidity >=0.8.0;
//SPDX-License-Identifier: MIT

//
// https://github.com/austintgriffith/scaffold-eth/tree/simple-stream
// @austingriffith
//

contract SimpleStream {

  event Withdraw( address indexed to, uint256 amount, string reason );
  event Deposit( address indexed from, uint256 amount, string reason );

  address payable public toAddress;
  uint256 public cap;
  uint256 public frequency;
  uint256 public last = block.timestamp - frequency; //stream starts full
  //uint256 public last = block.timestamp; //stream starts empty

  constructor(address payable _toAddress, uint256 _cap, uint256 _frequency, bool _startsFull) public {
    toAddress = _toAddress;
    cap = _cap;
    frequency = _frequency;
    if(_startsFull){
      last = block.timestamp - frequency;
    }else{
      last = block.timestamp;
    }
  }

  function streamBalance() public view returns (uint256){
    if(block.timestamp-last > frequency){
      return cap;
    }
    return (cap * (block.timestamp-last)) / frequency;
  }

  function streamWithdraw(uint256 amount, string memory reason) public {
       require(msg.sender==toAddress,"this stream is not for you");
       uint256 totalAmountCanWithdraw = streamBalance();
       require(totalAmountCanWithdraw>=amount,"not enough in the stream");
       last = last + ((block.timestamp - last) * amount / totalAmountCanWithdraw);
       emit Withdraw( msg.sender, amount, reason );
       toAddress.transfer(amount);
   }

   function streamDeposit(string memory reason) public payable {
      require(msg.value>=cap/10,"Not big enough, sorry.");
      emit Deposit( msg.sender, msg.value, reason );
    }

   receive() external payable { streamDeposit(""); }
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address payable","name":"_toAddress","type":"address"},{"internalType":"uint256","name":"_cap","type":"uint256"},{"internalType":"uint256","name":"_frequency","type":"uint256"},{"internalType":"bool","name":"_startsFull","type":"bool"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"string","name":"reason","type":"string"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"string","name":"reason","type":"string"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"cap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"frequency","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"last","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"streamBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"reason","type":"string"}],"name":"streamDeposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"string","name":"reason","type":"string"}],"name":"streamWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"toAddress","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

608060405260025461001190426100e7565b60035534801561002057600080fd5b5060405161070b38038061070b83398101604081905261003f9161008d565b600080546001600160a01b0319166001600160a01b03861617905560018390556002829055801561007f5760025461007790426100e7565b600355610084565b426003555b5050505061010a565b600080600080608085870312156100a2578384fd5b84516001600160a01b03811681146100b8578485fd5b809450506020850151925060408501519150606085015180151581146100dc578182fd5b939692955090935050565b60008282101561010557634e487b7160e01b81526011600452602481fd5b500390565b6105f2806101196000396000f3fe6080604052600436106100745760003560e01c8063a8397ddc1161004e578063a8397ddc1461010f578063c3ae1e591461012f578063c5a15ec814610144578063ead50da31461015757600080fd5b806319c87f1f14610098578063355274ea146100d557806347799da8146100f957600080fd5b36610093576100916040518060200160405280600081525061016d565b005b600080fd5b3480156100a457600080fd5b506000546100b8906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100e157600080fd5b506100eb60015481565b6040519081526020016100cc565b34801561010557600080fd5b506100eb60035481565b34801561011b57600080fd5b5061009161012a366004610482565b61020f565b34801561013b57600080fd5b506100eb610374565b610091610152366004610447565b61016d565b34801561016357600080fd5b506100eb60025481565b600a60015461017c919061053a565b3410156101c95760405162461bcd60e51b81526020600482015260166024820152752737ba103134b39032b737bab3b4161039b7b9393c9760511b60448201526064015b60405180910390fd5b336001600160a01b03167f643e927b32d5bfd08eccd2fcbd97057ad413850f857a2359639114e8e8dd3d7b34836040516102049291906104c7565b60405180910390a250565b6000546001600160a01b031633146102695760405162461bcd60e51b815260206004820152601a60248201527f746869732073747265616d206973206e6f7420666f7220796f7500000000000060448201526064016101c0565b6000610273610374565b9050828110156102c55760405162461bcd60e51b815260206004820152601860248201527f6e6f7420656e6f75676820696e207468652073747265616d000000000000000060448201526064016101c0565b8083600354426102d59190610579565b6102df919061055a565b6102e9919061053a565b6003546102f69190610522565b60035560405133907f485f1bb6524c663555797e00171a10f341656e59b02d6b557a0a38ba7d5d97519061032d90869086906104c7565b60405180910390a2600080546040516001600160a01b039091169185156108fc02918691818181858888f1935050505015801561036e573d6000803e3d6000fd5b50505050565b6000600254600354426103879190610579565b1115610394575060015490565b6002546003546103a49042610579565b6001546103b1919061055a565b6103bb919061053a565b905090565b600082601f8301126103d0578081fd5b813567ffffffffffffffff808211156103eb576103eb6105a6565b604051601f8301601f19908116603f01168101908282118183101715610413576104136105a6565b8160405283815286602085880101111561042b578485fd5b8360208701602083013792830160200193909352509392505050565b600060208284031215610458578081fd5b813567ffffffffffffffff81111561046e578182fd5b61047a848285016103c0565b949350505050565b60008060408385031215610494578081fd5b82359150602083013567ffffffffffffffff8111156104b1578182fd5b6104bd858286016103c0565b9150509250929050565b828152600060206040818401528351806040850152825b818110156104fa578581018301518582016060015282016104de565b8181111561050b5783606083870101525b50601f01601f191692909201606001949350505050565b6000821982111561053557610535610590565b500190565b60008261055557634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561057457610574610590565b500290565b60008282101561058b5761058b610590565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfea2646970667358221220e2cc8fb8f01c2c9025fb33b003d48d7169223d939b26657e18cf9e257aa9185064736f6c634300080400330000000000000000000000001e2ce012b27d0c0d3e717e943ef6e62717cec4ea00000000000000000000000000000000000000000000000006f05b59d3b20000000000000000000000000000000000000000000000000000000000000013c6800000000000000000000000000000000000000000000000000000000000000001

Deployed Bytecode

0x6080604052600436106100745760003560e01c8063a8397ddc1161004e578063a8397ddc1461010f578063c3ae1e591461012f578063c5a15ec814610144578063ead50da31461015757600080fd5b806319c87f1f14610098578063355274ea146100d557806347799da8146100f957600080fd5b36610093576100916040518060200160405280600081525061016d565b005b600080fd5b3480156100a457600080fd5b506000546100b8906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100e157600080fd5b506100eb60015481565b6040519081526020016100cc565b34801561010557600080fd5b506100eb60035481565b34801561011b57600080fd5b5061009161012a366004610482565b61020f565b34801561013b57600080fd5b506100eb610374565b610091610152366004610447565b61016d565b34801561016357600080fd5b506100eb60025481565b600a60015461017c919061053a565b3410156101c95760405162461bcd60e51b81526020600482015260166024820152752737ba103134b39032b737bab3b4161039b7b9393c9760511b60448201526064015b60405180910390fd5b336001600160a01b03167f643e927b32d5bfd08eccd2fcbd97057ad413850f857a2359639114e8e8dd3d7b34836040516102049291906104c7565b60405180910390a250565b6000546001600160a01b031633146102695760405162461bcd60e51b815260206004820152601a60248201527f746869732073747265616d206973206e6f7420666f7220796f7500000000000060448201526064016101c0565b6000610273610374565b9050828110156102c55760405162461bcd60e51b815260206004820152601860248201527f6e6f7420656e6f75676820696e207468652073747265616d000000000000000060448201526064016101c0565b8083600354426102d59190610579565b6102df919061055a565b6102e9919061053a565b6003546102f69190610522565b60035560405133907f485f1bb6524c663555797e00171a10f341656e59b02d6b557a0a38ba7d5d97519061032d90869086906104c7565b60405180910390a2600080546040516001600160a01b039091169185156108fc02918691818181858888f1935050505015801561036e573d6000803e3d6000fd5b50505050565b6000600254600354426103879190610579565b1115610394575060015490565b6002546003546103a49042610579565b6001546103b1919061055a565b6103bb919061053a565b905090565b600082601f8301126103d0578081fd5b813567ffffffffffffffff808211156103eb576103eb6105a6565b604051601f8301601f19908116603f01168101908282118183101715610413576104136105a6565b8160405283815286602085880101111561042b578485fd5b8360208701602083013792830160200193909352509392505050565b600060208284031215610458578081fd5b813567ffffffffffffffff81111561046e578182fd5b61047a848285016103c0565b949350505050565b60008060408385031215610494578081fd5b82359150602083013567ffffffffffffffff8111156104b1578182fd5b6104bd858286016103c0565b9150509250929050565b828152600060206040818401528351806040850152825b818110156104fa578581018301518582016060015282016104de565b8181111561050b5783606083870101525b50601f01601f191692909201606001949350505050565b6000821982111561053557610535610590565b500190565b60008261055557634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561057457610574610590565b500290565b60008282101561058b5761058b610590565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfea2646970667358221220e2cc8fb8f01c2c9025fb33b003d48d7169223d939b26657e18cf9e257aa9185064736f6c63430008040033

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

0000000000000000000000001e2ce012b27d0c0d3e717e943ef6e62717cec4ea00000000000000000000000000000000000000000000000006f05b59d3b20000000000000000000000000000000000000000000000000000000000000013c6800000000000000000000000000000000000000000000000000000000000000001

-----Decoded View---------------
Arg [0] : _toAddress (address): 0x1e2Ce012b27d0c0d3e717e943EF6e62717CEc4ea
Arg [1] : _cap (uint256): 500000000000000000
Arg [2] : _frequency (uint256): 1296000
Arg [3] : _startsFull (bool): True

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000001e2ce012b27d0c0d3e717e943ef6e62717cec4ea
Arg [1] : 00000000000000000000000000000000000000000000000006f05b59d3b20000
Arg [2] : 000000000000000000000000000000000000000000000000000000000013c680
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000001


Deployed Bytecode Sourcemap

161:1600:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1738:17;;;;;;;;;;;;;:13;:17::i;:::-;161:1600;;;;;337:32;;;;;;;;;;-1:-1:-1;337:32:0;;;;-1:-1:-1;;;;;337:32:0;;;;;;-1:-1:-1;;;;;1700:32:1;;;1682:51;;1670:2;1655:18;337:32:0;;;;;;;;374:18;;;;;;;;;;;;;;;;;;;2949:25:1;;;2937:2;2922:18;374::0;2904:76:1;426:49:0;;;;;;;;;;;;;;;;1061:452;;;;;;;;;;-1:-1:-1;1061:452:0;;;;;:::i;:::-;;:::i;870:185::-;;;;;;;;;;;;;:::i;1520:182::-;;;;;;:::i;:::-;;:::i;397:24::-;;;;;;;;;;;;;;;;1520:182;1612:2;1608:3;;:6;;;;:::i;:::-;1597:9;:17;;1589:51;;;;-1:-1:-1;;;1589:51:0;;2654:2:1;1589:51:0;;;2636:21:1;2693:2;2673:18;;;2666:30;-1:-1:-1;;;2712:18:1;;;2705:52;2774:18;;1589:51:0;;;;;;;;;1663:10;-1:-1:-1;;;;;1654:40:0;;1675:9;1686:6;1654:40;;;;;;;:::i;:::-;;;;;;;;1520:182;:::o;1061:452::-;1160:9;;-1:-1:-1;;;;;1160:9:0;1148:10;:21;1140:59;;;;-1:-1:-1;;;1140:59:0;;1946:2:1;1140:59:0;;;1928:21:1;1985:2;1965:18;;;1958:30;2024:28;2004:18;;;1997:56;2070:18;;1140:59:0;1918:176:1;1140:59:0;1209:30;1242:15;:13;:15::i;:::-;1209:48;;1299:6;1275:22;:30;;1267:66;;;;-1:-1:-1;;;1267:66:0;;2301:2:1;1267:66:0;;;2283:21:1;2340:2;2320:18;;;2313:30;2379:26;2359:18;;;2352:54;2423:18;;1267:66:0;2273:174:1;1267:66:0;1394:22;1385:6;1377:4;;1359:15;:22;;;;:::i;:::-;1358:33;;;;:::i;:::-;:58;;;;:::i;:::-;1350:4;;:67;;;;:::i;:::-;1343:4;:74;1432:38;;1442:10;;1432:38;;;;1454:6;;1462;;1432:38;:::i;:::-;;;;;;;;1480:9;;;:26;;-1:-1:-1;;;;;1480:9:0;;;;:26;;;;;1499:6;;1480:26;:9;:26;1499:6;1480:9;:26;;;;;;;;;;;;;;;;;;;;;1061:452;;;:::o;870:185::-;916:7;957:9;;950:4;;934:15;:20;;;;:::i;:::-;:32;931:63;;;-1:-1:-1;983:3:0;;;870:185::o;931:63::-;1040:9;;1031:4;;1015:20;;:15;:20;:::i;:::-;1008:3;;:28;;;;:::i;:::-;1007:42;;;;:::i;:::-;1000:49;;870:185;:::o;14:739:1:-;57:5;110:3;103:4;95:6;91:17;87:27;77:2;;132:5;125;118:20;77:2;172:6;159:20;198:18;235:2;231;228:10;225:2;;;241:18;;:::i;:::-;316:2;310:9;284:2;370:13;;-1:-1:-1;;366:22:1;;;390:2;362:31;358:40;346:53;;;414:18;;;434:22;;;411:46;408:2;;;460:18;;:::i;:::-;500:10;496:2;489:22;535:2;527:6;520:18;581:3;574:4;569:2;561:6;557:15;553:26;550:35;547:2;;;602:5;595;588:20;547:2;670;663:4;655:6;651:17;644:4;636:6;632:17;619:54;693:15;;;710:4;689:26;682:41;;;;-1:-1:-1;697:6:1;67:686;-1:-1:-1;;;67:686:1:o;758:342::-;827:6;880:2;868:9;859:7;855:23;851:32;848:2;;;901:6;893;886:22;848:2;946:9;933:23;979:18;971:6;968:30;965:2;;;1016:6;1008;1001:22;965:2;1044:50;1086:7;1077:6;1066:9;1062:22;1044:50;:::i;:::-;1034:60;838:262;-1:-1:-1;;;;838:262:1:o;1105:410::-;1183:6;1191;1244:2;1232:9;1223:7;1219:23;1215:32;1212:2;;;1265:6;1257;1250:22;1212:2;1306:9;1293:23;1283:33;;1367:2;1356:9;1352:18;1339:32;1394:18;1386:6;1383:30;1380:2;;;1431:6;1423;1416:22;1380:2;1459:50;1501:7;1492:6;1481:9;1477:22;1459:50;:::i;:::-;1449:60;;;1202:313;;;;;:::o;2985:674::-;3162:6;3151:9;3144:25;3125:4;3188:2;3226;3221;3210:9;3206:18;3199:30;3258:6;3252:13;3301:6;3296:2;3285:9;3281:18;3274:34;3326:4;3339:140;3353:6;3350:1;3347:13;3339:140;;;3448:14;;;3444:23;;3438:30;3414:17;;;3433:2;3410:26;3403:66;3368:10;;3339:140;;;3497:6;3494:1;3491:13;3488:2;;;3567:4;3562:2;3553:6;3542:9;3538:22;3534:31;3527:45;3488:2;-1:-1:-1;3643:2:1;3622:15;-1:-1:-1;;3618:29:1;3603:45;;;;3650:2;3599:54;;3134:525;-1:-1:-1;;;;3134:525:1:o;3664:128::-;3704:3;3735:1;3731:6;3728:1;3725:13;3722:2;;;3741:18;;:::i;:::-;-1:-1:-1;3777:9:1;;3712:80::o;3797:217::-;3837:1;3863;3853:2;;-1:-1:-1;;;3888:31:1;;3942:4;3939:1;3932:15;3970:4;3895:1;3960:15;3853:2;-1:-1:-1;3999:9:1;;3843:171::o;4019:168::-;4059:7;4125:1;4121;4117:6;4113:14;4110:1;4107:21;4102:1;4095:9;4088:17;4084:45;4081:2;;;4132:18;;:::i;:::-;-1:-1:-1;4172:9:1;;4071:116::o;4192:125::-;4232:4;4260:1;4257;4254:8;4251:2;;;4265:18;;:::i;:::-;-1:-1:-1;4302:9:1;;4241:76::o;4322:127::-;4383:10;4378:3;4374:20;4371:1;4364:31;4414:4;4411:1;4404:15;4438:4;4435:1;4428:15;4454:127;4515:10;4510:3;4506:20;4503:1;4496:31;4546:4;4543:1;4536:15;4570:4;4567:1;4560:15

Swarm Source

ipfs://e2cc8fb8f01c2c9025fb33b003d48d7169223d939b26657e18cf9e257aa91850

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