This file contains 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
FemtoStorage.slotFor("balances").and(userAddress).increment(); // Increases value by 1 | |
FemtoStorage.slotFor("balances").and(userAddress).increaseBy(42); // Increases value by 42 | |
FemtoStorage.slotFor("balances").and(userAddress).decreaseBy(42); // Decreases value by 42 |
This file contains 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
FemtoStorage.slotFor("someList").push(anAddress); | |
FemtoStorage.slotFor("someList").length(); // 1 | |
FemtoStorage.slotFor("someList").index(0).getAddress(); // anAddress |
This file contains 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.7; | |
import "./Resolver.sol"; | |
contract EtherRouter { | |
Resolver resolver; | |
function EtherRouter(Resolver _resolver) { | |
resolver = _resolver; | |
} |
This file contains 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
import "./Resolver.sol"; | |
contract EtherRouter { | |
Resolver resolver; | |
address creator; | |
function EtherRouter(Resolver _resolver) { | |
resolver = _resolver; | |
creator = msg.sender; | |
} |
This file contains 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
calldatacopy(mload(0x40), 0, calldatasize) | |
delegatecall(gas, destination, mload(0x40), calldatasize, mload(0x40), outsize) | |
return(mload(0x40), outsize) |
This file contains 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
calldatacopy(mload(0x40), 0, calldatasize) | |
delegatecall(gas, destination, mload(0x40), calldatasize, mload(0x40), outsize) |
This file contains 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 EtherRouter { | |
function() { | |
// Look up the latest version of the code, and delegatecall | |
} | |
} |
This file contains 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 EtherRouter { | |
function() { | |
// Look up the latest version of the contract, and then delegatecall. | |
} | |
} |
This file contains 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
import "BrokenToken.sol"; | |
contract Bounty { | |
// This bounty will pay out if you can cause BrokenToken's balance | |
// to be lower than its totalSupply, which would mean that it doesn't | |
// have sufficient ether for everyone to withdraw. | |
uint public totalBounty; | |
bool public claimed; | |
mapping(address => address) public owners; |
This file contains 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 TokenWithInvariants { | |
mapping(address => uint) public balanceOf; | |
uint public totalSupply; | |
modifier checkInvariants { | |
_ | |
if (this.balance < totalSupply) throw; | |
} | |
function deposit(uint amount) checkInvariants { |
NewerOlder