Skip to content

Instantly share code, notes, and snippets.

View pprados's full-sized avatar

Philippe PRADOS pprados

View GitHub Profile
pragma solidity ^0.4.8; // Enable Optimization
/**
* Multi owned events.
*/
contract MultiOwnedEvents {
// EVENTS
// this contract only has six types of events: it can accept a confirmation, in which case
// we record owner and operation (hash) alongside it.
event Confirmation(address owner, bytes32 operation);
pragma solidity ^0.4.8;
contract Versionable {
event VersionChanged(Versionable version);
Versionable public /* FIXME internal*/ currentVersion;
bool internal isInit;
address private owner;
/**
pragma solidity ^0.4.8;
/**
* Interface shared by Proxy, ContractV1 and ContractV2.
*/
contract Interface {
/** return uint, depend of the current version. */
function doSomething() constant returns(uint);
}
pragma solidity ^0.4.8;
/**
* Interface shared by Proxy, ContractV1 and ContractV2.
*/
contract Interface {
/** return uint, depend of the current version. */
function doSomething() constant returns(uint);
}
pragma solidity ^0.4.8;
/**
* Interface shared by Proxy, ContractV1 and ContractV2.
*/
contract Interface {
/** return uint, depend of the current version. */
function doSomething() constant returns(uint);
}
pragma solidity ^0.4.8;
// -- Technical contract
/**
* Database contract.
* Use to share the state between v1 and v2.
*/
contract ContractDB {
/** Generic map. */
mapping(string => uint) map;
pragma solidity ^0.4.8;
/**
* The version 1 of the contract.
* The attr is initialized to 1000.
* The method doSomething() return attr + version = 1001
*/
contract ContractV1 {
uint constant private version=1;
uint public attr=1000;