UNPKG

vaultcontract

Version:

Vault contract. Implementation of a safe timelock in solidity

9 lines (7 loc) 18.2 kB
/* This is an autogenerated file. DO NOT EDIT MANUALLY */ exports.EscapableAbi = [{"constant":false,"inputs":[],"name":"escapeHatch","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"escapeHatchCaller","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_newEscapeHatchCaller","type":"address"}],"name":"changeEscapeCaller","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"changeOwner","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"escapeHatchDestination","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"inputs":[{"name":"_escapeHatchCaller","type":"address"},{"name":"_escapeHatchDestination","type":"address"}],"payable":false,"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"amount","type":"uint256"}],"name":"EscapeHatchCalled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"oldOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"NewOwner","type":"event"}]; exports.EscapableByteCode = "0x6060604052341561000f57600080fd5b6040516040806103d083398101604052808051919060200180519150505b5b60008054600160a060020a03191633600160a060020a03161790555b60018054600160a060020a03808516600160a060020a03199283161790925560028054928416929091169190911790555b50505b6103438061008d6000396000f300606060405236156100755763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631554611f811461007a5780631f6eb6e71461008f578063681617c7146100be5780638da5cb5b146100df578063a6f9dae11461010e578063f5b612301461012f575b600080fd5b341561008557600080fd5b61008d61015e565b005b341561009a57600080fd5b6100a261020a565b604051600160a060020a03909116815260200160405180910390f35b34156100c957600080fd5b61008d600160a060020a0360043516610219565b005b34156100ea57600080fd5b6100a261027e565b604051600160a060020a03909116815260200160405180910390f35b341561011957600080fd5b61008d600160a060020a036004351661028d565b005b341561013a57600080fd5b6100a2610308565b604051600160a060020a03909116815260200160405180910390f35b60015460009033600160a060020a0390811691161480159061018f575060005433600160a060020a03908116911614155b1561019957600080fd5b50600254600160a060020a0330811631911681156108fc0282604051600060405180830381858888f1935050505015156101d257600080fd5b7f3a7a1ba90aaa86fa9f6b921c3d600a5c870f8ebd05e7fbd30f93930f3caa5db58160405190815260200160405180910390a15b5b50565b600154600160a060020a031681565b60015433600160a060020a03908116911614801590610247575060005433600160a060020a03908116911614155b1561025157600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600054600160a060020a031681565b60005433600160a060020a039081169116146102a857600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038381169182179092559033167f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236460405160405180910390a35b5b50565b600254600160a060020a0316815600a165627a7a72305820077a9cbb54e933415317aee212ba07e8b74880ad414b81822a9793f0e22c855a0029"; exports.OwnedAbi = [{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"changeOwner","outputs":[],"payable":false,"type":"function"},{"inputs":[],"payable":false,"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"oldOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"NewOwner","type":"event"}]; exports.OwnedByteCode = "0x6060604052341561000f57600080fd5b5b60008054600160a060020a03191633600160a060020a03161790555b5b61018f8061003c6000396000f300606060405263ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416638da5cb5b8114610048578063a6f9dae114610084575b600080fd5b341561005357600080fd5b61005b6100b2565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b341561008f57600080fd5b6100b073ffffffffffffffffffffffffffffffffffffffff600435166100ce565b005b60005473ffffffffffffffffffffffffffffffffffffffff1681565b6000543373ffffffffffffffffffffffffffffffffffffffff9081169116146100f657600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff191673ffffffffffffffffffffffffffffffffffffffff8381169182179092559033167f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236460405160405180910390a35b5b505600a165627a7a723058201e6931db4e95ca52ece1d7489008253546e831ff6311c32e39aaf94ec07f6cf60029"; exports.VaultAbi = [{"constant":true,"inputs":[],"name":"maxSecurityGuardDelay","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"escapeHatch","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_newTimeLock","type":"uint256"}],"name":"setTimelock","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"escapeHatchCaller","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"string"},{"name":"_reference","type":"bytes32"},{"name":"_recipient","type":"address"},{"name":"_amount","type":"uint256"},{"name":"_paymentDelay","type":"uint256"}],"name":"authorizePayment","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_newEscapeHatchCaller","type":"address"}],"name":"changeEscapeCaller","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"numberOfAuthorizedPayments","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_authorize","type":"bool"}],"name":"authorizeSpender","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_idPayment","type":"uint256"}],"name":"cancelPayment","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_idPayment","type":"uint256"},{"name":"_delay","type":"uint256"}],"name":"delayPayment","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_idPayment","type":"uint256"}],"name":"collectAuthorizedPayment","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"authorizedPayments","outputs":[{"name":"name","type":"string"},{"name":"reference","type":"bytes32"},{"name":"spender","type":"address"},{"name":"earliestPayTime","type":"uint256"},{"name":"canceled","type":"bool"},{"name":"paid","type":"bool"},{"name":"recipient","type":"address"},{"name":"amount","type":"uint256"},{"name":"securityGuardDelay","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"receiveEther","outputs":[],"payable":true,"type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"changeOwner","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"securityGuard","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_newSecurityGuard","type":"address"}],"name":"setSecurityGuard","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"timeLock","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"allowedSpenders","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_maxSecurityGuardDelay","type":"uint256"}],"name":"setMaxSecurityGuardDelay","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"absoluteMinTimeLock","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"escapeHatchDestination","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"inputs":[{"name":"_escapeHatchCaller","type":"address"},{"name":"_escapeHatchDestination","type":"address"},{"name":"_absoluteMinTimeLock","type":"uint256"},{"name":"_timeLock","type":"uint256"},{"name":"_securityGuard","type":"address"},{"name":"_maxSecurityGuardDelay","type":"uint256"}],"payable":false,"type":"constructor"},{"payable":true,"type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idPayment","type":"uint256"},{"indexed":true,"name":"recipient","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"PaymentAuthorized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idPayment","type":"uint256"},{"indexed":true,"name":"recipient","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"PaymentExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"idPayment","type":"uint256"}],"name":"PaymentCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"EtherReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"authorized","type":"bool"}],"name":"SpenderAuthorization","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"amount","type":"uint256"}],"name":"EscapeHatchCalled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"oldOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"NewOwner","type":"event"}]; exports.VaultByteCode = "0x6060604052341561000f57600080fd5b60405160c0806110168339810160405280805191906020018051919060200180519190602001805191906020018051919060200180519150505b85855b5b60008054600160a060020a03191633600160a060020a03161790555b60018054600160a060020a03808516600160a060020a03199283161790925560028054928416929091169190911790555b50506005849055600683905560048054600160a060020a031916600160a060020a03841617905560078190555b5050505050505b610f39806100dd6000396000f300606060405236156101255763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630b2e742381146101365780631554611f1461015b5780631e891c0a146101705780631f6eb6e71461018857806320ea2533146101b7578063681617c71461023657806368b8c5a114610257578063793c0fd41461027c5780638422927d146102a2578063846a5dde146102ba5780638da5cb5b146102d557806392e4b8a414610304578063a0927a6a1461031c578063a3912ec814610409578063a6f9dae114610413578063b2ca3ec414610434578063bb2a51d114610463578063d085835a14610484578063d8528af0146104a9578063da4793ac146104dc578063ea8a66c7146104f4578063f5b6123014610519575b6101345b610131610548565b5b565b005b341561014157600080fd5b610149610588565b60405190815260200160405180910390f35b341561016657600080fd5b61013461058e565b005b341561017b57600080fd5b61013460043561063a565b005b341561019357600080fd5b61019b61066e565b604051600160a060020a03909116815260200160405180910390f35b34156101c257600080fd5b61014960046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965050843594600160a060020a0360208201351694506040810135935060600135915061067d9050565b60405190815260200160405180910390f35b341561024157600080fd5b610134600160a060020a03600435166107ed565b005b341561026257600080fd5b610149610852565b60405190815260200160405180910390f35b341561028757600080fd5b610134600160a060020a03600435166024351515610859565b005b34156102ad57600080fd5b6101346004356108d5565b005b34156102c557600080fd5b61013460043560243561098d565b005b34156102e057600080fd5b61019b610a43565b604051600160a060020a03909116815260200160405180910390f35b341561030f57600080fd5b610134600435610a52565b005b341561032757600080fd5b610332600435610bd9565b60405160208101899052600160a060020a03808916604083015260608201889052861515608083015285151560a0830152841660c082015260e081018390526101008082018390526101208083528b546002600182161590930260001901169190910490820181905281906101408201908c9080156103f25780601f106103c7576101008083540402835291602001916103f2565b820191906000526020600020905b8154815290600101906020018083116103d557829003601f168201915b50509a505050505050505050505060405180910390f35b610134610548565b005b341561041e57600080fd5b610134600160a060020a0360043516610c46565b005b341561043f57600080fd5b61019b610cc1565b604051600160a060020a03909116815260200160405180910390f35b341561046e57600080fd5b610134600160a060020a0360043516610cd0565b005b341561048f57600080fd5b610149610d18565b60405190815260200160405180910390f35b34156104b457600080fd5b6104c8600160a060020a0360043516610d1e565b604051901515815260200160405180910390f35b34156104e757600080fd5b610134600435610d33565b005b34156104ff57600080fd5b610149610d58565b60405190815260200160405180910390f35b341561052457600080fd5b61019b610d5e565b604051600160a060020a03909116815260200160405180910390f35b33600160a060020a03167f1e57e3bb474320be3d2c77138f75b7c3941292d647f5f9634e33a8e94e0e069b3460405190815260200160405180910390a25b565b60075481565b60015460009033600160a060020a039081169116148015906105bf575060005433600160a060020a03908116911614155b156105c957600080fd5b50600254600160a060020a0330811631911681156108fc0282604051600060405180830381858888f19350505050151561060257600080fd5b7f3a7a1ba90aaa86fa9f6b921c3d600a5c870f8ebd05e7fbd30f93930f3caa5db58160405190815260200160405180910390a15b5b50565b60005433600160a060020a0390811691161461065557600080fd5b60055481101561066457600080fd5b60068190555b5b50565b600154600160a060020a031681565b600160a060020a0333166000908152600860205260408120548190819060ff1615156106a857600080fd5b60038054925082906106bd9060018301610d6d565b5060038054839081106106cc57fe5b906000526020600020906007020160005b5060028101805473ffffffffffffffffffffffffffffffffffffffff191633600160a060020a03161790559050670de0b6b3a764000084111561071f57600080fd5b600654841015610733576006544201610737565b8342015b600382015560048101805475ffffffffffffffffffffffffffffffffffffffff0000191662010000600160a060020a038916021790556005810185905580888051610786929160200190610d9f565b50600181018790556004810154600582015462010000909104600160a060020a03169083907f47e9633c99dd05fabd1b937e7c85f9e00d6866bfd2e5885e0091f40a173be3d39060405190815260200160405180910390a38192505b505095945050505050565b60015433600160a060020a0390811691161480159061081b575060005433600160a060020a03908116911614155b1561082557600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b6003545b90565b60005433600160a060020a0390811691161461087457600080fd5b600160a060020a03821660008181526008602052604090819020805460ff19168415151790557f801f568efbc3346a6ae3d0c3eb335a30d64e0d3cf08f1c39626d62cd5c82728190839051901515815260200160405180910390a25b5b5050565b6000805433600160a060020a039081169116146108f157600080fd5b60035482106108ff57600080fd5b600380548390811061090d57fe5b906000526020600020906007020160005b50600481015490915060ff161561093457600080fd5b6004810154610100900460ff161561094b57600080fd5b60048101805460ff19166001179055817ffdf197ed54809861dafe0b4d391843652730ac67274c1e9e46db7687dccaa30160405160405180910390a25b5b5050565b60045460009033600160a060020a039081169116146109ab57600080fd5b60035483106109b957600080fd5b670de0b6b3a76400008211156109ce57600080fd5b60038054849081106109dc57fe5b906000526020600020906007020160005b509050600754828260060154011180610a0f57506004810154610100900460ff165b80610a1e5750600481015460ff165b15610a2857600080fd5b60068101805483019055600381018054830190555b5b505050565b600054600160a060020a031681565b6003546000908210610a6357600080fd5b6003805483908110610a7157fe5b906000526020600020906007020160005b50600481015490915033600160a060020a03908116620100009092041614610aa957600080fd5b6002810154600160a060020a031660009081526008602052604090205460ff161515610ad457600080fd5b8060030154421015610ae557600080fd5b600481015460ff1615610af757600080fd5b6004810154610100900460ff1615610b0e57600080fd5b806005015430600160a060020a0316311015610b2957600080fd5b60048101805461010061ff00199091161790819055600582015462010000909104600160a060020a0316906108fc81150290604051600060405180830381858888f193505050501515610b7b57600080fd5b8060040160029054906101000a9004600160a060020a0316600160a060020a0316827f7f5bfe3018715b26a7067888a5c42912fbb3485170b8154ea9a448661f2f0de2836005015460405190815260200160405180910390a35b5050565b6003805482908110610be757fe5b906000526020600020906007020160005b506001810154600282015460038301546004840154600585015460068601549596509394600160a060020a0393841694929360ff808416946101008504909116936201000090049091169189565b60005433600160a060020a03908116911614610c6157600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038381169182179092559033167f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236460405160405180910390a35b5b50565b600454600160a060020a031681565b60005433600160a060020a03908116911614610ceb57600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b60065481565b60086020526000908152604090205460ff1681565b60005433600160a060020a03908116911614610d4e57600080fd5b60078190555b5b50565b60055481565b600254600160a060020a031681565b815481835581811511610a3d57600702816007028360005260206000209182019101610a3d9190610e1e565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610de057805160ff1916838001178555610e0d565b82800160010185558215610e0d579182015b82811115610e0d578251825591602001919060010190610df2565b5b50610e1a929150610ea4565b5090565b61085691905b80821115610e1a576000610e388282610ec5565b5060006001820181905560028201805473ffffffffffffffffffffffffffffffffffffffff191690556003820181905560048201805475ffffffffffffffffffffffffffffffffffffffffffff19169055600582018190556006820155600701610e24565b5090565b90565b61085691905b80821115610e1a5760008155600101610eaa565b5090565b90565b50805460018160011615610100020316600290046000825580601f10610eeb5750610636565b601f0160209004906000526020600020908101906106369190610ea4565b5b505600a165627a7a72305820deeb07de1f535190d93c3634dd12318628bf58edc363cb9b79430f976dc8f0010029";