Skip to content

Instantly share code, notes, and snippets.

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)
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()}`)
function currentTime() returns (uint256 _currentTime) {
return now;
}
pragma solidity ^0.4.8;
import "./ThresholdPool.sol";
contract ThresholdPoolMock is ThresholdPool () {
uint256 public _now;
function ThresholdPoolMock (
uint256 _poolTime,
0xDf08F82De32B8d460adbE8D72043E3a7e25A3B39
0x44360017c1460BC0149946b4fad97665c25586b0
pragma solidity ^0.4.18;
import "zeppelin-solidity/contracts/ownership/Ownable.sol";
contract Proxy is Ownable {
event Upgraded(address indexed implementation);
address internal _implementation;
contract ShrimpCoin is StorageConsumer, Proxy, DetailedToken {
function ShrimpCoin(KeyValueStorage storage_)
public
StorageConsumer(storage_)
{
name = "ShrimpCoin";
symbol = "SHRMP";
decimals = 18;
}
}
contract Thing is Proxy {
uint256 num;
string name = "Thing";
}
contract ThingDelegate {
uint256 n;
function incrementNum() public {
n = n + 1;
pragma solidity ^0.4.18;
import "./StorageStateful.sol";
contract TokenDelegate is StorageStateful {
function totalSupply() public view returns (uint256) {
return _storage.getUint("totalSupply");
}