This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const myContract = await newMyContract(init) | |
| await myContract.contribute() | |
| await myContract.changeTime(finalTime) | |
| await myContract.recipientWithdraw() | |
| const balance = await myContract.getBalance() | |
| assert.equal(balance.toNumber(), expectedBalance) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async function logMyContract (myContract) { | |
| console.log("") | |
| console.log("MyContract:") | |
| console.log("--------------") | |
| console.log(`BALANCE: ${getBalanceInEth(myContract.address)}`) | |
| console.log(`startTime=${await myContract.startTime.call()}`) | |
| console.log(`poolTime=${await myContract.poolTime.call()}`) | |
| console.log(`threshold=${await myContract.threshold.call()}`) | |
| console.log(`recipient=${await myContract.recipient.call()}`) | |
| console.log(`currentTime()=${await myContract.currentTime.call()}`) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function currentTime() returns (uint256 _currentTime) { | |
| return now; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity ^0.4.8; | |
| import "./ThresholdPool.sol"; | |
| contract ThresholdPoolMock is ThresholdPool () { | |
| uint256 public _now; | |
| function ThresholdPoolMock ( | |
| uint256 _poolTime, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 0xDf08F82De32B8d460adbE8D72043E3a7e25A3B39 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 0x44360017c1460BC0149946b4fad97665c25586b0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity ^0.4.18; | |
| import "zeppelin-solidity/contracts/ownership/Ownable.sol"; | |
| contract Proxy is Ownable { | |
| event Upgraded(address indexed implementation); | |
| address internal _implementation; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| contract ShrimpCoin is StorageConsumer, Proxy, DetailedToken { | |
| function ShrimpCoin(KeyValueStorage storage_) | |
| public | |
| StorageConsumer(storage_) | |
| { | |
| name = "ShrimpCoin"; | |
| symbol = "SHRMP"; | |
| decimals = 18; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| contract Thing is Proxy { | |
| uint256 num; | |
| string name = "Thing"; | |
| } | |
| contract ThingDelegate { | |
| uint256 n; | |
| function incrementNum() public { | |
| n = n + 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity ^0.4.18; | |
| import "./StorageStateful.sol"; | |
| contract TokenDelegate is StorageStateful { | |
| function totalSupply() public view returns (uint256) { | |
| return _storage.getUint("totalSupply"); | |
| } | |