Comparing version 1.0.1 to 2.0.0
@@ -1,127 +0,1 @@ | ||
{ | ||
"lockfile_version": "1", | ||
"version": "1.0.0", | ||
"package_name": "escrow", | ||
"sources": { | ||
"./contracts/SafeSendLib.sol": "ipfs://QmcnzhWjaV71qzKntv4burxyix9W2yBA2LrJB4k99tGqkZ", | ||
"./contracts/Escrow.sol": "ipfs://QmSwmFLT5B5aag485ZWvHmfdC1cU5EFdcqs1oqE5KsxGMw" | ||
}, | ||
"contract_types": { | ||
"SafeSendLib": { | ||
"bytecode": "0x606060405234610000575b60ad806100176000396000f36504062dabbdf050606060405260e060020a60003504639341231c81146024575b6000565b60306004356024356044565b604080519115158252519081900360200190f35b60003073ffffffffffffffffffffffffffffffffffffffff16318211156068576000565b60405173ffffffffffffffffffffffffffffffffffffffff84169083156108fc029084906000818181858888f19350505050151560a3576000565b5060015b9291505056", | ||
"runtime_bytecode": "0x6504062dabbdf050606060405260e060020a60003504639341231c81146024575b6000565b60306004356024356044565b604080519115158252519081900360200190f35b60003073ffffffffffffffffffffffffffffffffffffffff16318211156068576000565b60405173ffffffffffffffffffffffffffffffffffffffff84169083156108fc029084906000818181858888f19350505050151560a3576000565b5060015b9291505056", | ||
"abi": [ | ||
{ | ||
"constant": false, | ||
"inputs": [ | ||
{"name": "recipient", "type": "address"}, | ||
{"name": "value", "type": "uint256"} | ||
], | ||
"name": "sendOrThrow", | ||
"outputs": [ | ||
{"name": "", "type": "bool"} | ||
], | ||
"payable": false, | ||
"type": "function" | ||
} | ||
], | ||
"compiler": { | ||
"type": "solc", | ||
"version": "0.4.6+commit.2dabbdf0.Darwin.appleclang", | ||
"settings": { | ||
"optimize": true | ||
} | ||
}, | ||
"natspec": { | ||
"author": "Piper Merriam <pipermerriam@gmail.com>", | ||
"methods": { | ||
"sendOrThrow(address,uint256)": { | ||
"details": "Attempts to send the specified amount to the recipient throwing an error if it fails", | ||
"params": { | ||
"recipient": "The address that the funds should be to.", | ||
"value": "The amount in wei that should be sent." | ||
} | ||
} | ||
}, | ||
"title": "Library for safe sending of ether." | ||
} | ||
}, | ||
"Escrow": { | ||
"runtime_bytecode": "0x606060405260e060020a600035046366d003ac811461003457806367e404ce1461005d57806369d8957514610086575b610000565b3461000057610041610095565b60408051600160a060020a039092168252519081900360200190f35b34610000576100416100a4565b60408051600160a060020a039092168252519081900360200190f35b34610000576100936100b3565b005b600154600160a060020a031681565b600054600160a060020a031681565b60005433600160a060020a039081169116141561014857600154604080516000602091820152815160e260020a6324d048c7028152600160a060020a03938416600482015230909316316024840152905173__SafeSendLib___________________________92639341231c926044808301939192829003018186803b156100005760325a03f41561000057506101e2915050565b60015433600160a060020a039081169116141561002f576000805460408051602090810193909352805160e260020a6324d048c7028152600160a060020a039283166004820152309092163160248301525173__SafeSendLib___________________________92639341231c9260448082019391829003018186803b156100005760325a03f41561000057506101e2915050565b610000565b5b5b56", | ||
"abi": [ | ||
{ | ||
"constant": true, | ||
"inputs": [], | ||
"name": "recipient", | ||
"outputs": [ | ||
{"name": "","type": "address"} | ||
], | ||
"payable": false, | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": true, | ||
"inputs": [], | ||
"name": "sender", | ||
"outputs": [ | ||
{"name": "","type": "address"} | ||
], | ||
"payable": false, | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": false, | ||
"inputs": [], | ||
"name": "releaseFunds", | ||
"outputs": [], | ||
"payable": false, | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{"name": "_recipient","type": "address"} | ||
], | ||
"payable": true, | ||
"type": "constructor" | ||
} | ||
], | ||
"compiler": { | ||
"type": "solc", | ||
"version": "0.4.6+commit.2dabbdf0.Darwin.appleclang", | ||
"settings": { | ||
"optimize": true | ||
} | ||
}, | ||
"natspec": { | ||
"author": "Piper Merriam <pipermerriam@gmail.com>", | ||
"methods": { | ||
"releaseFunds()": { | ||
"details": "Releases the escrowed funds to the other party.", | ||
"notice": "This will release the escrowed funds to the other party." | ||
} | ||
}, | ||
"title": "Contract for holding funds in escrow between two semi trusted parties." | ||
} | ||
} | ||
}, | ||
"deployments": { | ||
"blockchain://41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d/block/e76cf1f29a4689f836d941d7ffbad4e4b32035a441a509dc53150c2165f8e90d": { | ||
"SafeMathLib": { | ||
"contract_type": "SafeSendLib", | ||
"address": "0x80d7f7a33e551455a909e1b914c4fd4e6d0074cc", | ||
"transaction": "0x74561167f360eaa20ea67bd4b4bf99164aabb36b2287061e86137bfa0d35d5fb", | ||
"block": "0x46554e3cf7b768b1cc1990ad4e2d3a137fe9373c0dda765f4db450cd5fa64102" | ||
}, | ||
"Escrow": { | ||
"contract_type": "Escrow", | ||
"address": "0x35b6b723786fd8bd955b70db794a1f1df56e852f", | ||
"transaction": "0x905fbbeb6069d8b3c8067d233f58b0196b43da7a20b839f3da41f69c87da2037", | ||
"block": "0x9b39dcab3d665a51755dedef56e7c858702f5817ce926a0cd8ff3081c5159b7f", | ||
"link_dependencies": [ | ||
{"offset": 524, "value": "SafeSendLib"}, | ||
{"offset": 824, "value": "SafeSendLib"} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
{"contract_types":{"Escrow":{"abi":[{"constant":true,"inputs":[],"name":"recipient","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"sender","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"releaseFunds","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_recipient","type":"address"}],"payable":true,"stateMutability":"payable","type":"constructor"}],"compiler":{"name":"solc","settings":{"optimize":true},"version":"0.4.24+commit.e67f0147.Emscripten.clang"},"natspec":{"author":"Piper Merriam <pipermerriam@gmail.com>","methods":{"releaseFunds()":{"details":"Releases the escrowed funds to the other party.","notice":"This will release the escrowed funds to the other party."}},"title":"Contract for holding funds in escrow between two semi trusted parties."},"runtime_bytecode":{"bytecode":"0x6080604052600436106100565763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166366d003ac811461005b57806367e404ce1461008c57806369d89575146100a1575b600080fd5b34801561006757600080fd5b506100706100b8565b60408051600160a060020a039092168252519081900360200190f35b34801561009857600080fd5b506100706100c7565b3480156100ad57600080fd5b506100b66100d6565b005b600154600160a060020a031681565b600054600160a060020a031681565b600054600160a060020a031633141561019857600154604080517f9341231c000000000000000000000000000000000000000000000000000000008152600160a060020a039092166004830152303160248301525173000000000000000000000000000000000000000091639341231c916044808301926020929190829003018186803b15801561016657600080fd5b505af415801561017a573d6000803e3d6000fd5b505050506040513d602081101561019057600080fd5b506102289050565b600154600160a060020a031633141561005657600054604080517f9341231c000000000000000000000000000000000000000000000000000000008152600160a060020a039092166004830152303160248301525173000000000000000000000000000000000000000091639341231c916044808301926020929190829003018186803b15801561016657600080fd5b5600a165627a7a723058201766d3411ff91d047cf900369478c682a497a6e560cd1b2fe4d9f2d6fe13b4210029","link_references":[{"length":20,"name":"SafeSendLib","offsets":[301,495]}]}},"SafeSendLib":{"abi":[{"constant":false,"inputs":[{"name":"recipient","type":"address"},{"name":"value","type":"uint256"}],"name":"sendOrThrow","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"}],"compiler":{"name":"solc","settings":{"optimize":true},"version":"0.4.24+commit.e67f0147.Emscripten.clang"},"deployment_bytecode":{"bytecode":"0x61011c610030600b82828239805160001a6073146000811461002057610022565bfe5b5030600052607381538281f300730000000000000000000000000000000000000000301460806040526004361060555763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416639341231c8114605a575b600080fd5b818015606557600080fd5b50608873ffffffffffffffffffffffffffffffffffffffff60043516602435609c565b604080519115158252519081900360200190f35b6000303182111560ab57600080fd5b60405173ffffffffffffffffffffffffffffffffffffffff84169083156108fc029084906000818181858888f19350505050151560e757600080fd5b506001929150505600a165627a7a723058200300c406f268c8026cb55ced0cb3c2ee571e2225be95d6c43816ce75e303dd6f0029"},"natspec":{"author":"Piper Merriam <pipermerriam@gmail.com>","methods":{"sendOrThrow(address,uint256)":{"details":"Attempts to send the specified amount to the recipient throwing an error if it fails","params":{"recipient":"The address that the funds should be to.","value":"The amount in wei that should be sent."}}},"title":"Library for safe sending of ether."},"runtime_bytecode":{"bytecode":"0x734f5b11c860b37b68de6d14fb7e7b5f18a9a1bdc0301460806040526004361060555763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416639341231c8114605a575b600080fd5b818015606557600080fd5b50608873ffffffffffffffffffffffffffffffffffffffff60043516602435609c565b604080519115158252519081900360200190f35b6000303182111560ab57600080fd5b60405173ffffffffffffffffffffffffffffffffffffffff84169083156108fc029084906000818181858888f19350505050151560e757600080fd5b506001929150505600a165627a7a723058200300c406f268c8026cb55ced0cb3c2ee571e2225be95d6c43816ce75e303dd6f0029"}}},"deployments":{"blockchain://41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d/block/d2e1b78094a358550ae340c47a00aee43a5444fb44235fdb73e7e07ff5faeadb":{"Escrow":{"address":"0x8c1968deB27251A3f1F4508df32dA4dfD1b7b57f","block":"0x4d1a618802bb87752d95db453dddeea622820424a2f836bedf8769a67ee276b8","contract_type":"Escrow","runtime_bytecode":{"link_dependencies":[{"offsets":[301,495],"type":"reference","value":"SafeSendLib"}]},"transaction":"0xc60e32c63abf34579390ef65d83cc5eb52225de38c3eeca2e5afa961d71c16d0"},"SafeSendLib":{"address":"0x4F5B11c860b37b68DE6D14Fb7e7b5f18A9A1bdC0","block":"0x29e9393113b96ff1e9048710355d213dafc9896fd2b97ca74e3f3e6aaf4092c6","contract_type":"SafeSendLib","transaction":"0x208492026eff5fc838f23d12e930239dcfae9cde9cc96b87b38bb50bd1465b81"}}},"manifest_version":"2","package_name":"escrow","sources":{"./contracts/Escrow.sol":"ipfs://Qmbm91zWRqwjuRTSbuyVNUAV7umu5o594MzBMxWbEMRQPj","./contracts/SafeSendLib.sol":"ipfs://QmXsTBDZvtGBsJHg1HKinz1p6QvhphLV8UPX6Jqo3LcKW3"},"version":"1.0.0"} |
@@ -1,21 +0,1 @@ | ||
{ | ||
"lockfile_version": "1", | ||
"version": "1.0.0", | ||
"package_name": "owned", | ||
"meta": { | ||
"license": "MIT", | ||
"authors": [ | ||
"Piper Merriam <pipermerriam@gmail.com>" | ||
], | ||
"description": "Reusable contracts which implement a privileged'owner' model for authorization", | ||
"keywords": [ | ||
"authorization" | ||
], | ||
"links": { | ||
"documentation": "ipfs://QmQiqrwqdav5bV8mtv4PqGksGcDWo43f7PAZYwhJqNEv2j" | ||
} | ||
}, | ||
"sources": { | ||
"./contracts/owned.sol": "ipfs://QmUjYUcX9kLv2FQH8nwc3RLLXtU3Yv5XFpvEjFcAKXB6xD" | ||
} | ||
} | ||
{"manifest_version":"2","meta":{"authors":["Piper Merriam <pipermerriam@gmail.com>"],"description":"Reusable contracts which implement a privileged 'owner' model for authorization.","keywords":["authorization"],"license":"MIT","links":{"documentation":"ipfs://QmUYcVzTfSwJoigggMxeo2g5STWAgJdisQsqcXHws7b1FW"}},"package_name":"owned","sources":{"./contracts/Owned.sol":"ipfs://Qme4otpS88NV8yQi8TfTP89EsQC5bko3F5N1yhRoi6cwGV"},"version":"1.0.0"} |
@@ -1,24 +0,1 @@ | ||
{ | ||
"lockfile_version": "1", | ||
"version": "1.0.0", | ||
"package_name": "piper-coin", | ||
"deployments": { | ||
"blockchain://41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d/block/cff59cd4bc7077ae557eb39f84f869a1ea7955d52071bad439f0458383a78780": { | ||
"PiperCoin": { | ||
"contract_type": "standard-token:StandardToken", | ||
"address": "0x11cbb0604e47e0f8501b8f56c1c05f92088dc1b0", | ||
"transaction": "0x1f8206683e4b1dea1fd2e7299b7606ff27440f33cb994b42b4ecc4b0f83a210f", | ||
"block": "0xe94a700ef9aa2d7a1b07321838251ea4ade8d4d682121f67899f401433a0d910", | ||
"bytecode": "0x606060405234610000576040516020806106f4833981016040528080519060200190919050505b8060028190555080600060003373ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35b505b610638806100bc6000396000f360606040523615610070576000357c010000000000000000000000000000000000000000000000000000000090048063095ea7b31461007557806318160ddd146100b157806323b872dd146100d457806370a0823114610119578063a9059cbb1461014a578063dd62ed3e14610186575b610000565b346100005761009960048080359060200190919080359060200190919050506101c0565b60405180821515815260200191505060405180910390f35b34610000576100be610287565b6040518082815260200191505060405180910390f35b3461000057610101600480803590602001909190803590602001909190803590602001909190505061028d565b60405180821515815260200191505060405180910390f35b34610000576101346004808035906020019091905050610478565b6040518082815260200191505060405180910390f35b346100005761016e60048080359060200190919080359060200190919050506104ac565b60405180821515815260200191505060405180910390f35b34610000576101aa60048080359060200190919080359060200190919050506105dc565b6040518082815260200191505060405180910390f35b600081600160003373ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3600190505b92915050565b60025481565b600081600060008673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015610318575081600160008673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b80156103245750600082115b156104675781600060008573ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600060008673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600160008673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905061047156610470565b60009050610471565b5b9392505050565b6000600060008373ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b919050565b600081600060003373ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156104e75750600082115b156105cc5781600060003373ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600060008573ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190506105d6566105d5565b600090506105d6565b5b92915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b9291505056", | ||
"runtime_bytecode": "0x60606040523615610070576000357c010000000000000000000000000000000000000000000000000000000090048063095ea7b31461007557806318160ddd146100b157806323b872dd146100d457806370a0823114610119578063a9059cbb1461014a578063dd62ed3e14610186575b610000565b346100005761009960048080359060200190919080359060200190919050506101c0565b60405180821515815260200191505060405180910390f35b34610000576100be610287565b6040518082815260200191505060405180910390f35b3461000057610101600480803590602001909190803590602001909190803590602001909190505061028d565b60405180821515815260200191505060405180910390f35b34610000576101346004808035906020019091905050610478565b6040518082815260200191505060405180910390f35b346100005761016e60048080359060200190919080359060200190919050506104ac565b60405180821515815260200191505060405180910390f35b34610000576101aa60048080359060200190919080359060200190919050506105dc565b6040518082815260200191505060405180910390f35b600081600160003373ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3600190505b92915050565b60025481565b600081600060008673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015610318575081600160008673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b80156103245750600082115b156104675781600060008573ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600060008673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600160008673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905061047156610470565b60009050610471565b5b9392505050565b6000600060008373ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b919050565b600081600060003373ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156104e75750600082115b156105cc5781600060003373ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600060008573ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190506105d6566105d5565b600090506105d6565b5b92915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b9291505056", | ||
"compiler": { | ||
"type": "solc", | ||
"version": "0.4.6+commit.2dabbdf0.Darwin.appleclang" | ||
} | ||
} | ||
} | ||
}, | ||
"build_dependencies": { | ||
"standard-token": "ipfs://QmegJYswSDXUJbKWBuTj7AGBY15XceKxnF1o1Vo2VvVPLQ" | ||
} | ||
} | ||
{"build_dependencies":{"standard-token":"ipfs://QmVu9zuza5mkJwwcFdh2SXBugm1oSgZVuEKkph9XLsbUwg"},"deployments":{"blockchain://41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d/block/4803939cf88aaf46fb7c9fb771cda4e4072c6c5fe3aaad1860f7064ef18f50b9":{"PiperCoin":{"address":"0xC70871869Ff35e9d08e650b49F23891DB462F181","block":"0xb21dda724b6f14bcdde1db9703a5c1bfb088763acdb725be2429c1ef8ce0a4e1","compiler":{"name":"solc","settings":{"optimize":true},"version":"0.4.24+commit.e67f0147.Emscripten.clang"},"contract_type":"standard-token:StandardToken","deployment_bytecode":{"bytecode":"0x608060405234801561001057600080fd5b5060405160208061045383398101604081815291516002819055336000818152602081815285822084905583855294519294919390927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a3506103d2806100816000396000f3006080604052600436106100775763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b3811461007c57806318160ddd146100b457806323b872dd146100db57806370a0823114610105578063a9059cbb14610126578063dd62ed3e1461014a575b600080fd5b34801561008857600080fd5b506100a0600160a060020a0360043516602435610171565b604080519115158252519081900360200190f35b3480156100c057600080fd5b506100c96101d8565b60408051918252519081900360200190f35b3480156100e757600080fd5b506100a0600160a060020a03600435811690602435166044356101de565b34801561011157600080fd5b506100c9600160a060020a03600435166102c9565b34801561013257600080fd5b506100a0600160a060020a03600435166024356102e4565b34801561015657600080fd5b506100c9600160a060020a036004358116906024351661037b565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b60025481565b600160a060020a03831660009081526020819052604081205482118015906102295750600160a060020a03841660009081526001602090815260408083203384529091529020548211155b80156102355750600082115b156102be57600160a060020a0380841660008181526020818152604080832080548801905593881680835284832080548890039055600182528483203384528252918490208054879003905583518681529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35060016102c2565b5060005b9392505050565b600160a060020a031660009081526020819052604090205490565b3360009081526020819052604081205482118015906103035750600082115b15610373573360008181526020818152604080832080548790039055600160a060020a03871680845292819020805487019055805186815290519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060016101d2565b5060006101d2565b600160a060020a039182166000908152600160209081526040808320939094168252919091522054905600a165627a7a72305820cf9d6a3f751ca1e6b9bc2324e42633a4cde513d64c3e6cc32d6359629249e90200290000000000000000000000000000000000000000000000000000000000000001"},"runtime_bytecode":{"bytecode":"0x6080604052600436106100775763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b3811461007c57806318160ddd146100b457806323b872dd146100db57806370a0823114610105578063a9059cbb14610126578063dd62ed3e1461014a575b600080fd5b34801561008857600080fd5b506100a0600160a060020a0360043516602435610171565b604080519115158252519081900360200190f35b3480156100c057600080fd5b506100c96101d8565b60408051918252519081900360200190f35b3480156100e757600080fd5b506100a0600160a060020a03600435811690602435166044356101de565b34801561011157600080fd5b506100c9600160a060020a03600435166102c9565b34801561013257600080fd5b506100a0600160a060020a03600435166024356102e4565b34801561015657600080fd5b506100c9600160a060020a036004358116906024351661037b565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b60025481565b600160a060020a03831660009081526020819052604081205482118015906102295750600160a060020a03841660009081526001602090815260408083203384529091529020548211155b80156102355750600082115b156102be57600160a060020a0380841660008181526020818152604080832080548801905593881680835284832080548890039055600182528483203384528252918490208054879003905583518681529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35060016102c2565b5060005b9392505050565b600160a060020a031660009081526020819052604090205490565b3360009081526020819052604081205482118015906103035750600082115b15610373573360008181526020818152604080832080548790039055600160a060020a03871680845292819020805487019055805186815290519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060016101d2565b5060006101d2565b600160a060020a039182166000908152600160209081526040808320939094168252919091522054905600a165627a7a72305820cf9d6a3f751ca1e6b9bc2324e42633a4cde513d64c3e6cc32d6359629249e9020029"},"transaction":"0x93f6c5fbdb4c62f1bff8bace3ec2f80267b6cdd3710c36f9b1445031175d9f6f"}}},"manifest_version":"2","package_name":"piper-coin","version":"1.0.0"} |
@@ -1,79 +0,1 @@ | ||
{ | ||
"lockfile_version": "1", | ||
"version": "1.0.0", | ||
"package_name": "safe-math-lib", | ||
"sources": { | ||
"./contracts/SafeMathLib.sol": "ipfs://QmVN1p6MmMLYcSq1VTmaSDLC3xWuAUwEFBFtinfzpmtzQG" | ||
}, | ||
"contract_types": { | ||
"SafeMathLib": { | ||
"bytecode": "0x606060405234610000575b60a9806100176000396000f36504062dabbdf050606060405260e060020a6000350463a293d1e88114602e578063e6cb901314604c575b6000565b603a600435602435606a565b60408051918252519081900360200190f35b603a6004356024356088565b60408051918252519081900360200190f35b6000828211602a57508082036081566081565b6000565b5b92915050565b6000828284011115602a57508181016081566081565b6000565b5b9291505056", | ||
"runtime_bytecode": "0x6504062dabbdf050606060405260e060020a6000350463a293d1e88114602e578063e6cb901314604c575b6000565b603a600435602435606a565b60408051918252519081900360200190f35b603a6004356024356088565b60408051918252519081900360200190f35b6000828211602a57508082036081566081565b6000565b5b92915050565b6000828284011115602a57508181016081566081565b6000565b5b9291505056", | ||
"abi": [ | ||
{ | ||
"constant": false, | ||
"inputs": [ | ||
{"name": "a","type": "uint256"}, | ||
{"name": "b","type": "uint256"} | ||
], | ||
"name": "safeSub", | ||
"outputs": [ | ||
{"name": "","type": "uint256"} | ||
], | ||
"payable": false, | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": false, | ||
"inputs": [ | ||
{"name": "a","type": "uint256"}, | ||
{"name": "b","type": "uint256"} | ||
], | ||
"name": "safeAdd", | ||
"outputs": [ | ||
{"name": "","type": "uint256"} | ||
], | ||
"payable": false, | ||
"type": "function" | ||
} | ||
], | ||
"compiler": { | ||
"type": "solc", | ||
"version": "0.4.6+commit.2dabbdf0.Darwin.appleclang", | ||
"settings": { | ||
"optimize": true | ||
} | ||
}, | ||
"natspec": { | ||
"title": "Safe Math Library", | ||
"author": "Piper Merriam <pipermerriam@gmail.com>", | ||
"methods": { | ||
"safeAdd(uint256,uint256)": { | ||
"details": "Subtracts b from a, throwing an error if the operation would cause an underflow.", | ||
"params": { | ||
"a": "The number to be subtracted from", | ||
"b": "The amount that should be subtracted" | ||
} | ||
}, | ||
"safeSub(uint256,uint256)": { | ||
"details": "Adds a and b, throwing an error if the operation would cause an overflow.", | ||
"params": { | ||
"a": "The first number to add", | ||
"b": "The second number to add" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"deployments": { | ||
"blockchain://41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d/block/1e96de11320c83cca02e8b9caf3e489497e8e432befe5379f2f08599f8aecede": { | ||
"SafeMathLib": { | ||
"contract_type": "SafeMathLib", | ||
"address": "0x8d2c532d7d211816a2807a411f947b211569b68c", | ||
"transaction": "0xaceef751507a79c2dee6aa0e9d8f759aa24aab081f6dcf6835d792770541cb2b", | ||
"block": "0x420cb2b2bd634ef42f9082e1ee87a8d4aeeaf506ea5cdeddaa8ff7cbf911810c" | ||
} | ||
} | ||
} | ||
} | ||
{"contract_types":{"SafeMathLib":{"abi":[{"constant":true,"inputs":[{"name":"a","type":"uint256"},{"name":"b","type":"uint256"}],"name":"safeSub","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"name":"a","type":"uint256"},{"name":"b","type":"uint256"}],"name":"safeAdd","outputs":[{"name":"c","type":"uint256"}],"payable":false,"stateMutability":"pure","type":"function"}],"compiler":{"name":"solc","settings":{"optimize":false},"version":"0.4.24+commit.e67f0147.Emscripten.clang"},"deployment_bytecode":{"bytecode":"0x610145610030600b82828239805160001a6073146000811461002057610022565bfe5b5030600052607381538281f3007300000000000000000000000000000000000000003014608060405260043610610063576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063a293d1e814610068578063e6cb9013146100a6575b600080fd5b61009060048036038101908080359060200190929190803590602001909291905050506100e4565b6040518082815260200191505060405180910390f35b6100ce60048036038101908080359060200190929190803590602001909291905050506100fd565b6040518082815260200191505060405180910390f35b60008282111515156100f257fe5b818303905092915050565b6000818301905082811015151561011057fe5b809050929150505600a165627a7a72305820ac19b530c9fab4716b26d7706467f9a30d5542de1ac898dc56c67ff65ebe9bd50029"},"natspec":{"author":"Piper Merriam <pipermerriam@gmail.com>","methods":{"safeAdd(uint256,uint256)":{"details":"Adds a and b, throwing an error if the operation would cause an overflow.","params":{"a":"The first number to add","b":"The second number to add"}},"safeSub(uint256,uint256)":{"details":"Subtracts b from a, throwing an error if the operation would cause an underflow.","params":{"a":"The number to be subtracted from","b":"The amount that should be subtracted"}}},"title":"Safe Math Library"},"runtime_bytecode":{"bytecode":"0x73a66a05d6ab5c1c955f4d2c3fcc166ae6300b452b3014608060405260043610610063576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063a293d1e814610068578063e6cb9013146100a6575b600080fd5b61009060048036038101908080359060200190929190803590602001909291905050506100e4565b6040518082815260200191505060405180910390f35b6100ce60048036038101908080359060200190929190803590602001909291905050506100fd565b6040518082815260200191505060405180910390f35b60008282111515156100f257fe5b818303905092915050565b6000818301905082811015151561011057fe5b809050929150505600a165627a7a72305820ac19b530c9fab4716b26d7706467f9a30d5542de1ac898dc56c67ff65ebe9bd50029"}}},"deployments":{"blockchain://41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d/block/cf1fe2fc56f116e30ee6f6de77c1bfe9304231414fa8c7e0c98075e93f618368":{"SafeMathLib":{"address":"0xa66A05D6AB5c1c955F4D2c3FCC166AE6300b452B","block":"0xe11241bf8d2862026db775ee3e9c85cc2ae99ea8938b795d77d9f2f277271b2a","contract_type":"SafeMathLib","transaction":"0x7ee011d3e2e5aef3be0ab5853666aa8e0427bcb19b3da6411c90768090bc5517"}}},"manifest_version":"2","package_name":"safe-math-lib","sources":{"./contracts/SafeMathLib.sol":"ipfs://QmNQeuwMDGJ7UiLaRjwzAoekcaKLp9TjiqeFdovj3syN1n"},"version":"1.0.0"} |
@@ -1,55 +0,1 @@ | ||
{ | ||
"lockfile_version": "1", | ||
"version": "1.0.0", | ||
"package_name": "standard-token", | ||
"sources": { | ||
"./contracts/AbstractToken.sol": "ipfs://QmQMXDprXxCunfQjA42LXZtzL6YMP8XTuGDB6AjHzpYHgk", | ||
"./contracts/StandardToken.sol": "ipfs://QmNLr7DzmiaQvk25C8bADBnh9bF5V3JfbwHS49kyoGGEHz" | ||
}, | ||
"contract_types": { | ||
"StandardToken": { | ||
"abi": [{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"payable":false,"type":"function"},{"inputs":[{"name":"_totalSupply","type":"uint256"}],"payable":false,"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"}], | ||
"natspec": { | ||
"author": "Stefan George - <stefan.george@consensys.net>", | ||
"title": "Standard token contract", | ||
"methods": { | ||
"allowance(address,address)": { | ||
"details": "Returns number of allowed tokens for given address.", | ||
"params": { | ||
"_owner": "Address of token owner.", | ||
"_spender": "Address of token spender." | ||
} | ||
}, | ||
"approve(address,uint256)": { | ||
"details": "Sets approved amount of tokens for spender. Returns success.", | ||
"params": { | ||
"_spender": "Address of allowed account.", | ||
"_value": "Number of approved tokens." | ||
} | ||
}, | ||
"balanceOf(address)": { | ||
"details": "Returns number of tokens owned by given address.", | ||
"params": { | ||
"_owner": "Address of token owner." | ||
} | ||
}, | ||
"transfer(address,uint256)": { | ||
"details": "Transfers sender's tokens to a given address. Returns success.", | ||
"params": { | ||
"_to": "Address of token receiver.", | ||
"_value": "Number of tokens to transfer." | ||
} | ||
}, | ||
"transferFrom(address,address,uint256)": { | ||
"details": "Allows allowed third party to transfer tokens from one address to another. Returns success.", | ||
"params": { | ||
"_from": "Address from where tokens are withdrawn.", | ||
"_to": "Address to where tokens are sent.", | ||
"_value": "Number of tokens to transfer." | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
{"contract_types":{"StandardToken":{"abi":[{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_totalSupply","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"}],"natspec":{"author":"Stefan George - <stefan.george@consensys.net>","methods":{"allowance(address,address)":{"details":"Returns number of allowed tokens for given address.","params":{"_owner":"Address of token owner.","_spender":"Address of token spender."}},"approve(address,uint256)":{"details":"Sets approved amount of tokens for spender. Returns success.","params":{"_spender":"Address of allowed account.","_value":"Number of approved tokens."}},"balanceOf(address)":{"details":"Returns number of tokens owned by given address.","params":{"_owner":"Address of token owner."}},"transfer(address,uint256)":{"details":"Transfers sender's tokens to a given address. Returns success.","params":{"_to":"Address of token receiver.","_value":"Number of tokens to transfer."}},"transferFrom(address,address,uint256)":{"details":"Allows allowed third party to transfer tokens from one address to another. Returns success.","params":{"_from":"Address from where tokens are withdrawn.","_to":"Address to where tokens are sent.","_value":"Number of tokens to transfer."}}},"title":"Standard token contract"}}},"manifest_version":"2","package_name":"standard-token","sources":{"./contracts/AbstractToken.sol":"ipfs://Qma8tiYLSYGSjbLVn4RbTHBt2LBUXe2ADb37NVsG5UgXea","./contracts/StandardToken.sol":"ipfs://QmRJHLmPVct2rbBpdGjP3xkXbF7romQigtmcs8TRfV1yC7"},"version":"1.0.0"} |
@@ -1,21 +0,1 @@ | ||
{ | ||
"lockfile_version": "1", | ||
"version": "1.0.0", | ||
"package_name": "transferable", | ||
"meta": { | ||
"license": "MIT", | ||
"authors": [ | ||
"Piper Merriam <pipermerriam@gmail.com>" | ||
], | ||
"description": "Reusable contracts which implement a privileged'owner' model for authorization with functionality for transfering ownership.", | ||
"keywords": [ | ||
"authorization" | ||
] | ||
}, | ||
"sources": { | ||
"./contracts/transferable.sol": "ipfs://QmZ6Zg1iEejuJ18LFczowe7dyaxXm4KC4xTgnCkqwJZmAp" | ||
}, | ||
"build_dependencies": { | ||
"owned": "ipfs://QmUwVUMVtkVctrLDeL12SoeCPUacELBU8nAxRtHUzvtjND" | ||
} | ||
} | ||
{"build_dependencies":{"owned":"ipfs://QmbeVyFLSuEUxiXKwSsEjef6icpdTdA4kGG9BcrJXKNKUW"},"manifest_version":"2","meta":{"authors":["Piper Merriam <pipermerriam@gmail.com>"],"description":"Reusable contracts which implement a privileged 'owner' model for authorization with functionality for transfering ownership.","keywords":["authorization"],"license":"MIT"},"package_name":"transferable","sources":{"./contracts/Transferable.sol":"ipfs://QmZYkdUUTwREjfy4vQc3enzu6WKk8eNyvGERqy1cNNVkAD"},"version":"1.0.0"} |
@@ -1,100 +0,1 @@ | ||
{ | ||
"lockfile_version": "1", | ||
"version": "1.0.0", | ||
"package_name": "wallet", | ||
"sources": { | ||
"./contracts/Wallet.sol": "ipfs://QmYKibsXPSTR5UjywQHX8SM4za1K3QHadtFGWmZqGA4uE9" | ||
}, | ||
"contract_types": { | ||
"Wallet": { | ||
"bytecode": "0x60606040525b60008054600160a060020a0319166c01000000000000000000000000338102041790555b5b610224806100386000396000f3606060405236156100355760e060020a6000350463095ea7b381146100435780632e1a7d4d1461006a578063d0679d341461008e575b34610000576100415b5b565b005b34610000576100566004356024356100b5565b604080519115158252519081900360200190f35b34610000576100566004356100f8565b604080519115158252519081900360200190f35b34610000576100566004356024356101da565b604080519115158252519081900360200190f35b6000805433600160a060020a039081169116146100d157610000565b50600160a060020a03821660009081526001602081905260409091208290555b5b92915050565b600160a060020a0333166000908152600160209081526040808320548151830184905281517fa293d1e8000000000000000000000000000000000000000000000000000000008152600481019190915260248101859052905173__SafeMathLib___________________________9263a293d1e89260448082019391829003018186803b156100005760325a03f415610000575050604080518051600160a060020a0333166000818152600160205293842091909155925084156108fc0291859190818181858888f1935050505015156101d157610000565b5060015b919050565b6000805433600160a060020a039081169116146101f657610000565b604051600160a060020a0384169083156108fc029084906000818181858888f19450505050505b5b9291505056", | ||
"runtime_bytecode": "0x606060405236156100355760e060020a6000350463095ea7b381146100435780632e1a7d4d1461006a578063d0679d341461008e575b34610000576100415b5b565b005b34610000576100566004356024356100b5565b604080519115158252519081900360200190f35b34610000576100566004356100f8565b604080519115158252519081900360200190f35b34610000576100566004356024356101da565b604080519115158252519081900360200190f35b6000805433600160a060020a039081169116146100d157610000565b50600160a060020a03821660009081526001602081905260409091208290555b5b92915050565b600160a060020a0333166000908152600160209081526040808320548151830184905281517fa293d1e8000000000000000000000000000000000000000000000000000000008152600481019190915260248101859052905173__SafeMathLib___________________________9263a293d1e89260448082019391829003018186803b156100005760325a03f415610000575050604080518051600160a060020a0333166000818152600160205293842091909155925084156108fc0291859190818181858888f1935050505015156101d157610000565b5060015b919050565b6000805433600160a060020a039081169116146101f657610000565b604051600160a060020a0384169083156108fc029084906000818181858888f19450505050505b5b9291505056", | ||
"abi": [ | ||
{ | ||
"constant": false, | ||
"inputs": [ | ||
{"name": "recipient", "type": "address"}, | ||
{"name": "value", "type": "uint256"} | ||
], | ||
"name": "approve", | ||
"outputs": [ | ||
{"name": "", "type": "bool"} | ||
], | ||
"payable": false, | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": false, | ||
"inputs": [ | ||
{"name": "value", "type": "uint256"} | ||
], | ||
"name": "withdraw", | ||
"outputs": [ | ||
{"name": "", "type": "bool"} | ||
], | ||
"payable": false, | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": false, | ||
"inputs": [ | ||
{"name": "recipient", "type": "address"}, | ||
{"name": "value", "type": "uint256"} | ||
], | ||
"name": "send", | ||
"outputs": [ | ||
{"name": "", "type": "bool"} | ||
], | ||
"payable": false, | ||
"type": "function" | ||
}, | ||
{ | ||
"payable": false, | ||
"type": "fallback" | ||
} | ||
], | ||
"natspec": { | ||
"compiler": { | ||
"type": "solc", | ||
"version": "0.4.6+commit.2dabbdf0.Darwin.appleclang", | ||
"settings": { | ||
"optimize": true | ||
} | ||
}, | ||
"author": "Piper Merriam <pipermerriam@gmail.com>", | ||
"methods": { | ||
"approve(address,uint256)": { | ||
"details": "Sets recipient to be approved to withdraw the specified amount", | ||
"notice": "This will set the recipient to be approved to withdraw the specified amount." | ||
}, | ||
"send(address,uint256)": { | ||
"details": "Sends the recipient the specified amount", | ||
"notice": "This will send the reciepient the specified amount." | ||
}, | ||
"withdraw(uint256)": { | ||
"details": "Lets caller withdraw up to their approved amount", | ||
"notice": "This will withdraw provided value, deducting it from your total allowance." | ||
} | ||
}, | ||
"title": "Contract for holding funds in escrow between two semi trusted parties." | ||
} | ||
} | ||
}, | ||
"deployments": { | ||
"blockchain://41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d/block/3ececfa0e03bce2d348279316100913c42ca2dcd51b8bc8d2d87ef2dc6a479ff": { | ||
"Wallet": { | ||
"contract_type": "Wallet", | ||
"address": "0xcd0f8d7dab6c682d3726693ef3c7aaacc6431d1c", | ||
"transaction": "0x5c113857925ae0d866341513bb0732cd799ebc1c18fcec253bbc41d2a029acd4", | ||
"block": "0xccd130623ad3b25a357ead2ecfd22d38756b2e6ac09b77a37bd0ecdf16249765", | ||
"link_dependencies": [ | ||
{"offset": 678, "value": "safe-math-lib:SafeMathLib"} | ||
] | ||
} | ||
} | ||
}, | ||
"build_dependencies": { | ||
"owned": "ipfs://QmUwVUMVtkVctrLDeL12SoeCPUacELBU8nAxRtHUzvtjND", | ||
"safe-math-lib": "ipfs://QmfUwis9K2SLwnUh62PDb929JzU5J2aFKd4kS1YErYajdq" | ||
} | ||
} | ||
{"build_dependencies":{"owned":"ipfs://QmbeVyFLSuEUxiXKwSsEjef6icpdTdA4kGG9BcrJXKNKUW","safe-math-lib":"ipfs://QmWgvM8yXGyHoGWqLFXvareJsoCZVsdrpKNCLMun3RaSJm"},"contract_types":{"Wallet":{"abi":[{"constant":false,"inputs":[{"name":"recipient","type":"address"},{"name":"value","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"value","type":"uint256"}],"name":"withdraw","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"recipient","type":"address"},{"name":"value","type":"uint256"}],"name":"send","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"payable":false,"stateMutability":"nonpayable","type":"fallback"}],"deployment_bytecode":{"bytecode":"0x608060405260008054600160a060020a031916331790556102bf806100256000396000f3006080604052600436106100565763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b381146100655780632e1a7d4d146100aa578063d0679d34146100c2575b34801561006257600080fd5b50005b34801561007157600080fd5b5061009673ffffffffffffffffffffffffffffffffffffffff600435166024356100f3565b604080519115158252519081900360200190f35b3480156100b657600080fd5b5061009660043561014a565b3480156100ce57600080fd5b5061009673ffffffffffffffffffffffffffffffffffffffff60043516602435610236565b6000805473ffffffffffffffffffffffffffffffffffffffff16331461011857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8216600090815260016020819052604090912082905592915050565b3360009081526001602090815260408083205481517fa293d1e800000000000000000000000000000000000000000000000000000000815260048101919091526024810185905290517300000000000000000000000000000000000000009263a293d1e89260448082019391829003018186803b1580156101ca57600080fd5b505af41580156101de573d6000803e3d6000fd5b505050506040513d60208110156101f457600080fd5b505133600081815260016020526040808220939093559151909184156108fc02918591818181858888f19350505050151561022e57600080fd5b506001919050565b6000805473ffffffffffffffffffffffffffffffffffffffff16331461025b57600080fd5b60405173ffffffffffffffffffffffffffffffffffffffff84169083156108fc029084906000818181858888f19796505050505050505600a165627a7a723058207816bfaab53d55eff94c08cb3e5655a597fb47b8b10256bc7b52b12105f3095e0029","link_references":[{"length":20,"name":"SafeMathLib","offsets":[442]}]},"natspec":{"author":"Piper Merriam <pipermerriam@gmail.com>","compiler":{"name":"solc","settings":{"optimize":true},"version":"0.4.24+commit.e67f0147.Emscripten.clang"},"methods":{"approve(address,uint256)":{"details":"Sets recipient to be approved to withdraw the specified amount","notice":"This will set the recipient to be approved to withdraw the specified amount."},"send(address,uint256)":{"details":"Sends the recipient the specified amount","notice":"This will send the reciepient the specified amount."},"withdraw(uint256)":{"details":"Lets caller withdraw up to their approved amount","notice":"This will withdraw provided value, deducting it from your total allowance."}},"title":"Contract for holding funds in escrow between two semi trusted parties."},"runtime_bytecode":{"bytecode":"0x6080604052600436106100565763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b381146100655780632e1a7d4d146100aa578063d0679d34146100c2575b34801561006257600080fd5b50005b34801561007157600080fd5b5061009673ffffffffffffffffffffffffffffffffffffffff600435166024356100f3565b604080519115158252519081900360200190f35b3480156100b657600080fd5b5061009660043561014a565b3480156100ce57600080fd5b5061009673ffffffffffffffffffffffffffffffffffffffff60043516602435610236565b6000805473ffffffffffffffffffffffffffffffffffffffff16331461011857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8216600090815260016020819052604090912082905592915050565b3360009081526001602090815260408083205481517fa293d1e800000000000000000000000000000000000000000000000000000000815260048101919091526024810185905290517300000000000000000000000000000000000000009263a293d1e89260448082019391829003018186803b1580156101ca57600080fd5b505af41580156101de573d6000803e3d6000fd5b505050506040513d60208110156101f457600080fd5b505133600081815260016020526040808220939093559151909184156108fc02918591818181858888f19350505050151561022e57600080fd5b506001919050565b6000805473ffffffffffffffffffffffffffffffffffffffff16331461025b57600080fd5b60405173ffffffffffffffffffffffffffffffffffffffff84169083156108fc029084906000818181858888f19796505050505050505600a165627a7a723058207816bfaab53d55eff94c08cb3e5655a597fb47b8b10256bc7b52b12105f3095e0029","link_references":[{"length":20,"name":"SafeMathLib","offsets":[405]}]}}},"deployments":{"blockchain://41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d/block/0d2426efb30377a18129af05d887f9ba76bff85482000bd19e3630eb09a8bf39":{"Wallet":{"address":"0x79eb62e7a360952670C03676F47a9087c15065B3","block":"0x0a2d01614f4dadd0b7eeeb945d5bab534825911a7769a6d2da8adb72e91b2531","contract_type":"Wallet","runtime_bytecode":{"link_dependencies":[{"offsets":[405],"type":"reference","value":"safe-math-lib:SafeMathLib"}]},"transaction":"0xaf122c215282dd340d686a662d60239f43700e15127b44e68dd6a00c48b9c88a"}}},"manifest_version":"2","package_name":"wallet","sources":{"./contracts/Wallet.sol":"ipfs://QmdvZEW3AaUntDfFkcbdnYzeLAAeD4YFeixQsdmHF88T6Q"},"version":"1.0.0"} |
{ | ||
"name": "ethpm-spec", | ||
"version": "1.0.1", | ||
"version": "2.0.0", | ||
"description": "Ethereum Package Manager Specifications", | ||
"main": "index.js", | ||
"scripts": { | ||
"build": "" | ||
"prepare": "json2ts -i ./spec/package.spec.json -o ./index.d.ts" | ||
}, | ||
"files": [ | ||
"spec", | ||
"examples", | ||
"index.d.ts" | ||
], | ||
"typings": "./index.d.ts", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/ethpm/epm-spec.git" | ||
"url": "git+https://github.com/ethpm/ethpm-spec.git" | ||
}, | ||
@@ -23,8 +28,8 @@ "keywords": [ | ||
"bugs": { | ||
"url": "https://github.com/ethpm/epm-spec/issues" | ||
"url": "https://github.com/ethpm/ethpm-spec/issues" | ||
}, | ||
"homepage": "https://github.com/ethpm/epm-spec#readme", | ||
"dependencies": { | ||
"json-schema-to-markdown": "^1.0.3" | ||
"homepage": "https://github.com/ethpm/ethpm-spec#readme", | ||
"devDependencies": { | ||
"json-schema-to-typescript": "^5.5.0" | ||
} | ||
} |
677
README.md
@@ -1,125 +0,38 @@ | ||
# EVM Smart Contract Packaging Specification | ||
# EthPM Package Specification | ||
## Overview | ||
[![Join the chat at https://gitter.im/ethpm/Lobby](https://badges.gitter.im/ethpm/Lobby.svg)](https://gitter.im/ethpm/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
Ethereum Packaging Specification | ||
This repository comprises the formal specification and documentation source | ||
for the **EthPM package manifest** data format. | ||
This data format is designed to be produced/consumed by Ethereum | ||
development tools. As such, this repository is intended for tool developers | ||
wishing to integrate with EthPM. | ||
## Specification | ||
Package manifests are JSON-encoded, tightly-packed, with objects’ keys sorted | ||
in lexicographic order. Package manifests may live on disk, but are intended | ||
to be produced programmatically and uploaded directly to a content-addressable | ||
storage network (e.g. [IPFS](https://ipfs.io/)). A package manifest describes | ||
a single package, including package name, version, dependencies, and references | ||
to distributed source files. | ||
* [Release Lock File](./release-lock-file-spec.md) | ||
## Repository Contents | ||
- [Schema Description](http://ethpm.github.io/ethpm-spec/package-spec.html) | ||
- [`package.spec.json`](https://github.com/ethpm/ethpm-spec/blob/master/spec/package.spec.json) | ||
- [Use Case Examples](http://ethpm.github.io/ethpm-spec/use-cases.html) | ||
- [Examples Sources](https://github.com/ethpm/ethpm-spec/blob/master/examples/) | ||
- [Glossary](http://ethpm.github.io/ethpm-spec/glossary.html) | ||
## Definitions | ||
## Examples / Use Cases | ||
The following *types* are used within this specification. | ||
### Contract Name | ||
A string matching the regular expression `[_a-zA-Z][_a-zA-Z0-9]*` | ||
### Package Name | ||
A string matching the regular expression `[a-zA-Z][-_a-zA-Z0-9]*` | ||
### IPFS URI | ||
An URI which matches the regular expression `^ipfs:/?/?.*$` | ||
This allows for either one of the following ipfs supported formats: | ||
- `ipfs://Qm...` | ||
- `ipfs:/Qm...` | ||
- `ipfs:Qm...` | ||
### Chain Definition via BIP122 URI | ||
An URI in the format `blockchain://<chain_id>/block/<block_hash>` | ||
* `chain_id` is the unprefixed genesis hash for the chain. | ||
* `block_hash` is the hash of a block on the chain. | ||
A chain is considered to match a chain definition if the the genesis block hash | ||
matches the `chain_id` and the block defined by `block_hash` can be found on | ||
that chain. It is possible for multiple chains to match a single URI, in which | ||
case all chains are considered valid matches | ||
## Resources | ||
* https://pad.riseup.net/p/7x3G896a3NLA | ||
* https://medium.com/@sdboyer/so-you-want-to-write-a-package-manager-4ae9c17d9527 | ||
## Use Cases | ||
The following use cases were considered during the creation of this | ||
specification. | ||
1. [`owned`](#stand-alone-package-with-inheritable-contract): A package which contains contracts which are not meant to be used by themselves but rather as base contracts to provide functionality to other contracts through inheritance. | ||
2. [`transferable`](#package-with-inheritable-contract-and-a-dependency): A package which has a single dependency. | ||
3. [`standard-token`](#stand-alone-package-with-reusable-contract): A package which contains a reusable contract. | ||
4. [`safe-math-lib`](#stand-alone-package-with-a-deployed-contract): A package which contains deployed instance of one of the package contracts. | ||
5. [`piper-coin`](#package-which-uses-a-reusable-contract-from-a-dependency): A package which contains a deployed instance of a reusable contract from a dependency. | ||
6. [`escrow`](#stand-alone-package-that-links-against-local-library): A package which contains a deployed instance of a local contract which is linked against a deployed instance of a local library. | ||
7. [`wallet`](#package-with-deployed-instance-which-links-against-a-dependency-library): A package with a deployed instance of a local contract which is linked against a deployed instance of a library from a dependency. | ||
Each use case builds incrementally on the previous one. | ||
### <a id="stand-alone-package-with-inheritable-contract" /> Stand Alone Package with an Inheritable Contract | ||
For the first example we'll look at a package which only contains contracts | ||
which serve as base contracts for other contracts to inherit from but do not | ||
provide any real useful functionality on their own. The common *owned* pattern | ||
is a example for this use case. | ||
```javascript | ||
pragma solidity ^0.4.0; | ||
contract owned { | ||
address owner; | ||
function owned() { | ||
owner = msg.sender; | ||
} | ||
modifier onlyowner { if (msg.sender != owner) throw; _; } | ||
} | ||
``` | ||
> For this example we will assume this file is located in the solidity source file `./contracts/owned.sol` | ||
The `owned` package contains a single solidity source source file which is | ||
intended to be used as a base contract for other contracts to be inherited | ||
from. The package does not define any pre-deployed addresses for the *owned* | ||
contract. | ||
The smallest Release Lockfile for this package looks like this: | ||
```javascript | ||
**Package:** `owned` (prettified) | ||
```json | ||
{ | ||
"lockfile_version": "1", | ||
"manifest_version": "2", | ||
"version": "1.0.0", | ||
"package_name": "owned", | ||
"sources": { | ||
"./contracts/owned.sol": "ipfs://QmUjYUcX9kLv2FQH8nwc3RLLXtU3Yv5XFpvEjFcAKXB6xD" | ||
} | ||
} | ||
``` | ||
A Release Lockfile which includes more than the minimum information would look like this. | ||
```javascript | ||
{ | ||
"lockfile_version": "1", | ||
"version": "1.0.0", | ||
"package_name": "owned", | ||
"package_meta": { | ||
"meta": { | ||
"license": "MIT", | ||
@@ -129,3 +42,3 @@ "authors": [ | ||
], | ||
"description": "Reusable contracts which implement a priviledged 'owner' model for authorization", | ||
"description": "Reusable contracts which implement a privileged 'owner' model for authorization.", | ||
"keywords": [ | ||
@@ -135,7 +48,7 @@ "authorization" | ||
"links": { | ||
"documentation": "ipfs://QmQiqrwqdav5bV8mtv4PqGksGcDWo43f7PAZYwhJqNEv2j" | ||
"documentation": "ipfs://QmUYcVzTfSwJoigggMxeo2g5STWAgJdisQsqcXHws7b1FW" | ||
} | ||
}, | ||
"sources": { | ||
"./contracts/owned.sol": "ipfs://QmUjYUcX9kLv2FQH8nwc3RLLXtU3Yv5XFpvEjFcAKXB6xD" | ||
"./contracts/Owned.sol": "ipfs://Qme4otpS88NV8yQi8TfTP89EsQC5bko3F5N1yhRoi6cwGV" | ||
} | ||
@@ -145,522 +58,32 @@ } | ||
This fully fleshed out Release Lockfile is meant to demonstrate various pieces | ||
of optional data that can be included. However, for the remainder of our | ||
examples we will be using minimalistic lockfiles to keep our examples as | ||
succinct as possible. | ||
Please see [**Use Cases**](http://ethpm.github.io/ethpm-spec/use-cases.html) for | ||
documented examples of different kinds of packages with varying levels of | ||
complexity. Source for use case examples can be found in the | ||
[examples/](https://github.com/ethpm/ethpm-spec/blob/master/examples/) | ||
directory of this repository. | ||
## Specification | ||
### <a id="package-with-inheritable-contract-and-a-dependency" /> Package with an Inheritable Contract and a Dependency | ||
The EthPM package manifest format is formally specified as a | ||
[JSON-Schema](http://json-schema.org). | ||
Now that we've seen what a simple package looks like, lets see how to | ||
dependencies are declared. | ||
Please see [**Package Specification**](http://ethpm.github.io/ethpm-spec/package-spec.html) | ||
for a natural-language description of this schema, or see | ||
[package.spec.json](https://github.com/ethpm/ethpm-spec/blob/master/spec/package.spec.json) | ||
for the machine-readable version. | ||
The next package will implement the *transferable* pattern and will depend on | ||
our `owned` package for the authorization mechanism to ensure that only the | ||
contract owner may transfer ownership. The `transferable` package will | ||
contain a single solidity source file `./contracts/transferable.sol`. | ||
## Contributing | ||
```javascript | ||
pragma solidity ^0.4.0; | ||
### Building Sphinx docs locally | ||
import {owned} from "owned/contracts/owned.sol"; | ||
Requirements: Python 3, `pip`, `make` | ||
contract transferable is owned { | ||
event OwnerChanged(address indexed prevOwner, address indexed newOwner); | ||
Fork and clone this repo to get started. Then, in the cloned repo's directory: | ||
function transferOwner(address newOwner) public onlyowner returns (bool) { | ||
OwnerChanged(owner, newOwner); | ||
owner = newOwner; | ||
return true; | ||
} | ||
} | ||
``` | ||
1. `pip install -r requirements.txt` | ||
2. `cd docs` | ||
3. `make html` | ||
The EPM spec is designed to provide as high a guarantee as possible that builds | ||
are deterministic and reproducable. To ensure that each package you install | ||
gets the *exact* dependencies it needs, all dependencies are declared as | ||
content addressed URIs. This ensures that when a package manager fetches a | ||
dependency it always gets the right one. | ||
The IPFS URI for the previous `owned` Release Lockfile turns out to be | ||
`ipfs://QmXDf2GP67otcF2gjWUxFt4AzFkfwGiuzfexhGuotGTLJH` which is what we will | ||
use in our `transferable` package to declare the dependency. The Release | ||
Lockfile for our package looks like the following. | ||
```javascript | ||
{ | ||
"lockfile_version": "1", | ||
"version": "1.0.0", | ||
"package_name": "transferable", | ||
"sources": { | ||
"./contracts/transferable.sol": "ipfs://QmZ6Zg1iEejuJ18LFczowe7dyaxXm4KC4xTgnCkqwJZmAp" | ||
}, | ||
"build_dependencies": { | ||
"owned": "ipfs://QmXDf2GP67otcF2gjWUxFt4AzFkfwGiuzfexhGuotGTLJH" | ||
} | ||
} | ||
``` | ||
It will be up to the package management software to determine how the `owned` | ||
dependency actually gets installed as well as handling any import remappings | ||
necessary to make the import statement work. | ||
### <a id="stand-alone-package-with-reusable-contract" /> Stand Alone Package with a Reusable Contract | ||
In this next example we'll look at a package which contains a reusable | ||
contract. This means that the package provides a contract which can be on its | ||
own in some manner. For this example we will be creating a package which | ||
includes a reusable standard | ||
[ERC20](https://github.com/ethereum/EIPs/issues/20) token contract. | ||
> The source code for these contracts was pulled from the [SingularDTV](https://github.com/ConsenSys/singulardtv-contracts) github repository. Thanks to them for a very well written contract. | ||
This package will contain two solidity source files. | ||
* [`./contracts/AbstractToken.sol`](./examples/standard-token/contracts/AbstractToken.sol) | ||
* [`./contracts/StandardToken.sol`](./examples/standard-token/contracts/StandardToken.sol) | ||
Given that these source files are relatively large they will not be included | ||
here within the guide but can be found in the | ||
[`./examples/standard-token/`](./examples/standard-token/) directory within | ||
this repository. | ||
Since this package includes a contract which may be used as-is, our Release | ||
Lockfile is going to contain additional information from our previous examples, | ||
specifically, the `contract_types` section. Since we expect people to compile | ||
this contract theirselves we won't need to include any of the contract | ||
bytecode, but it will be useful to include the contract ABI and Natspec | ||
information. Our lockfile will look something like the following. The | ||
contract ABI and NatSpec sections have been truncated to improve legibility. | ||
The full Release Lockfile can be found | ||
[here](./examples/standard-token/1.0.0.json) | ||
```javascript | ||
{ | ||
"lockfile_version": "1", | ||
"version": "1.0.0", | ||
"package_name": "standard-token", | ||
"sources": { | ||
"./contracts/AbstractToken.sol": "ipfs://QmQMXDprXxCunfQjA42LXZtzL6YMP8XTuGDB6AjHzpYHgk", | ||
"./contracts/StandardToken.sol": "ipfs://QmNLr7DzmiaQvk25C8bADBnh9bF5V3JfbwHS49kyoGGEHz" | ||
}, | ||
"contract_types": { | ||
"StandardToken": { | ||
"abi": [...], | ||
"natspec": { | ||
"author": "Stefan George - <stefan.george@consensys.net>", | ||
"title": "Standard token contract", | ||
"methods": { | ||
"allowance(address,address)": { | ||
"details": "Returns number of allowed tokens for given address.", | ||
"params": { | ||
"_owner": "Address of token owner.", | ||
"_spender": "Address of token spender." | ||
} | ||
}, | ||
... | ||
} | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
While it is not required to include the contract ABI and NatSpec information, | ||
it does provide those using this package with they data they would need to | ||
interact with an instance of this contract without having to regenerate this | ||
information from source. | ||
### <a id="stand-alone-package-with-a-deployed-contract" /> Stand Alone Package with a Deployed Contract | ||
Now that we've seen what a package looks like which includes a fully functional | ||
contract that is ready to be deployed, lets explore a package that also | ||
includes a deployed instance of that contract. | ||
Solidity Libraries are an | ||
excellend example of this type of package, so for this example we are going to | ||
write a library for *safe* math operations called `safe-math-lib`. This | ||
library will implement functions to allow addition and subtraction without | ||
needing to check for underflow or overflow conditions. Our package will have a | ||
single solidity source file `./contracts/SafeMathLib.sol` | ||
```javascript | ||
pragma solidity ^0.4.0; | ||
/// @title Safe Math Library | ||
/// @author Piper Merriam <pipermerriam@gmail.com> | ||
library SafeMathLib { | ||
/// @dev Subtracts b from a, throwing an error if the operation would cause an underflow. | ||
/// @param a The number to be subtracted from | ||
/// @param b The amount that should be subtracted | ||
function safeAdd(uint a, uint b) returns (uint) { | ||
if (a + b > a) { | ||
return a + b; | ||
} else { | ||
throw; | ||
} | ||
} | ||
/// @dev Adds a and b, throwing an error if the operation would cause an overflow. | ||
/// @param a The first number to add | ||
/// @param b The second number to add | ||
function safeSub(uint a, uint b) returns (uint) { | ||
if (b <= a) { | ||
return a - b; | ||
} else { | ||
throw; | ||
} | ||
} | ||
} | ||
``` | ||
This will be our first package which includes the `deployments` section which is the | ||
location in the Release Lockfile where information about deployed contract | ||
instances is found. Lets look at the Release Lockfile for this package. Some | ||
parts have been truncated for readability but the full file can be found | ||
[here](./examples/safe-math-lib/1.0.0.json) | ||
```javascript | ||
{ | ||
"lockfile_version": "1", | ||
"version": "1.0.0", | ||
"package_name": "safe-math-lib", | ||
"sources": { | ||
"./contracts/SafeMathLib.sol": "ipfs://QmVN1p6MmMLYcSq1VTmaSDLC3xWuAUwEFBFtinfzpmtzQG" | ||
}, | ||
"contract_types": { | ||
"SafeMathLib": { | ||
"bytecode": "0x606060405234610000575b60a9806100176000396000f36504062dabbdf050606060405260e060020a6000350463a293d1e88114602e578063e6cb901314604c575b6000565b603a600435602435606a565b60408051918252519081900360200190f35b603a6004356024356088565b60408051918252519081900360200190f35b6000828211602a57508082036081566081565b6000565b5b92915050565b6000828284011115602a57508181016081566081565b6000565b5b9291505056", | ||
"runtime_bytecode": "0x6504062dabbdf050606060405260e060020a6000350463a293d1e88114602e578063e6cb901314604c575b6000565b603a600435602435606a565b60408051918252519081900360200190f35b603a6004356024356088565b60408051918252519081900360200190f35b6000828211602a57508082036081566081565b6000565b5b92915050565b6000828284011115602a57508181016081566081565b6000565b5b9291505056", | ||
"abi": [ | ||
... | ||
], | ||
"compiler": { | ||
"type": "solc", | ||
"version": "0.4.6+commit.2dabbdf0.Darwin.appleclang", | ||
"settings": { | ||
"optimize": true | ||
} | ||
}, | ||
"natspec": { | ||
"title": "Safe Math Library", | ||
"author": "Piper Merriam <pipermerriam@gmail.com>", | ||
... | ||
} | ||
} | ||
}, | ||
"deployments": { | ||
"blockchain://41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d/block/1e96de11320c83cca02e8b9caf3e489497e8e432befe5379f2f08599f8aecede": { | ||
"SafeMathLib": { | ||
"contract_type": "SafeMathLib", | ||
"address": "0x8d2c532d7d211816a2807a411f947b211569b68c", | ||
"transaction": "0xaceef751507a79c2dee6aa0e9d8f759aa24aab081f6dcf6835d792770541cb2b", | ||
"block": "0x420cb2b2bd634ef42f9082e1ee87a8d4aeeaf506ea5cdeddaa8ff7cbf911810c" | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
The first thing to point out is that unlike our `standard-token` contract, | ||
we've included the `bytecode`, `runtime_bytecode` and `compiler` information in | ||
the `SafeMathLib` section of the `contract_type` definition. This is because | ||
we are also including a deployed instance of this contract and need to require | ||
adequate information for package managers to verify that the contract sound at | ||
the deployed address is in fact from the source code included in this package. | ||
The next thing to look at is the `deployments` section. The first thing you | ||
should see is the | ||
[BIP122](https://github.com/bitcoin/bips/blob/master/bip-0122.mediawiki) URI. | ||
``` | ||
blockchain://41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d/block/1e96de11320c83cca02e8b9caf3e489497e8e432befe5379f2f08599f8aecede | ||
``` | ||
This URI defines the chain on which the `SafeMathLib` library was | ||
deployed. The first hash you see, | ||
`41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d` is the | ||
genesisi block hash for the Ropsten test network. The later hash | ||
`1e96de11320c83cca02e8b9caf3e489497e8e432befe5379f2f08599f8aecede` is the block | ||
hash for block numbr 168,238 from the Ropsten chain. | ||
Under that URI there is a single *contract instance*. It specifies that it's | ||
*contract type* is `SafeMathLib`, the address that the *contract instance* can | ||
be found at, the transaction hash for the transaction that deployed the | ||
contract, and the block hash in which the deploying transaction was mined. | ||
### <a id="package-which-uses-a-reusable-contract-from-a-dependency" /> Package which uses a Reusable Contract from a depenency | ||
For our next example we'll be creating a package includes a deployed instance | ||
of a *contract type* from that comes from a package dependency. This differs | ||
from our previous `safe-math-lib` example where our deployment is referencing a | ||
local contract from the local `contract_types`. In this package's Release | ||
Lockfile we will be referencing a `contract_type` from one of the | ||
`build_dependencies` | ||
We are going to use the `standard-token` package we created earlier and include | ||
a deployed version of the `StandardToken` contract. | ||
Our package will be called `piper-coin` and will not contain any source files | ||
since it merely makes use of the contracts from the `standard-token` package. | ||
The Release Lockfile is listed below with some sections truncated for improved | ||
readability. The full Release Lockfile can be found at | ||
[`./examples/piper-coin/1.0.0.json`](./examples/piper-coin/1.0.0.json) | ||
```javascript | ||
{ | ||
"lockfile_version": "1", | ||
"version": "1.0.0", | ||
"package_name": "piper-coin", | ||
"deployments": { | ||
"blockchain://41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d/block/cff59cd4bc7077ae557eb39f84f869a1ea7955d52071bad439f0458383a78780": { | ||
"PiperCoin": { | ||
"contract_type": "standard-token:StandardToken", | ||
"address": "0x11cbb0604e47e0f8501b8f56c1c05f92088dc1b0", | ||
"transaction": "0x1f8206683e4b1dea1fd2e7299b7606ff27440f33cb994b42b4ecc4b0f83a210f", | ||
"block": "0xe94a700ef9aa2d7a1b07321838251ea4ade8d4d682121f67899f401433a0d910", | ||
"bytecode": "...", | ||
"runtime_bytecode": "...", | ||
"compiler": { | ||
"type": "solc", | ||
"version": "0.4.6+commit.2dabbdf0.Darwin.appleclang" | ||
} | ||
} | ||
} | ||
}, | ||
"build_dependencies": { | ||
"standard-token": "ipfs://QmegJYswSDXUJbKWBuTj7AGBY15XceKxnF1o1Vo2VvVPLQ" | ||
} | ||
} | ||
``` | ||
Most of this should be familiar but it's worth pointing out how we reference | ||
*contract types* from dependencies. Under the `PiperCoin` entry within the | ||
deployments you should see that the `contract_type` key is set to | ||
`standard-token:StandardToken`. The first portion represents the name of the | ||
package dependency within the `build_dependencies` that should be used. The | ||
later portion indicates the *contract type* that should be used from that | ||
dependencies *contract types*. | ||
### <a id="stand-alone-package-that-links-against-local-library" /> Stand Alone package with a deployed Library and a contract which Links against that Library | ||
In the previous `safe-math-lib` package we demonstrated what a package with a | ||
deployed instance of one of it's local contracts looks like. In this example | ||
we will build on that concept with a package which includes a library and a | ||
contract which uses that library as well as deployed instances of both. | ||
The package will be called `escrow` and will implementing a simple escrow | ||
contract. The escrow contract will make use of a library to safely send ether. | ||
Both the contract and library will be part of the package found in the | ||
following two solidity source files. | ||
* [`./contracts/SafeSendLib.sol`](./examples/escrow/SafeSendLib.sol) | ||
* [`./contracts/Escrow.sol`](./examples/escrow/Escrow.sol) | ||
The full source for these files can be found here: | ||
[`./examples/escrow/`](./examples/escrow/). | ||
The Release Lockfile is listed below with some sections truncated for improved | ||
readability. The full Release Lockfile can be found at | ||
[`./examples/escrow/1.0.0.json`](./examples/escrow/1.0.0.json) | ||
```javascript | ||
{ | ||
"lockfile_version": "1", | ||
"version": "1.0.0", | ||
"package_name": "escrow", | ||
"sources": { | ||
"./contracts/SafeSendLib.sol": "ipfs://QmcnzhWjaV71qzKntv4burxyix9W2yBA2LrJB4k99tGqkZ", | ||
"./contracts/Escrow.sol": "ipfs://QmSwmFLT5B5aag485ZWvHmfdC1cU5EFdcqs1oqE5KsxGMw" | ||
}, | ||
"contract_types": { | ||
"SafeSendLib": { | ||
... | ||
}, | ||
"Escrow": { | ||
... | ||
} | ||
}, | ||
"deployments": { | ||
"blockchain://41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d/block/e76cf1f29a4689f836d941d7ffbad4e4b32035a441a509dc53150c2165f8e90d": { | ||
"SafeMathLib": { | ||
"contract_type": "SafeSendLib", | ||
"address": "0x80d7f7a33e551455a909e1b914c4fd4e6d0074cc", | ||
"transaction": "0x74561167f360eaa20ea67bd4b4bf99164aabb36b2287061e86137bfa0d35d5fb", | ||
"block": "0x46554e3cf7b768b1cc1990ad4e2d3a137fe9373c0dda765f4db450cd5fa64102" | ||
}, | ||
"Escrow": { | ||
"contract_type": "Escrow", | ||
"address": "0x35b6b723786fd8bd955b70db794a1f1df56e852f", | ||
"transaction": "0x905fbbeb6069d8b3c8067d233f58b0196b43da7a20b839f3da41f69c87da2037", | ||
"block": "0x9b39dcab3d665a51755dedef56e7c858702f5817ce926a0cd8ff3081c5159b7f", | ||
"link_dependencies": [ | ||
{"offset": 524, "value": "SafeSendLib"}, | ||
{"offset": 824, "value": "SafeSendLib"} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
This Release Lockfile is the first one we've seen thus far that include the | ||
`link_dependencies` section within one of the *contract instances*. The | ||
`runtime_bytecode` value for the `Escrow` contract has been excluded from the | ||
example above for readability, but the full value is as follows (wrapped to 80 | ||
characters). | ||
``` | ||
0x606060405260e060020a600035046366d003ac811461003457806367e404ce1461005d57806369 | ||
d8957514610086575b610000565b3461000057610041610095565b60408051600160a060020a0390 | ||
92168252519081900360200190f35b34610000576100416100a4565b60408051600160a060020a03 | ||
9092168252519081900360200190f35b34610000576100936100b3565b005b600154600160a06002 | ||
0a031681565b600054600160a060020a031681565b60005433600160a060020a0390811691161415 | ||
61014857600154604080516000602091820152815160e260020a6324d048c7028152600160a06002 | ||
0a03938416600482015230909316316024840152905173__SafeSendLib_____________________ | ||
______92639341231c926044808301939192829003018186803b156100005760325a03f415610000 | ||
57506101e2915050565b60015433600160a060020a039081169116141561002f5760008054604080 | ||
51602090810193909352805160e260020a6324d048c7028152600160a060020a0392831660048201 | ||
52309092163160248301525173__SafeSendLib___________________________92639341231c92 | ||
60448082019391829003018186803b156100005760325a03f41561000057506101e2915050565b61 | ||
0000565b5b5b56 | ||
``` | ||
You can see that the placeholder `__SafeSendLib___________________________` is | ||
present in two locations within this bytecode. This is referred to as a *link | ||
reference*. The entries in the `link_dependencies` section of a *contract | ||
instance* describe how these *link references* should be filled in. | ||
The `offset` value specifies the number of characters into the unprefixed | ||
bytecode where the replacement should begin. The `value` defines what address | ||
should be used to replace the *link reference*. In this case, the `value` is | ||
referencing the `SafeSendLib` *contract instance* from this release lockfile. | ||
### <a id="package-with-deployed-instance-which-links-against-a-dependency-library" /> Package with a contract with link dependencies on a contract from a package dependency | ||
Now that we've seen how we can handle linking dependencies that rely on | ||
deployed *contract instances* from the local package we'll explore an example | ||
with link dependencies that rely on contracts from the package dependencies. | ||
In this example we'll be writing the `wallet` package which includes a wallet | ||
contract which makes use of the previous `safe-math-lib` package. We will also | ||
make use of the `owned` package from our very first example to handle | ||
authorization. Our package will contain a single solidity source file | ||
[`./contracts/Wallet.sol`](./examples/wallet/contracts/Wallet.sol). The | ||
version below has been trimmed for readability. | ||
```javascript | ||
import {SafeMathLib} from "safe-math-lib/contracts/SafeMathLib.sol"; | ||
import {owned} from "owned/contracts/owned.sol"; | ||
contract Wallet is owned { | ||
using SafeMathLib for uint; | ||
mapping (address => uint) allowances; | ||
function() { | ||
} | ||
function send(address recipient, uint value) public onlyowner { | ||
recipient.send(value); | ||
} | ||
function approve(address recipient, uint value) public onlyowner { | ||
allowances[recipient] = value; | ||
} | ||
function withdraw(uint value) public { | ||
allowances[msg.sender] = allowances[msg.sender].safeSub(value); | ||
if (!msg.sender.send(value)) throw; | ||
} | ||
} | ||
``` | ||
The Release Lockfile for our `wallet` package can been seen below. It has been | ||
trimmed to improve readability. The full Release Lockfile can be found at | ||
[`./examples/wallet/1.0.0.json`](./examples/wallet/1.0.0.json) | ||
```javascript | ||
{ | ||
"lockfile_version": "1", | ||
"version": "1.0.0", | ||
"package_name": "wallet", | ||
"sources": { | ||
"./contracts/Wallet.sol": "ipfs://QmYKibsXPSTR5UjywQHX8SM4za1K3QHadtFGWmZqGA4uE9" | ||
}, | ||
"contract_types": { | ||
"Wallet": { | ||
"bytecode": "...", | ||
"runtime_bytecode": "...", | ||
... | ||
} | ||
}, | ||
"deployments": { | ||
"blockchain://41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d/block/3ececfa0e03bce2d348279316100913c42ca2dcd51b8bc8d2d87ef2dc6a479ff": { | ||
"Wallet": { | ||
"contract_type": "Wallet", | ||
"address": "0xcd0f8d7dab6c682d3726693ef3c7aaacc6431d1c", | ||
"transaction": "0x5c113857925ae0d866341513bb0732cd799ebc1c18fcec253bbc41d2a029acd4", | ||
"block": "0xccd130623ad3b25a357ead2ecfd22d38756b2e6ac09b77a37bd0ecdf16249765", | ||
"link_dependencies": [ | ||
{"offset": 678, "value": "safe-math-lib:SafeMathLib"} | ||
] | ||
} | ||
} | ||
}, | ||
"build_dependencies": { | ||
"owned": "ipfs://QmXDf2GP67otcF2gjWUxFt4AzFkfwGiuzfexhGuotGTLJH", | ||
"safe-math-lib": "ipfs://QmfUwis9K2SLwnUh62PDb929JzU5J2aFKd4kS1YErYajdq" | ||
} | ||
} | ||
``` | ||
Just like our previous example, the `runtime_bytecode` has been omitted for | ||
improved readability, but the full value is as follows (wrapped to 80 | ||
characters). | ||
``` | ||
0x606060405236156100355760e060020a6000350463095ea7b381146100435780632e1a7d4d1461 | ||
006a578063d0679d341461008e575b34610000576100415b5b565b005b3461000057610056600435 | ||
6024356100b5565b604080519115158252519081900360200190f35b346100005761005660043561 | ||
00f8565b604080519115158252519081900360200190f35b34610000576100566004356024356101 | ||
da565b604080519115158252519081900360200190f35b6000805433600160a060020a0390811691 | ||
16146100d157610000565b50600160a060020a038216600090815260016020819052604090912082 | ||
90555b5b92915050565b600160a060020a0333166000908152600160209081526040808320548151 | ||
830184905281517fa293d1e800000000000000000000000000000000000000000000000000000000 | ||
8152600481019190915260248101859052905173__SafeMathLib___________________________ | ||
9263a293d1e89260448082019391829003018186803b156100005760325a03f41561000057505060 | ||
4080518051600160a060020a0333166000818152600160205293842091909155925084156108fc02 | ||
91859190818181858888f1935050505015156101d157610000565b5060015b919050565b60008054 | ||
33600160a060020a039081169116146101f657610000565b604051600160a060020a038416908315 | ||
6108fc029084906000818181858888f19450505050505b5b9291505056 | ||
``` | ||
As you can see, this bytecode contains a *link* reference to the `SafeMathLib` | ||
library from the `safe-math-lib` package dependency. If you look in the | ||
`link_dependencies` section of our `Wallet` contract you'll see it's items are | ||
similar to the ones from our previous example. | ||
```javascript | ||
"link_dependencies": [ | ||
{"offset": 678, "value": "safe-math-lib:SafeMathLib"} | ||
] | ||
``` | ||
However, unlike the previous example which linked against a *local* contract | ||
type, `value` portion is prefixed with the name of the package which contains | ||
the address of the contract instance that this should be linked against. | ||
Docs are written in [reStructuredText](http://docutils.sourceforge.net/rst.html) | ||
and built using the [Sphinx](http://www.sphinx-doc.org/) documentation | ||
generator. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
137115
0
47
1496
0
1
87
3
- Removedjson-schema-to-markdown@^1.0.3
- Removedjson-schema-to-markdown@1.1.1(transitive)