From 315ff0c7547081d70f7912a8cc05d2a5abaf4f50 Mon Sep 17 00:00:00 2001 From: Chris Hatch Date: Sat, 9 Feb 2019 15:29:29 +0700 Subject: [PATCH] deployed new version of contracts to Kovan and Ropsten added deploy using infura mechanism ABI updated --- .eslintrc | 6 +- .gitignore | 1 + .npmignore | 2 + README.md | 8 +- abi/HashedTimelock.json | 5527 ++++++++++++++++-------------- abi/HashedTimelockERC20.json | 6223 +++++++++++++++++++--------------- config.example.js | 15 + deployment.json | 8 +- package-lock.json | 1032 +++++- package.json | 10 +- truffle.js | 63 +- 11 files changed, 7611 insertions(+), 5284 deletions(-) create mode 100644 config.example.js diff --git a/.eslintrc b/.eslintrc index c8d0f8e..75cf807 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,7 +1,7 @@ { "extends": "eslint:recommended", "parserOptions": { - "ecmaVersion": 8, + "ecmaVersion": 9, "ecmaFeatures": { "impliedStrict": true }, @@ -13,7 +13,6 @@ "mocha": true }, "globals": { - // truffle test framework provided: "web3": true, "contract": true, "artifacts": true, @@ -21,6 +20,7 @@ }, "rules": { "no-console": "off", - "no-unused-vars": ["warn"] + "no-unused-vars": ["warn"], + "semi": ["error", "never"] } } diff --git a/.gitignore b/.gitignore index 3e2e84b..054d32b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ build/ +config.js node_modules/ diff --git a/.npmignore b/.npmignore index 0142b99..bba6cd6 100644 --- a/.npmignore +++ b/.npmignore @@ -1,5 +1,7 @@ build/ +config*.js contracts/ migrations/ src/ test/ +truffle.js \ No newline at end of file diff --git a/README.md b/README.md index 814104f..b30f63f 100644 --- a/README.md +++ b/README.md @@ -13,15 +13,15 @@ Use these contracts for creating HTLCs on the Ethereum side of a cross chain ato HashedTimelock: -- Kovan: [0xc3ed16874bc9551b079c135eb27b10ee1348ac12](https://kovan.etherscan.io/address/0xc3ed16874bc9551b079c135eb27b10ee1348ac12) +- Kovan: [0xe196bb1e25483ed771b6691929d47943023c26fe](https://kovan.etherscan.io/address/0xe196bb1e25483ed771b6691929d47943023c26fe) - Ropsten: - [0xbb6883511ff318ba85b5745fb1a6083537bf914c](https://ropsten.etherscan.io/address/0xbb6883511ff318ba85b5745fb1a6083537bf914c) + [0x243785f6b65418191ea20b45fde7069ffe4f8cef](https://ropsten.etherscan.io/address/0x243785f6b65418191ea20b45fde7069ffe4f8cef) - Mainnet: HashedTimelockERC20: -- Kovan: [0xfD4BEbA807E89E2cA209cd53c28471840446ddf2](https://kovan.etherscan.io/address/0xfD4BEbA807E89E2cA209cd53c28471840446ddf2) -- Ropsten: [0x6879e090240358f59fc5d212f87da63d3288749b](https://ropsten.etherscan.io/address/0x6879e090240358f59fc5d212f87da63d3288749b) +- Kovan: [0x763eedd3c04a9a2fca67ac51fc16e394472f29a2](https://kovan.etherscan.io/address/0x763eedd3c04a9a2fca67ac51fc16e394472f29a2) +- Ropsten: [0x16b6fabc530c7bfde69eafd9e271fb610e3fc3f7](https://ropsten.etherscan.io/address/0x16b6fabc530c7bfde69eafd9e271fb610e3fc3f7) - Mainnet: ## Protocol - Native ETH diff --git a/abi/HashedTimelock.json b/abi/HashedTimelock.json index 1c72b6e..56fb977 100644 --- a/abi/HashedTimelock.json +++ b/abi/HashedTimelock.json @@ -179,20 +179,20 @@ "type": "function" } ], - "bytecode": "0x608060405234801561001057600080fd5b506111ef806100206000396000f300608060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063335ef5bd1461006757806363615149146100d15780637249fbb614610128578063e16c7d9814610171575b600080fd5b6100b3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560001916906020019092919080359060200190929190505050610257565b60405180826000191660001916815260200191505060405180910390f35b3480156100dd57600080fd5b5061010e60048036038101908080356000191690602001909291908035600019169060200190929190505050610702565b604051808215151515815260200191505060405180910390f35b34801561013457600080fd5b506101576004803603810190808035600019169060200190929190505050610c1d565b604051808215151515815260200191505060405180910390f35b34801561017d57600080fd5b506101a0600480360381019080803560001916906020019092919050505061106b565b604051808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018781526020018660001916600019168152602001858152602001841515151581526020018315151515815260200182600019166000191681526020019850505050505050505060405180910390f35b600080341115156102d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f6d73672e76616c7565206d757374206265203e2030000000000000000000000081525060200191505060405180910390fd5b81428111151561036e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f74696d656c6f636b2074696d65206d75737420626520696e207468652066757481526020017f757265000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b60023386348787604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018481526020018360001916600019168152602001828152602001955050505050506040516020818303038152906040526040518082805190602001908083835b602083101515610463578051825260208201915060208101905060208303925061043e565b6001836020036101000a038019825116818451168082178552505050505050905001915050602060405180830381855afa1580156104a5573d6000803e3d6000fd5b5050506040513d60208110156104ba57600080fd5b810190808051906020019092919050505091506104d68261114d565b156104e057600080fd5b610100604051908101604052803373ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff16815260200134815260200185600019168152602001848152602001600015158152602001600015158152602001600060010260001916815250600080846000191660001916815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020155606082015181600301906000191690556080820151816004015560a08201518160050160006101000a81548160ff02191690831515021790555060c08201518160050160016101000a81548160ff02191690831515021790555060e082015181600601906000191690559050508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1683600019167f329a8316ed9c3b2299597538371c2944c5026574e803b1ec31d6113e1cd67bde348888604051808481526020018360001916600019168152602001828152602001935050505060405180910390a4509392505050565b6000808361070f8161114d565b1515610783576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f636f6e7472616374496420646f6573206e6f742065786973740000000000000081525060200191505060405180910390fd5b84846002816040516020018082600019166000191681526020019150506040516020818303038152906040526040518082805190602001908083835b6020831015156107e457805182526020820191506020810190506020830392506107bf565b6001836020036101000a038019825116818451168082178552505050505050905001915050602060405180830381855afa158015610826573d6000803e3d6000fd5b5050506040513d602081101561083b57600080fd5b810190808051906020019092919050505060001916600080846000191660001916815260200190815260200160002060030154600019161415156108e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f686173686c6f636b206861736820646f6573206e6f74206d617463680000000081525060200191505060405180910390fd5b863373ffffffffffffffffffffffffffffffffffffffff16600080836000191660001916815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156109c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f776974686472617761626c653a206e6f7420726563656976657200000000000081525060200191505060405180910390fd5b60001515600080836000191660001916815260200190815260200160002060050160009054906101000a900460ff161515141515610a6e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f776974686472617761626c653a20616c72656164792077697468647261776e0081525060200191505060405180910390fd5b42600080836000191660001916815260200190815260200160002060040154111515610b28576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260318152602001807f776974686472617761626c653a2074696d656c6f636b2074696d65206d75737481526020017f20626520696e207468652066757475726500000000000000000000000000000081525060400191505060405180910390fd5b600080896000191660001916815260200190815260200160002094508685600601816000191690555060018560050160006101000a81548160ff0219169083151502179055508460010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc86600201549081150290604051600060405180830381858888f19350505050158015610bdc573d6000803e3d6000fd5b5087600019167fd6fd4c8e45bf0c70693141c7ce46451b6a6a28ac8386fca2ba914044e0e2391660405160405180910390a260019550505050505092915050565b60008082610c2a8161114d565b1515610c9e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f636f6e7472616374496420646f6573206e6f742065786973740000000000000081525060200191505060405180910390fd5b833373ffffffffffffffffffffffffffffffffffffffff16600080836000191660001916815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610d7f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f726566756e6461626c653a206e6f742073656e6465720000000000000000000081525060200191505060405180910390fd5b60001515600080836000191660001916815260200190815260200160002060050160019054906101000a900460ff161515141515610e25576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f726566756e6461626c653a20616c726561647920726566756e6465640000000081525060200191505060405180910390fd5b60001515600080836000191660001916815260200190815260200160002060050160009054906101000a900460ff161515141515610ecb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f726566756e6461626c653a20616c72656164792077697468647261776e00000081525060200191505060405180910390fd5b4260008083600019166000191681526020019081526020016000206004015411151515610f86576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f726566756e6461626c653a2074696d656c6f636b206e6f74207965742070617381526020017f736564000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6000808660001916600019168152602001908152602001600020925060018360050160016101000a81548160ff0219169083151502179055508260000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc84600201549081150290604051600060405180830381858888f1935050505015801561102d573d6000803e3d6000fd5b5084600019167f989b3a845197c9aec15f8982bbb30b5da714050e662a7a287bb1a94c81e2e70e60405160405180910390a260019350505050919050565b60008060008060008060008060008015156110858b61114d565b1515141561109257611141565b6000808b6000191660001916815260200190815260200160002090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168260020154836003015484600401548560050160009054906101000a900460ff168660050160019054906101000a900460ff168760060154985098509850985098509850985098505b50919395975091939597565b60008073ffffffffffffffffffffffffffffffffffffffff16600080846000191660001916815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141590509190505600a165627a7a723058201ecc7e864abd243ee042ef7704350dc672518245300a302b3522a290244dd5820029", - "deployedBytecode": "0x608060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063335ef5bd1461006757806363615149146100d15780637249fbb614610128578063e16c7d9814610171575b600080fd5b6100b3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560001916906020019092919080359060200190929190505050610257565b60405180826000191660001916815260200191505060405180910390f35b3480156100dd57600080fd5b5061010e60048036038101908080356000191690602001909291908035600019169060200190929190505050610702565b604051808215151515815260200191505060405180910390f35b34801561013457600080fd5b506101576004803603810190808035600019169060200190929190505050610c1d565b604051808215151515815260200191505060405180910390f35b34801561017d57600080fd5b506101a0600480360381019080803560001916906020019092919050505061106b565b604051808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018781526020018660001916600019168152602001858152602001841515151581526020018315151515815260200182600019166000191681526020019850505050505050505060405180910390f35b600080341115156102d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f6d73672e76616c7565206d757374206265203e2030000000000000000000000081525060200191505060405180910390fd5b81428111151561036e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f74696d656c6f636b2074696d65206d75737420626520696e207468652066757481526020017f757265000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b60023386348787604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018481526020018360001916600019168152602001828152602001955050505050506040516020818303038152906040526040518082805190602001908083835b602083101515610463578051825260208201915060208101905060208303925061043e565b6001836020036101000a038019825116818451168082178552505050505050905001915050602060405180830381855afa1580156104a5573d6000803e3d6000fd5b5050506040513d60208110156104ba57600080fd5b810190808051906020019092919050505091506104d68261114d565b156104e057600080fd5b610100604051908101604052803373ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff16815260200134815260200185600019168152602001848152602001600015158152602001600015158152602001600060010260001916815250600080846000191660001916815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020155606082015181600301906000191690556080820151816004015560a08201518160050160006101000a81548160ff02191690831515021790555060c08201518160050160016101000a81548160ff02191690831515021790555060e082015181600601906000191690559050508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1683600019167f329a8316ed9c3b2299597538371c2944c5026574e803b1ec31d6113e1cd67bde348888604051808481526020018360001916600019168152602001828152602001935050505060405180910390a4509392505050565b6000808361070f8161114d565b1515610783576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f636f6e7472616374496420646f6573206e6f742065786973740000000000000081525060200191505060405180910390fd5b84846002816040516020018082600019166000191681526020019150506040516020818303038152906040526040518082805190602001908083835b6020831015156107e457805182526020820191506020810190506020830392506107bf565b6001836020036101000a038019825116818451168082178552505050505050905001915050602060405180830381855afa158015610826573d6000803e3d6000fd5b5050506040513d602081101561083b57600080fd5b810190808051906020019092919050505060001916600080846000191660001916815260200190815260200160002060030154600019161415156108e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f686173686c6f636b206861736820646f6573206e6f74206d617463680000000081525060200191505060405180910390fd5b863373ffffffffffffffffffffffffffffffffffffffff16600080836000191660001916815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156109c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f776974686472617761626c653a206e6f7420726563656976657200000000000081525060200191505060405180910390fd5b60001515600080836000191660001916815260200190815260200160002060050160009054906101000a900460ff161515141515610a6e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f776974686472617761626c653a20616c72656164792077697468647261776e0081525060200191505060405180910390fd5b42600080836000191660001916815260200190815260200160002060040154111515610b28576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260318152602001807f776974686472617761626c653a2074696d656c6f636b2074696d65206d75737481526020017f20626520696e207468652066757475726500000000000000000000000000000081525060400191505060405180910390fd5b600080896000191660001916815260200190815260200160002094508685600601816000191690555060018560050160006101000a81548160ff0219169083151502179055508460010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc86600201549081150290604051600060405180830381858888f19350505050158015610bdc573d6000803e3d6000fd5b5087600019167fd6fd4c8e45bf0c70693141c7ce46451b6a6a28ac8386fca2ba914044e0e2391660405160405180910390a260019550505050505092915050565b60008082610c2a8161114d565b1515610c9e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f636f6e7472616374496420646f6573206e6f742065786973740000000000000081525060200191505060405180910390fd5b833373ffffffffffffffffffffffffffffffffffffffff16600080836000191660001916815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610d7f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f726566756e6461626c653a206e6f742073656e6465720000000000000000000081525060200191505060405180910390fd5b60001515600080836000191660001916815260200190815260200160002060050160019054906101000a900460ff161515141515610e25576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f726566756e6461626c653a20616c726561647920726566756e6465640000000081525060200191505060405180910390fd5b60001515600080836000191660001916815260200190815260200160002060050160009054906101000a900460ff161515141515610ecb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f726566756e6461626c653a20616c72656164792077697468647261776e00000081525060200191505060405180910390fd5b4260008083600019166000191681526020019081526020016000206004015411151515610f86576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f726566756e6461626c653a2074696d656c6f636b206e6f74207965742070617381526020017f736564000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6000808660001916600019168152602001908152602001600020925060018360050160016101000a81548160ff0219169083151502179055508260000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc84600201549081150290604051600060405180830381858888f1935050505015801561102d573d6000803e3d6000fd5b5084600019167f989b3a845197c9aec15f8982bbb30b5da714050e662a7a287bb1a94c81e2e70e60405160405180910390a260019350505050919050565b60008060008060008060008060008015156110858b61114d565b1515141561109257611141565b6000808b6000191660001916815260200190815260200160002090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168260020154836003015484600401548560050160009054906101000a900460ff168660050160019054906101000a900460ff168760060154985098509850985098509850985098505b50919395975091939597565b60008073ffffffffffffffffffffffffffffffffffffffff16600080846000191660001916815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141590509190505600a165627a7a723058201ecc7e864abd243ee042ef7704350dc672518245300a302b3522a290244dd5820029", - "sourceMap": "783:6289:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;783:6289:0;;;;;;;", - "deployedSourceMap": "783:6289:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3572:1070;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4968:447;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4968:447:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5667:339;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5667:339:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6179:584;;8:9:-1;5:2;;;30:1;27;20:12;5:2;6179:584:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3572:1070;3749:18;1476:1;1464:9;:13;1456:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3721:9;1798:3;1790:5;:11;1782:59;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3796:196;3850:10;3878:9;3905;3932;3959;3816:166;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;3816:166:0;;;3796:196;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;3796:196:0;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3796:196:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3796:196:0;;;;;;;;;;;;;;;;3783:209;;4185:24;4198:10;4185:12;:24::i;:::-;4181:50;;;4223:8;;;4181:50;4266:193;;;;;;;;;4292:10;4266:193;;;;;;4316:9;4266:193;;;;;;4339:9;4266:193;;;;4362:9;4266:193;;;;;;;4385:9;4266:193;;;;4408:5;4266:193;;;;;;4427:5;4266:193;;;;;;4446:3;4266:193;;;;;;;;4242:9;:21;4252:10;4242:21;;;;;;;;;;;;;;;;;:217;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4547:9;4475:160;;4523:10;4475:160;;4499:10;4475:160;;;;4570:9;4593;4616;4475:160;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1513:1;3572:1070;;;;;:::o;4968:447::-;5178:4;5198:22;5066:11;1927:25;1940:11;1927:12;:25::i;:::-;1919:63;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5103:11;5116:9;2129:28;2153:2;2136:20;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;2136:20:0;;;2129:28;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;2129:28:0;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2129:28:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;2129:28:0;;;;;;;;;;;;;;;;2094:63;;;:9;:22;2104:11;2094:22;;;;;;;;;;;;;;;;;:31;;;:63;;;;2073:138;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5148:11;2330:10;2295:45;;:9;:22;2305:11;2295:22;;;;;;;;;;;;;;;;;:31;;;;;;;;;;;;:45;;;2287:84;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2425:5;2389:41;;:9;:22;2399:11;2389:22;;;;;;;;;;;;;;;;;:32;;;;;;;;;;;;:41;;;2381:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2518:3;2484:9;:22;2494:11;2484:22;;;;;;;;;;;;;;;;;:31;;;:37;2476:99;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5223:9;:22;5233:11;5223:22;;;;;;;;;;;;;;;;;5198:47;;5268:9;5255:1;:10;;:22;;;;;;;5301:4;5287:1;:11;;;:18;;;;;;;;;;;;;;;;;;5315:1;:10;;;;;;;;;;;;:19;;:29;5335:1;:8;;;5315:29;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5315:29:0;5375:11;5359:28;;;;;;;;;;;;;5404:4;5397:11;;2221:1;1992;;4968:447;;;;;;:::o;5667:339::-;5806:4;5826:22;5744:11;1927:25;1940:11;1927:12;:25::i;:::-;1919:63;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5776:11;2690:10;2657:43;;:9;:22;2667:11;2657:22;;;;;;;;;;;;;;;;;:29;;;;;;;;;;;;:43;;;2649:78;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2780:5;2745:40;;:9;:22;2755:11;2745:22;;;;;;;;;;;;;;;;;:31;;;;;;;;;;;;:40;;;2737:81;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2872:5;2836:41;;:9;:22;2846:11;2836:22;;;;;;;;;;;;;;;;;:32;;;;;;;;;;;;:41;;;2828:83;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2964:3;2929:9;:22;2939:11;2929:22;;;;;;;;;;;;;;;;;:31;;;:38;;2921:86;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5851:9;:22;5861:11;5851:22;;;;;;;;;;;;;;;;;5826:47;;5896:4;5883:1;:10;;;:17;;;;;;;;;;;;;;;;;;5910:1;:8;;;;;;;;;;;;:17;;:27;5928:1;:8;;;5910:27;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5910:27:0;5966:11;5952:26;;;;;;;;;;;;;5995:4;5988:11;;1992:1;5667:339;;;;;:::o;6179:584::-;6279:14;6307:16;6337:11;6362:16;6392:13;6419:14;6447:13;6474:16;6583:22;6548:5;6519:34;;:25;6532:11;6519:12;:25::i;:::-;:34;;;6515:59;;;6567:7;;6515:59;6608:9;:22;6618:11;6608:22;;;;;;;;;;;;;;;;;6583:47;;6648:1;:8;;;;;;;;;;;;6658:1;:10;;;;;;;;;;;;6670:1;:8;;;6680:1;:10;;;6692:1;:10;;;6720:1;:11;;;;;;;;;;;;6733:1;:10;;;;;;;;;;;;6745:1;:10;;;6640:116;;;;;;;;;;;;;;;;6179:584;;;;;;;;;;;:::o;6891:178::-;6981:11;7059:1;7018:43;;:9;:22;7028:11;7018:22;;;;;;;;;;;;;;;;;:29;;;;;;;;;;;;:43;;;;7008:54;;6891:178;;;:::o", - "source": "pragma solidity ^0.4.24;\npragma experimental \"v0.5.0\";\n\n/**\n * @title Hashed Timelock Contracts (HTLCs) on Ethereum ETH.\n *\n * This contract provides a way to create and keep HTLCs for ETH.\n *\n * See HashedTimelockERC20.sol for a contract that provides the same functions \n * for ERC20 tokens.\n *\n * Protocol:\n *\n * 1) newContract(receiver, hashlock, timelock) - a sender calls this to create\n * a new HTLC and gets back a 32 byte contract id\n * 2) withdraw(contractId, preimage) - once the receiver knows the preimage of\n * the hashlock hash they can claim the ETH with this function\n * 3) refund() - after timelock has expired and if the receiver did not \n * withdraw funds the sender / creater of the HTLC can get their ETH \n * back with this function.\n */\ncontract HashedTimelock {\n \n event LogHTLCNew(\n bytes32 indexed contractId,\n address indexed sender,\n address indexed receiver,\n uint amount,\n bytes32 hashlock,\n uint timelock\n );\n event LogHTLCWithdraw(bytes32 indexed contractId);\n event LogHTLCRefund(bytes32 indexed contractId);\n\n struct LockContract {\n address sender;\n address receiver;\n uint amount;\n bytes32 hashlock; // sha-2 sha256 hash\n uint timelock; // UNIX timestamp seconds - locked UNTIL this time\n bool withdrawn;\n bool refunded;\n bytes32 preimage;\n }\n\n modifier fundsSent() {\n require(msg.value > 0, \"msg.value must be > 0\");\n _;\n }\n modifier futureTimelock(uint _time) {\n // only requirement is the timelock time is after the last blocktime (now).\n // probably want something a bit further in the future then this.\n // but this is still a useful sanity check:\n require(_time > now, \"timelock time must be in the future\");\n _;\n }\n modifier contractExists(bytes32 _contractId) {\n require(haveContract(_contractId), \"contractId does not exist\");\n _;\n }\n modifier hashlockMatches(bytes32 _contractId, bytes32 _x) {\n require(\n contracts[_contractId].hashlock == sha256(abi.encodePacked(_x)),\n \"hashlock hash does not match\"\n );\n _;\n }\n modifier withdrawable(bytes32 _contractId) {\n require(contracts[_contractId].receiver == msg.sender, \"withdrawable: not receiver\");\n require(contracts[_contractId].withdrawn == false, \"withdrawable: already withdrawn\");\n require(contracts[_contractId].timelock > now, \"withdrawable: timelock time must be in the future\");\n _;\n }\n modifier refundable(bytes32 _contractId) {\n require(contracts[_contractId].sender == msg.sender, \"refundable: not sender\");\n require(contracts[_contractId].refunded == false, \"refundable: already refunded\");\n require(contracts[_contractId].withdrawn == false, \"refundable: already withdrawn\");\n require(contracts[_contractId].timelock <= now, \"refundable: timelock not yet passed\");\n _;\n }\n\n mapping (bytes32 => LockContract) contracts;\n\n /**\n * @dev Sender sets up a new hash time lock contract depositing the ETH and \n * providing the reciever lock terms.\n *\n * @param _receiver Receiver of the ETH.\n * @param _hashlock A sha-2 sha256 hash hashlock.\n * @param _timelock UNIX epoch seconds time that the lock expires at. \n * Refunds can be made after this time.\n * @return contractId Id of the new HTLC. This is needed for subsequent \n * calls.\n */\n function newContract(address _receiver, bytes32 _hashlock, uint _timelock)\n external\n payable\n fundsSent\n futureTimelock(_timelock)\n returns (bytes32 contractId)\n {\n contractId = sha256(\n abi.encodePacked(\n msg.sender,\n _receiver,\n msg.value,\n _hashlock,\n _timelock\n )\n );\n\n // Reject if a contract already exists with the same parameters. The\n // sender must change one of these parameters to create a new distinct \n // contract.\n if (haveContract(contractId))\n revert();\n\n contracts[contractId] = LockContract(\n msg.sender,\n _receiver,\n msg.value,\n _hashlock,\n _timelock,\n false,\n false,\n 0x0\n );\n\n emit LogHTLCNew(\n contractId,\n msg.sender,\n _receiver,\n msg.value,\n _hashlock,\n _timelock\n );\n }\n\n /**\n * @dev Called by the receiver once they know the preimage of the hashlock.\n * This will transfer the locked funds to their address.\n *\n * @param _contractId Id of the HTLC.\n * @param _preimage sha256(_preimage) should equal the contract hashlock.\n * @return bool true on success\n */\n function withdraw(bytes32 _contractId, bytes32 _preimage)\n external\n contractExists(_contractId)\n hashlockMatches(_contractId, _preimage)\n withdrawable(_contractId)\n returns (bool)\n {\n LockContract storage c = contracts[_contractId];\n c.preimage = _preimage;\n c.withdrawn = true;\n c.receiver.transfer(c.amount);\n emit LogHTLCWithdraw(_contractId);\n return true;\n }\n\n /**\n * @dev Called by the sender if there was no withdraw AND the time lock has\n * expired. This will refund the contract amount.\n *\n * @param _contractId Id of HTLC to refund from.\n * @return bool true on success\n */\n function refund(bytes32 _contractId)\n external\n contractExists(_contractId)\n refundable(_contractId)\n returns (bool)\n {\n LockContract storage c = contracts[_contractId];\n c.refunded = true;\n c.sender.transfer(c.amount);\n emit LogHTLCRefund(_contractId);\n return true;\n }\n\n /**\n * @dev Get contract details.\n * @param _contractId HTLC contract id\n * @return All parameters in struct LockContract for _contractId HTLC\n */\n function getContract(bytes32 _contractId)\n public\n view\n returns (\n address sender,\n address receiver,\n uint amount,\n bytes32 hashlock,\n uint timelock,\n bool withdrawn,\n bool refunded,\n bytes32 preimage\n )\n {\n if (haveContract(_contractId) == false)\n return;\n LockContract storage c = contracts[_contractId];\n return (c.sender, c.receiver, c.amount, c.hashlock, c.timelock,\n c.withdrawn, c.refunded, c.preimage);\n }\n\n /**\n * @dev Is there a contract with id _contractId.\n * @param _contractId Id into contracts mapping.\n */\n function haveContract(bytes32 _contractId)\n internal\n view\n returns (bool exists)\n {\n exists = (contracts[_contractId].sender != address(0));\n }\n\n}\n", - "sourcePath": "/home/hatch/eth/hashed-timelock-contract-ethereum/contracts/HashedTimelock.sol", + "bytecode": "0x608060405234801561001057600080fd5b5061118c806100206000396000f3fe608060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063335ef5bd1461006757806363615149146100d35780637249fbb614610130578063e16c7d9814610183575b600080fd5b6100bd6004803603606081101561007d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050610263565b6040518082815260200191505060405180910390f35b3480156100df57600080fd5b50610116600480360360408110156100f657600080fd5b8101908080359060200190929190803590602001909291905050506106de565b604051808215151515815260200191505060405180910390f35b34801561013c57600080fd5b506101696004803603602081101561015357600080fd5b8101908080359060200190929190505050610bba565b604051808215151515815260200191505060405180910390f35b34801561018f57600080fd5b506101bc600480360360208110156101a657600080fd5b8101908080359060200190929190505050610fdd565b604051808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200187815260200186815260200185815260200184151515158152602001831515151581526020018281526020019850505050505050505060405180910390f35b600080341115156102dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f6d73672e76616c7565206d757374206265203e2030000000000000000000000081525060200191505060405180910390fd5b81428111151561037a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f74696d656c6f636b2074696d65206d75737420626520696e207468652066757481526020017f757265000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b60023386348787604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c01000000000000000000000000028152601401848152602001838152602001828152602001955050505050506040516020818303038152906040526040518082805190602001908083835b6020831015156104675780518252602082019150602081019050602083039250610442565b6001836020036101000a038019825116818451168082178552505050505050905001915050602060405180830381855afa1580156104a9573d6000803e3d6000fd5b5050506040513d60208110156104be57600080fd5b810190808051906020019092919050505091506104da826110f2565b156104e457600080fd5b610100604051908101604052803373ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff168152602001348152602001858152602001848152602001600015158152602001600015158152602001600060010281525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020155606082015181600301556080820151816004015560a08201518160050160006101000a81548160ff02191690831515021790555060c08201518160050160016101000a81548160ff02191690831515021790555060e082015181600601559050508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16837f329a8316ed9c3b2299597538371c2944c5026574e803b1ec31d6113e1cd67bde34888860405180848152602001838152602001828152602001935050505060405180910390a4509392505050565b6000826106ea816110f2565b151561075e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f636f6e7472616374496420646f6573206e6f742065786973740000000000000081525060200191505060405180910390fd5b8383600281604051602001808281526020019150506040516020818303038152906040526040518082805190602001908083835b6020831015156107b75780518252602082019150602081019050602083039250610792565b6001836020036101000a038019825116818451168082178552505050505050905001915050602060405180830381855afa1580156107f9573d6000803e3d6000fd5b5050506040513d602081101561080e57600080fd5b8101908080519060200190929190505050600080848152602001908152602001600020600301541415156108aa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f686173686c6f636b206861736820646f6573206e6f74206d617463680000000081525060200191505060405180910390fd5b853373ffffffffffffffffffffffffffffffffffffffff1660008083815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610983576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f776974686472617761626c653a206e6f7420726563656976657200000000000081525060200191505060405180910390fd5b6000151560008083815260200190815260200160002060050160009054906101000a900460ff161515141515610a21576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f776974686472617761626c653a20616c72656164792077697468647261776e0081525060200191505060405180910390fd5b4260008083815260200190815260200160002060040154111515610ad3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260318152602001807f776974686472617761626c653a2074696d656c6f636b2074696d65206d75737481526020017f20626520696e207468652066757475726500000000000000000000000000000081525060400191505060405180910390fd5b6000806000898152602001908152602001600020905086816006018190555060018160050160006101000a81548160ff0219169083151502179055508060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc82600201549081150290604051600060405180830381858888f19350505050158015610b7d573d6000803e3d6000fd5b50877fd6fd4c8e45bf0c70693141c7ce46451b6a6a28ac8386fca2ba914044e0e2391660405160405180910390a260019550505050505092915050565b600081610bc6816110f2565b1515610c3a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f636f6e7472616374496420646f6573206e6f742065786973740000000000000081525060200191505060405180910390fd5b823373ffffffffffffffffffffffffffffffffffffffff1660008083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610d13576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f726566756e6461626c653a206e6f742073656e6465720000000000000000000081525060200191505060405180910390fd5b6000151560008083815260200190815260200160002060050160019054906101000a900460ff161515141515610db1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f726566756e6461626c653a20616c726561647920726566756e6465640000000081525060200191505060405180910390fd5b6000151560008083815260200190815260200160002060050160009054906101000a900460ff161515141515610e4f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f726566756e6461626c653a20616c72656164792077697468647261776e00000081525060200191505060405180910390fd5b426000808381526020019081526020016000206004015411151515610f02576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f726566756e6461626c653a2074696d656c6f636b206e6f74207965742070617381526020017f736564000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6000806000868152602001908152602001600020905060018160050160016101000a81548160ff0219169083151502179055508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc82600201549081150290604051600060405180830381858888f19350505050158015610fa3573d6000803e3d6000fd5b50847f989b3a845197c9aec15f8982bbb30b5da714050e662a7a287bb1a94c81e2e70e60405160405180910390a260019350505050919050565b60008060008060008060008060001515610ff68a6110f2565b1515141561103757600080600080600080600080879750869650859550846001029450839350806001029050975097509750975097509750975097506110e7565b60008060008b815260200190815260200160002090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168260020154836003015484600401548560050160009054906101000a900460ff168660050160019054906101000a900460ff16876006015487975086965098509850985098509850985098509850505b919395975091939597565b60008073ffffffffffffffffffffffffffffffffffffffff1660008084815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415905091905056fea165627a7a723058202c43a6432d146fa4f67bc068adfa8a7e3cfdca7cc0915a2de53dbb8ede204c360029", + "deployedBytecode": "0x608060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063335ef5bd1461006757806363615149146100d35780637249fbb614610130578063e16c7d9814610183575b600080fd5b6100bd6004803603606081101561007d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050610263565b6040518082815260200191505060405180910390f35b3480156100df57600080fd5b50610116600480360360408110156100f657600080fd5b8101908080359060200190929190803590602001909291905050506106de565b604051808215151515815260200191505060405180910390f35b34801561013c57600080fd5b506101696004803603602081101561015357600080fd5b8101908080359060200190929190505050610bba565b604051808215151515815260200191505060405180910390f35b34801561018f57600080fd5b506101bc600480360360208110156101a657600080fd5b8101908080359060200190929190505050610fdd565b604051808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200187815260200186815260200185815260200184151515158152602001831515151581526020018281526020019850505050505050505060405180910390f35b600080341115156102dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f6d73672e76616c7565206d757374206265203e2030000000000000000000000081525060200191505060405180910390fd5b81428111151561037a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f74696d656c6f636b2074696d65206d75737420626520696e207468652066757481526020017f757265000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b60023386348787604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c01000000000000000000000000028152601401848152602001838152602001828152602001955050505050506040516020818303038152906040526040518082805190602001908083835b6020831015156104675780518252602082019150602081019050602083039250610442565b6001836020036101000a038019825116818451168082178552505050505050905001915050602060405180830381855afa1580156104a9573d6000803e3d6000fd5b5050506040513d60208110156104be57600080fd5b810190808051906020019092919050505091506104da826110f2565b156104e457600080fd5b610100604051908101604052803373ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff168152602001348152602001858152602001848152602001600015158152602001600015158152602001600060010281525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020155606082015181600301556080820151816004015560a08201518160050160006101000a81548160ff02191690831515021790555060c08201518160050160016101000a81548160ff02191690831515021790555060e082015181600601559050508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16837f329a8316ed9c3b2299597538371c2944c5026574e803b1ec31d6113e1cd67bde34888860405180848152602001838152602001828152602001935050505060405180910390a4509392505050565b6000826106ea816110f2565b151561075e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f636f6e7472616374496420646f6573206e6f742065786973740000000000000081525060200191505060405180910390fd5b8383600281604051602001808281526020019150506040516020818303038152906040526040518082805190602001908083835b6020831015156107b75780518252602082019150602081019050602083039250610792565b6001836020036101000a038019825116818451168082178552505050505050905001915050602060405180830381855afa1580156107f9573d6000803e3d6000fd5b5050506040513d602081101561080e57600080fd5b8101908080519060200190929190505050600080848152602001908152602001600020600301541415156108aa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f686173686c6f636b206861736820646f6573206e6f74206d617463680000000081525060200191505060405180910390fd5b853373ffffffffffffffffffffffffffffffffffffffff1660008083815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610983576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f776974686472617761626c653a206e6f7420726563656976657200000000000081525060200191505060405180910390fd5b6000151560008083815260200190815260200160002060050160009054906101000a900460ff161515141515610a21576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f776974686472617761626c653a20616c72656164792077697468647261776e0081525060200191505060405180910390fd5b4260008083815260200190815260200160002060040154111515610ad3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260318152602001807f776974686472617761626c653a2074696d656c6f636b2074696d65206d75737481526020017f20626520696e207468652066757475726500000000000000000000000000000081525060400191505060405180910390fd5b6000806000898152602001908152602001600020905086816006018190555060018160050160006101000a81548160ff0219169083151502179055508060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc82600201549081150290604051600060405180830381858888f19350505050158015610b7d573d6000803e3d6000fd5b50877fd6fd4c8e45bf0c70693141c7ce46451b6a6a28ac8386fca2ba914044e0e2391660405160405180910390a260019550505050505092915050565b600081610bc6816110f2565b1515610c3a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f636f6e7472616374496420646f6573206e6f742065786973740000000000000081525060200191505060405180910390fd5b823373ffffffffffffffffffffffffffffffffffffffff1660008083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610d13576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f726566756e6461626c653a206e6f742073656e6465720000000000000000000081525060200191505060405180910390fd5b6000151560008083815260200190815260200160002060050160019054906101000a900460ff161515141515610db1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f726566756e6461626c653a20616c726561647920726566756e6465640000000081525060200191505060405180910390fd5b6000151560008083815260200190815260200160002060050160009054906101000a900460ff161515141515610e4f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f726566756e6461626c653a20616c72656164792077697468647261776e00000081525060200191505060405180910390fd5b426000808381526020019081526020016000206004015411151515610f02576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f726566756e6461626c653a2074696d656c6f636b206e6f74207965742070617381526020017f736564000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6000806000868152602001908152602001600020905060018160050160016101000a81548160ff0219169083151502179055508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc82600201549081150290604051600060405180830381858888f19350505050158015610fa3573d6000803e3d6000fd5b50847f989b3a845197c9aec15f8982bbb30b5da714050e662a7a287bb1a94c81e2e70e60405160405180910390a260019350505050919050565b60008060008060008060008060001515610ff68a6110f2565b1515141561103757600080600080600080600080879750869650859550846001029450839350806001029050975097509750975097509750975097506110e7565b60008060008b815260200190815260200160002090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168260020154836003015484600401548560050160009054906101000a900460ff168660050160019054906101000a900460ff16876006015487975086965098509850985098509850985098509850505b919395975091939597565b60008073ffffffffffffffffffffffffffffffffffffffff1660008084815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415905091905056fea165627a7a723058202c43a6432d146fa4f67bc068adfa8a7e3cfdca7cc0915a2de53dbb8ede204c360029", + "sourceMap": "752:6360:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;752:6360:0;;;;;;;", + "deployedSourceMap": "752:6360:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3553:1078;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3553:1078:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4957:447;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4957:447:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;4957:447:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5656:339;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5656:339:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;5656:339:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6168:635;;8:9:-1;5:2;;;30:1;27;20:12;5:2;6168:635:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;6168:635:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3553:1078;3738:18;1457:1;1445:9;:13;1437:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3710:9;1779:3;1771:5;:11;1763:59;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3785:196;3839:10;3867:9;3894;3921;3948;3805:166;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;3805:166:0;;;3785:196;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;3785:196:0;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3785:196:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3785:196:0;;;;;;;;;;;;;;;;3772:209;;4174:24;4187:10;4174:12;:24::i;:::-;4170:50;;;4212:8;;;4170:50;4255:193;;;;;;;;;4281:10;4255:193;;;;;;4305:9;4255:193;;;;;;4328:9;4255:193;;;;4351:9;4255:193;;;;4374:9;4255:193;;;;4397:5;4255:193;;;;;;4416:5;4255:193;;;;;;4435:3;4255:193;;;;;4231:9;:21;4241:10;4231:21;;;;;;;;;;;:217;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4536:9;4464:160;;4512:10;4464:160;;4488:10;4464:160;4559:9;4582;4605;4464:160;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1494:1;3553:1078;;;;;:::o;4957:447::-;5167:4;5055:11;1908:25;1921:11;1908:12;:25::i;:::-;1900:63;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5092:11;5105:9;2110:28;2134:2;2117:20;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;2117:20:0;;;2110:28;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;2110:28:0;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2110:28:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;2110:28:0;;;;;;;;;;;;;;;;2075:9;:22;2085:11;2075:22;;;;;;;;;;;:31;;;:63;2054:138;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5137:11;2311:10;2276:45;;:9;:22;2286:11;2276:22;;;;;;;;;;;:31;;;;;;;;;;;;:45;;;2268:84;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2406:5;2370:41;;:9;:22;2380:11;2370:22;;;;;;;;;;;:32;;;;;;;;;;;;:41;;;2362:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2499:3;2465:9;:22;2475:11;2465:22;;;;;;;;;;;:31;;;:37;2457:99;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5187:22;5212:9;:22;5222:11;5212:22;;;;;;;;;;;5187:47;;5257:9;5244:1;:10;;:22;;;;5290:4;5276:1;:11;;;:18;;;;;;;;;;;;;;;;;;5304:1;:10;;;;;;;;;;;;:19;;:29;5324:1;:8;;;5304:29;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5304:29:0;5364:11;5348:28;;;;;;;;;;5393:4;5386:11;;;2202:1;1973;;4957:447;;;;;:::o;5656:339::-;5795:4;5733:11;1908:25;1921:11;1908:12;:25::i;:::-;1900:63;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5765:11;2671:10;2638:43;;:9;:22;2648:11;2638:22;;;;;;;;;;;:29;;;;;;;;;;;;:43;;;2630:78;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2761:5;2726:40;;:9;:22;2736:11;2726:22;;;;;;;;;;;:31;;;;;;;;;;;;:40;;;2718:81;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2853:5;2817:41;;:9;:22;2827:11;2817:22;;;;;;;;;;;:32;;;;;;;;;;;;:41;;;2809:83;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2945:3;2910:9;:22;2920:11;2910:22;;;;;;;;;;;:31;;;:38;;2902:86;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5815:22;5840:9;:22;5850:11;5840:22;;;;;;;;;;;5815:47;;5885:4;5872:1;:10;;;:17;;;;;;;;;;;;;;;;;;5899:1;:8;;;;;;;;;;;;:17;;:27;5917:1;:8;;;5899:27;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5899:27:0;5955:11;5941:26;;;;;;;;;;5984:4;5977:11;;;1973:1;5656:339;;;;:::o;6168:635::-;6268:14;6296:16;6326:11;6351:16;6381:13;6408:14;6436:13;6463:16;6537:5;6508:34;;:25;6521:11;6508:12;:25::i;:::-;:34;;;6504:109;;;6572:1;6584;6588;6591;6594;6597:5;6604;6611:1;6556:57;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6504:109;6623:22;6648:9;:22;6658:11;6648:22;;;;;;;;;;;6623:47;;6688:1;:8;;;;;;;;;;;;6698:1;:10;;;;;;;;;;;;6710:1;:8;;;6720:1;:10;;;6732:1;:10;;;6760:1;:11;;;;;;;;;;;;6773:1;:10;;;;;;;;;;;;6785:1;:10;;;6680:116;;;;;;;;;;;;;;;;;;;;;;;6168:635;;;;;;;;;;:::o;6931:178::-;7021:11;7099:1;7058:43;;:9;:22;7068:11;7058:22;;;;;;;;;;;:29;;;;;;;;;;;;:43;;;;7048:54;;6931:178;;;:::o", + "source": "pragma solidity ^0.5.0;\n\n/**\n * @title Hashed Timelock Contracts (HTLCs) on Ethereum ETH.\n *\n * This contract provides a way to create and keep HTLCs for ETH.\n *\n * See HashedTimelockERC20.sol for a contract that provides the same functions \n * for ERC20 tokens.\n *\n * Protocol:\n *\n * 1) newContract(receiver, hashlock, timelock) - a sender calls this to create\n * a new HTLC and gets back a 32 byte contract id\n * 2) withdraw(contractId, preimage) - once the receiver knows the preimage of\n * the hashlock hash they can claim the ETH with this function\n * 3) refund() - after timelock has expired and if the receiver did not \n * withdraw funds the sender / creater of the HTLC can get their ETH \n * back with this function.\n */\ncontract HashedTimelock {\n\n event LogHTLCNew(\n bytes32 indexed contractId,\n address indexed sender,\n address indexed receiver,\n uint amount,\n bytes32 hashlock,\n uint timelock\n );\n event LogHTLCWithdraw(bytes32 indexed contractId);\n event LogHTLCRefund(bytes32 indexed contractId);\n\n struct LockContract {\n address payable sender;\n address payable receiver;\n uint amount;\n bytes32 hashlock; // sha-2 sha256 hash\n uint timelock; // UNIX timestamp seconds - locked UNTIL this time\n bool withdrawn;\n bool refunded;\n bytes32 preimage;\n }\n\n modifier fundsSent() {\n require(msg.value > 0, \"msg.value must be > 0\");\n _;\n }\n modifier futureTimelock(uint _time) {\n // only requirement is the timelock time is after the last blocktime (now).\n // probably want something a bit further in the future then this.\n // but this is still a useful sanity check:\n require(_time > now, \"timelock time must be in the future\");\n _;\n }\n modifier contractExists(bytes32 _contractId) {\n require(haveContract(_contractId), \"contractId does not exist\");\n _;\n }\n modifier hashlockMatches(bytes32 _contractId, bytes32 _x) {\n require(\n contracts[_contractId].hashlock == sha256(abi.encodePacked(_x)),\n \"hashlock hash does not match\"\n );\n _;\n }\n modifier withdrawable(bytes32 _contractId) {\n require(contracts[_contractId].receiver == msg.sender, \"withdrawable: not receiver\");\n require(contracts[_contractId].withdrawn == false, \"withdrawable: already withdrawn\");\n require(contracts[_contractId].timelock > now, \"withdrawable: timelock time must be in the future\");\n _;\n }\n modifier refundable(bytes32 _contractId) {\n require(contracts[_contractId].sender == msg.sender, \"refundable: not sender\");\n require(contracts[_contractId].refunded == false, \"refundable: already refunded\");\n require(contracts[_contractId].withdrawn == false, \"refundable: already withdrawn\");\n require(contracts[_contractId].timelock <= now, \"refundable: timelock not yet passed\");\n _;\n }\n\n mapping (bytes32 => LockContract) contracts;\n\n /**\n * @dev Sender sets up a new hash time lock contract depositing the ETH and \n * providing the reciever lock terms.\n *\n * @param _receiver Receiver of the ETH.\n * @param _hashlock A sha-2 sha256 hash hashlock.\n * @param _timelock UNIX epoch seconds time that the lock expires at. \n * Refunds can be made after this time.\n * @return contractId Id of the new HTLC. This is needed for subsequent \n * calls.\n */\n function newContract(address payable _receiver, bytes32 _hashlock, uint _timelock)\n external\n payable\n fundsSent\n futureTimelock(_timelock)\n returns (bytes32 contractId)\n {\n contractId = sha256(\n abi.encodePacked(\n msg.sender,\n _receiver,\n msg.value,\n _hashlock,\n _timelock\n )\n );\n\n // Reject if a contract already exists with the same parameters. The\n // sender must change one of these parameters to create a new distinct \n // contract.\n if (haveContract(contractId))\n revert();\n\n contracts[contractId] = LockContract(\n msg.sender,\n _receiver,\n msg.value,\n _hashlock,\n _timelock,\n false,\n false,\n 0x0\n );\n\n emit LogHTLCNew(\n contractId,\n msg.sender,\n _receiver,\n msg.value,\n _hashlock,\n _timelock\n );\n }\n\n /**\n * @dev Called by the receiver once they know the preimage of the hashlock.\n * This will transfer the locked funds to their address.\n *\n * @param _contractId Id of the HTLC.\n * @param _preimage sha256(_preimage) should equal the contract hashlock.\n * @return bool true on success\n */\n function withdraw(bytes32 _contractId, bytes32 _preimage)\n external\n contractExists(_contractId)\n hashlockMatches(_contractId, _preimage)\n withdrawable(_contractId)\n returns (bool)\n {\n LockContract storage c = contracts[_contractId];\n c.preimage = _preimage;\n c.withdrawn = true;\n c.receiver.transfer(c.amount);\n emit LogHTLCWithdraw(_contractId);\n return true;\n }\n\n /**\n * @dev Called by the sender if there was no withdraw AND the time lock has\n * expired. This will refund the contract amount.\n *\n * @param _contractId Id of HTLC to refund from.\n * @return bool true on success\n */\n function refund(bytes32 _contractId)\n external\n contractExists(_contractId)\n refundable(_contractId)\n returns (bool)\n {\n LockContract storage c = contracts[_contractId];\n c.refunded = true;\n c.sender.transfer(c.amount);\n emit LogHTLCRefund(_contractId);\n return true;\n }\n\n /**\n * @dev Get contract details.\n * @param _contractId HTLC contract id\n * @return All parameters in struct LockContract for _contractId HTLC\n */\n function getContract(bytes32 _contractId)\n public\n view\n returns (\n address sender,\n address receiver,\n uint amount,\n bytes32 hashlock,\n uint timelock,\n bool withdrawn,\n bool refunded,\n bytes32 preimage\n )\n {\n if (haveContract(_contractId) == false)\n return (address(0), address(0), 0, 0, 0, false, false, 0);\n LockContract storage c = contracts[_contractId];\n return (c.sender, c.receiver, c.amount, c.hashlock, c.timelock,\n c.withdrawn, c.refunded, c.preimage);\n }\n\n /**\n * @dev Is there a contract with id _contractId.\n * @param _contractId Id into contracts mapping.\n */\n function haveContract(bytes32 _contractId)\n internal\n view\n returns (bool exists)\n {\n exists = (contracts[_contractId].sender != address(0));\n }\n\n}\n", + "sourcePath": "/home/hatch/src/eth/hashed-timelock-contract-ethereum/contracts/HashedTimelock.sol", "ast": { - "absolutePath": "/home/hatch/eth/hashed-timelock-contract-ethereum/contracts/HashedTimelock.sol", + "absolutePath": "/home/hatch/src/eth/hashed-timelock-contract-ethereum/contracts/HashedTimelock.sol", "exportedSymbols": { "HashedTimelock": [ - 425 + 437 ] }, - "id": 426, + "id": 438, "nodeType": "SourceUnit", "nodes": [ { @@ -200,20 +200,11 @@ "literals": [ "solidity", "^", - "0.4", - ".24" + "0.5", + ".0" ], "nodeType": "PragmaDirective", - "src": "0:24:0" - }, - { - "id": 2, - "literals": [ - "experimental", - "v0.5.0" - ], - "nodeType": "PragmaDirective", - "src": "25:29:0" + "src": "0:23:0" }, { "baseContracts": [], @@ -221,9 +212,9 @@ "contractKind": "contract", "documentation": "@title Hashed Timelock Contracts (HTLCs) on Ethereum ETH.\n * This contract provides a way to create and keep HTLCs for ETH.\n * See HashedTimelockERC20.sol for a contract that provides the same functions \nfor ERC20 tokens.\n * Protocol:\n * 1) newContract(receiver, hashlock, timelock) - a sender calls this to create\n a new HTLC and gets back a 32 byte contract id\n 2) withdraw(contractId, preimage) - once the receiver knows the preimage of\n the hashlock hash they can claim the ETH with this function\n 3) refund() - after timelock has expired and if the receiver did not \n withdraw funds the sender / creater of the HTLC can get their ETH \n back with this function.", "fullyImplemented": true, - "id": 425, + "id": 437, "linearizedBaseContracts": [ - 425 + 437 ], "name": "HashedTimelock", "nodeType": "ContractDefinition", @@ -231,21 +222,21 @@ { "anonymous": false, "documentation": null, - "id": 16, + "id": 15, "name": "LogHTLCNew", "nodeType": "EventDefinition", "parameters": { - "id": 15, + "id": 14, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 4, + "id": 3, "indexed": true, "name": "contractId", "nodeType": "VariableDeclaration", - "scope": 16, - "src": "844:26:0", + "scope": 15, + "src": "809:26:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -253,10 +244,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 3, + "id": 2, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "844:7:0", + "src": "809:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -267,12 +258,12 @@ }, { "constant": false, - "id": 6, + "id": 5, "indexed": true, "name": "sender", "nodeType": "VariableDeclaration", - "scope": 16, - "src": "880:22:0", + "scope": 15, + "src": "845:22:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -280,10 +271,11 @@ "typeString": "address" }, "typeName": { - "id": 5, + "id": 4, "name": "address", "nodeType": "ElementaryTypeName", - "src": "880:7:0", + "src": "845:7:0", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -294,12 +286,12 @@ }, { "constant": false, - "id": 8, + "id": 7, "indexed": true, "name": "receiver", "nodeType": "VariableDeclaration", - "scope": 16, - "src": "912:24:0", + "scope": 15, + "src": "877:24:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -307,10 +299,11 @@ "typeString": "address" }, "typeName": { - "id": 7, + "id": 6, "name": "address", "nodeType": "ElementaryTypeName", - "src": "912:7:0", + "src": "877:7:0", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -321,12 +314,12 @@ }, { "constant": false, - "id": 10, + "id": 9, "indexed": false, "name": "amount", "nodeType": "VariableDeclaration", - "scope": 16, - "src": "946:11:0", + "scope": 15, + "src": "911:11:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -334,10 +327,10 @@ "typeString": "uint256" }, "typeName": { - "id": 9, + "id": 8, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "946:4:0", + "src": "911:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -348,12 +341,12 @@ }, { "constant": false, - "id": 12, + "id": 11, "indexed": false, "name": "hashlock", "nodeType": "VariableDeclaration", - "scope": 16, - "src": "967:16:0", + "scope": 15, + "src": "932:16:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -361,10 +354,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 11, + "id": 10, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "967:7:0", + "src": "932:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -375,12 +368,12 @@ }, { "constant": false, - "id": 14, + "id": 13, "indexed": false, "name": "timelock", "nodeType": "VariableDeclaration", - "scope": 16, - "src": "993:13:0", + "scope": 15, + "src": "958:13:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -388,10 +381,10 @@ "typeString": "uint256" }, "typeName": { - "id": 13, + "id": 12, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "993:4:0", + "src": "958:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -401,28 +394,28 @@ "visibility": "internal" } ], - "src": "834:178:0" + "src": "799:178:0" }, - "src": "818:195:0" + "src": "783:195:0" }, { "anonymous": false, "documentation": null, - "id": 20, + "id": 19, "name": "LogHTLCWithdraw", "nodeType": "EventDefinition", "parameters": { - "id": 19, + "id": 18, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 18, + "id": 17, "indexed": true, "name": "contractId", "nodeType": "VariableDeclaration", - "scope": 20, - "src": "1040:26:0", + "scope": 19, + "src": "1005:26:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -430,10 +423,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 17, + "id": 16, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1040:7:0", + "src": "1005:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -443,28 +436,28 @@ "visibility": "internal" } ], - "src": "1039:28:0" + "src": "1004:28:0" }, - "src": "1018:50:0" + "src": "983:50:0" }, { "anonymous": false, "documentation": null, - "id": 24, + "id": 23, "name": "LogHTLCRefund", "nodeType": "EventDefinition", "parameters": { - "id": 23, + "id": 22, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 22, + "id": 21, "indexed": true, "name": "contractId", "nodeType": "VariableDeclaration", - "scope": 24, - "src": "1093:26:0", + "scope": 23, + "src": "1058:26:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -472,10 +465,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 21, + "id": 20, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1093:7:0", + "src": "1058:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -485,35 +478,36 @@ "visibility": "internal" } ], - "src": "1092:28:0" + "src": "1057:28:0" }, - "src": "1073:48:0" + "src": "1038:48:0" }, { "canonicalName": "HashedTimelock.LockContract", - "id": 41, + "id": 40, "members": [ { "constant": false, - "id": 26, + "id": 25, "name": "sender", "nodeType": "VariableDeclaration", - "scope": 41, - "src": "1157:14:0", + "scope": 40, + "src": "1122:22:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, "typeName": { - "id": 25, + "id": 24, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1157:7:0", + "src": "1122:15:0", + "stateMutability": "payable", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, "value": null, @@ -521,25 +515,26 @@ }, { "constant": false, - "id": 28, + "id": 27, "name": "receiver", "nodeType": "VariableDeclaration", - "scope": 41, - "src": "1181:16:0", + "scope": 40, + "src": "1154:24:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, "typeName": { - "id": 27, + "id": 26, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1181:7:0", + "src": "1154:15:0", + "stateMutability": "payable", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, "value": null, @@ -547,11 +542,11 @@ }, { "constant": false, - "id": 30, + "id": 29, "name": "amount", "nodeType": "VariableDeclaration", - "scope": 41, - "src": "1207:11:0", + "scope": 40, + "src": "1188:11:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -559,10 +554,10 @@ "typeString": "uint256" }, "typeName": { - "id": 29, + "id": 28, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "1207:4:0", + "src": "1188:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -573,11 +568,11 @@ }, { "constant": false, - "id": 32, + "id": 31, "name": "hashlock", "nodeType": "VariableDeclaration", - "scope": 41, - "src": "1228:16:0", + "scope": 40, + "src": "1209:16:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -585,10 +580,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 31, + "id": 30, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1228:7:0", + "src": "1209:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -599,11 +594,11 @@ }, { "constant": false, - "id": 34, + "id": 33, "name": "timelock", "nodeType": "VariableDeclaration", - "scope": 41, - "src": "1275:13:0", + "scope": 40, + "src": "1256:13:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -611,10 +606,10 @@ "typeString": "uint256" }, "typeName": { - "id": 33, + "id": 32, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "1275:4:0", + "src": "1256:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -625,11 +620,11 @@ }, { "constant": false, - "id": 36, + "id": 35, "name": "withdrawn", "nodeType": "VariableDeclaration", - "scope": 41, - "src": "1349:14:0", + "scope": 40, + "src": "1330:14:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -637,10 +632,10 @@ "typeString": "bool" }, "typeName": { - "id": 35, + "id": 34, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "1349:4:0", + "src": "1330:4:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -651,11 +646,11 @@ }, { "constant": false, - "id": 38, + "id": 37, "name": "refunded", "nodeType": "VariableDeclaration", - "scope": 41, - "src": "1373:13:0", + "scope": 40, + "src": "1354:13:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -663,10 +658,10 @@ "typeString": "bool" }, "typeName": { - "id": 37, + "id": 36, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "1373:4:0", + "src": "1354:4:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -677,11 +672,11 @@ }, { "constant": false, - "id": 40, + "id": 39, "name": "preimage", "nodeType": "VariableDeclaration", - "scope": 41, - "src": "1396:16:0", + "scope": 40, + "src": "1377:16:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -689,10 +684,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 39, + "id": 38, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1396:7:0", + "src": "1377:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -704,15 +699,15 @@ ], "name": "LockContract", "nodeType": "StructDefinition", - "scope": 425, - "src": "1127:292:0", + "scope": 437, + "src": "1092:308:0", "visibility": "public" }, { "body": { - "id": 52, + "id": 51, "nodeType": "Block", - "src": "1446:75:0", + "src": "1427:75:0", "statements": [ { "expression": { @@ -724,7 +719,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 47, + "id": 46, "isConstant": false, "isLValue": false, "isPure": false, @@ -733,18 +728,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 44, + "id": 43, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "1464:3:0", + "referencedDeclaration": 1636, + "src": "1445:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 45, + "id": 44, "isConstant": false, "isLValue": false, "isPure": false, @@ -752,7 +747,7 @@ "memberName": "value", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "1464:9:0", + "src": "1445:9:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -763,14 +758,14 @@ "rightExpression": { "argumentTypes": null, "hexValue": "30", - "id": 46, + "id": 45, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "1476:1:0", + "src": "1457:1:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", @@ -778,7 +773,7 @@ }, "value": "0" }, - "src": "1464:13:0", + "src": "1445:13:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -787,14 +782,14 @@ { "argumentTypes": null, "hexValue": "6d73672e76616c7565206d757374206265203e2030", - "id": 48, + "id": 47, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "1479:23:0", + "src": "1460:23:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_e732522f9e0ad111d95708b06d98aab65f1409b187a66ff1dfb881988d8f20b7", @@ -814,21 +809,21 @@ "typeString": "literal_string \"msg.value must be > 0\"" } ], - "id": 43, + "id": 42, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "1456:7:0", + "referencedDeclaration": 1640, + "src": "1437:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 49, + "id": 48, "isConstant": false, "isLValue": false, "isPure": false, @@ -836,41 +831,41 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "1456:47:0", + "src": "1437:47:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 50, + "id": 49, "nodeType": "ExpressionStatement", - "src": "1456:47:0" + "src": "1437:47:0" }, { - "id": 51, + "id": 50, "nodeType": "PlaceholderStatement", - "src": "1513:1:0" + "src": "1494:1:0" } ] }, "documentation": null, - "id": 53, + "id": 52, "name": "fundsSent", "nodeType": "ModifierDefinition", "parameters": { - "id": 42, + "id": 41, "nodeType": "ParameterList", "parameters": [], - "src": "1443:2:0" + "src": "1424:2:0" }, - "src": "1425:96:0", + "src": "1406:96:0", "visibility": "internal" }, { "body": { - "id": 65, + "id": 64, "nodeType": "Block", - "src": "1562:297:0", + "src": "1543:297:0", "statements": [ { "expression": { @@ -882,19 +877,19 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 60, + "id": 59, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, - "id": 58, + "id": 57, "name": "_time", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 55, - "src": "1790:5:0", + "referencedDeclaration": 54, + "src": "1771:5:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -904,18 +899,18 @@ "operator": ">", "rightExpression": { "argumentTypes": null, - "id": 59, + "id": 58, "name": "now", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1053, - "src": "1798:3:0", + "referencedDeclaration": 1638, + "src": "1779:3:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "1790:11:0", + "src": "1771:11:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -924,14 +919,14 @@ { "argumentTypes": null, "hexValue": "74696d656c6f636b2074696d65206d75737420626520696e2074686520667574757265", - "id": 61, + "id": 60, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "1803:37:0", + "src": "1784:37:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_16dbfee8f738f21cc70987859d9176eb37f9ed0572f04024e006404bb83f7086", @@ -951,21 +946,21 @@ "typeString": "literal_string \"timelock time must be in the future\"" } ], - "id": 57, + "id": 56, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "1782:7:0", + "referencedDeclaration": 1640, + "src": "1763:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 62, + "id": 61, "isConstant": false, "isLValue": false, "isPure": false, @@ -973,38 +968,38 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "1782:59:0", + "src": "1763:59:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 63, + "id": 62, "nodeType": "ExpressionStatement", - "src": "1782:59:0" + "src": "1763:59:0" }, { - "id": 64, + "id": 63, "nodeType": "PlaceholderStatement", - "src": "1851:1:0" + "src": "1832:1:0" } ] }, "documentation": null, - "id": 66, + "id": 65, "name": "futureTimelock", "nodeType": "ModifierDefinition", "parameters": { - "id": 56, + "id": 55, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 55, + "id": 54, "name": "_time", "nodeType": "VariableDeclaration", - "scope": 66, - "src": "1550:10:0", + "scope": 65, + "src": "1531:10:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1012,10 +1007,10 @@ "typeString": "uint256" }, "typeName": { - "id": 54, + "id": 53, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "1550:4:0", + "src": "1531:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1025,16 +1020,16 @@ "visibility": "internal" } ], - "src": "1549:12:0" + "src": "1530:12:0" }, - "src": "1526:333:0", + "src": "1507:333:0", "visibility": "internal" }, { "body": { - "id": 78, + "id": 77, "nodeType": "Block", - "src": "1909:91:0", + "src": "1890:91:0", "statements": [ { "expression": { @@ -1045,12 +1040,12 @@ "arguments": [ { "argumentTypes": null, - "id": 72, + "id": 71, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "1940:11:0", + "referencedDeclaration": 67, + "src": "1921:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -1064,18 +1059,18 @@ "typeString": "bytes32" } ], - "id": 71, + "id": 70, "name": "haveContract", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 424, - "src": "1927:12:0", + "referencedDeclaration": 436, + "src": "1908:12:0", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bool_$", "typeString": "function (bytes32) view returns (bool)" } }, - "id": 73, + "id": 72, "isConstant": false, "isLValue": false, "isPure": false, @@ -1083,7 +1078,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "1927:25:0", + "src": "1908:25:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -1092,14 +1087,14 @@ { "argumentTypes": null, "hexValue": "636f6e7472616374496420646f6573206e6f74206578697374", - "id": 74, + "id": 73, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "1954:27:0", + "src": "1935:27:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_2ff20efe697688cf49352f50e84b155aa5e8db31cae40badce7570a4e72a088a", @@ -1119,21 +1114,21 @@ "typeString": "literal_string \"contractId does not exist\"" } ], - "id": 70, + "id": 69, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "1919:7:0", + "referencedDeclaration": 1640, + "src": "1900:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 75, + "id": 74, "isConstant": false, "isLValue": false, "isPure": false, @@ -1141,38 +1136,38 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "1919:63:0", + "src": "1900:63:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 76, + "id": 75, "nodeType": "ExpressionStatement", - "src": "1919:63:0" + "src": "1900:63:0" }, { - "id": 77, + "id": 76, "nodeType": "PlaceholderStatement", - "src": "1992:1:0" + "src": "1973:1:0" } ] }, "documentation": null, - "id": 79, + "id": 78, "name": "contractExists", "nodeType": "ModifierDefinition", "parameters": { - "id": 69, + "id": 68, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 68, + "id": 67, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 79, - "src": "1888:19:0", + "scope": 78, + "src": "1869:19:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1180,10 +1175,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 67, + "id": 66, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1888:7:0", + "src": "1869:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -1193,16 +1188,16 @@ "visibility": "internal" } ], - "src": "1887:21:0" + "src": "1868:21:0" }, - "src": "1864:136:0", + "src": "1845:136:0", "visibility": "internal" }, { "body": { - "id": 101, + "id": 100, "nodeType": "Block", - "src": "2063:166:0", + "src": "2044:166:0", "statements": [ { "expression": { @@ -1214,7 +1209,7 @@ "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, - "id": 96, + "id": 95, "isConstant": false, "isLValue": false, "isPure": false, @@ -1225,26 +1220,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 86, + "id": 85, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 190, - "src": "2094:9:0", + "referencedDeclaration": 189, + "src": "2075:9:0", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$41_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$40_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract storage ref)" } }, - "id": 88, + "id": 87, "indexExpression": { "argumentTypes": null, - "id": 87, + "id": 86, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "2104:11:0", + "referencedDeclaration": 80, + "src": "2085:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -1255,21 +1250,21 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "2094:22:0", + "src": "2075:22:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage", + "typeIdentifier": "t_struct$_LockContract_$40_storage", "typeString": "struct HashedTimelock.LockContract storage ref" } }, - "id": 89, + "id": 88, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "hashlock", "nodeType": "MemberAccess", - "referencedDeclaration": 32, - "src": "2094:31:0", + "referencedDeclaration": 31, + "src": "2075:31:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -1285,12 +1280,12 @@ "arguments": [ { "argumentTypes": null, - "id": 93, + "id": 92, "name": "_x", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 83, - "src": "2153:2:0", + "referencedDeclaration": 82, + "src": "2134:2:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -1306,18 +1301,18 @@ ], "expression": { "argumentTypes": null, - "id": 91, + "id": 90, "name": "abi", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1038, - "src": "2136:3:0", + "referencedDeclaration": 1623, + "src": "2117:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_abi", "typeString": "abi" } }, - "id": 92, + "id": 91, "isConstant": false, "isLValue": false, "isPure": true, @@ -1325,13 +1320,13 @@ "memberName": "encodePacked", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "2136:16:0", + "src": "2117:16:0", "typeDescriptions": { "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", "typeString": "function () pure returns (bytes memory)" } }, - "id": 94, + "id": 93, "isConstant": false, "isLValue": false, "isPure": false, @@ -1339,7 +1334,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2136:20:0", + "src": "2117:20:0", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" @@ -1353,18 +1348,18 @@ "typeString": "bytes memory" } ], - "id": 90, + "id": 89, "name": "sha256", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1060, - "src": "2129:6:0", + "referencedDeclaration": 1645, + "src": "2110:6:0", "typeDescriptions": { - "typeIdentifier": "t_function_sha256_pure$__$returns$_t_bytes32_$", - "typeString": "function () pure returns (bytes32)" + "typeIdentifier": "t_function_sha256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" } }, - "id": 95, + "id": 94, "isConstant": false, "isLValue": false, "isPure": false, @@ -1372,13 +1367,13 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2129:28:0", + "src": "2110:28:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "src": "2094:63:0", + "src": "2075:63:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -1387,14 +1382,14 @@ { "argumentTypes": null, "hexValue": "686173686c6f636b206861736820646f6573206e6f74206d61746368", - "id": 97, + "id": 96, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2171:30:0", + "src": "2152:30:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_f69d465af376b0946a94d153fa61e1120954d7550ccad2ede50c179df9b911a9", @@ -1414,21 +1409,21 @@ "typeString": "literal_string \"hashlock hash does not match\"" } ], - "id": 85, + "id": 84, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "2073:7:0", + "referencedDeclaration": 1640, + "src": "2054:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 98, + "id": 97, "isConstant": false, "isLValue": false, "isPure": false, @@ -1436,38 +1431,38 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2073:138:0", + "src": "2054:138:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 99, + "id": 98, "nodeType": "ExpressionStatement", - "src": "2073:138:0" + "src": "2054:138:0" }, { - "id": 100, + "id": 99, "nodeType": "PlaceholderStatement", - "src": "2221:1:0" + "src": "2202:1:0" } ] }, "documentation": null, - "id": 102, + "id": 101, "name": "hashlockMatches", "nodeType": "ModifierDefinition", "parameters": { - "id": 84, + "id": 83, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 81, + "id": 80, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 102, - "src": "2030:19:0", + "scope": 101, + "src": "2011:19:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1475,10 +1470,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 80, + "id": 79, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "2030:7:0", + "src": "2011:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -1489,11 +1484,11 @@ }, { "constant": false, - "id": 83, + "id": 82, "name": "_x", "nodeType": "VariableDeclaration", - "scope": 102, - "src": "2051:10:0", + "scope": 101, + "src": "2032:10:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1501,10 +1496,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 82, + "id": 81, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "2051:7:0", + "src": "2032:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -1514,16 +1509,16 @@ "visibility": "internal" } ], - "src": "2029:33:0" + "src": "2010:33:0" }, - "src": "2005:224:0", + "src": "1986:224:0", "visibility": "internal" }, { "body": { - "id": 138, + "id": 137, "nodeType": "Block", - "src": "2277:316:0", + "src": "2258:316:0", "statements": [ { "expression": { @@ -1532,10 +1527,10 @@ { "argumentTypes": null, "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, - "id": 113, + "id": 112, "isConstant": false, "isLValue": false, "isPure": false, @@ -1546,26 +1541,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 107, + "id": 106, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 190, - "src": "2295:9:0", + "referencedDeclaration": 189, + "src": "2276:9:0", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$41_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$40_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract storage ref)" } }, - "id": 109, + "id": 108, "indexExpression": { "argumentTypes": null, - "id": 108, + "id": 107, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 104, - "src": "2305:11:0", + "referencedDeclaration": 103, + "src": "2286:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -1576,24 +1571,24 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "2295:22:0", + "src": "2276:22:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage", + "typeIdentifier": "t_struct$_LockContract_$40_storage", "typeString": "struct HashedTimelock.LockContract storage ref" } }, - "id": 110, + "id": 109, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "receiver", "nodeType": "MemberAccess", - "referencedDeclaration": 28, - "src": "2295:31:0", + "referencedDeclaration": 27, + "src": "2276:31:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, "nodeType": "BinaryOperation", @@ -1602,18 +1597,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 111, + "id": 110, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "2330:3:0", + "referencedDeclaration": 1636, + "src": "2311:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 112, + "id": 111, "isConstant": false, "isLValue": false, "isPure": false, @@ -1621,13 +1616,13 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "2330:10:0", + "src": "2311:10:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, - "src": "2295:45:0", + "src": "2276:45:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -1636,14 +1631,14 @@ { "argumentTypes": null, "hexValue": "776974686472617761626c653a206e6f74207265636569766572", - "id": 114, + "id": 113, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2342:28:0", + "src": "2323:28:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_2996fe9bb22eca23c8f30e4ecaf6f5ab8925bbafce446942fa02db59ed0654ee", @@ -1663,21 +1658,21 @@ "typeString": "literal_string \"withdrawable: not receiver\"" } ], - "id": 106, + "id": 105, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "2287:7:0", + "referencedDeclaration": 1640, + "src": "2268:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 115, + "id": 114, "isConstant": false, "isLValue": false, "isPure": false, @@ -1685,15 +1680,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2287:84:0", + "src": "2268:84:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 116, + "id": 115, "nodeType": "ExpressionStatement", - "src": "2287:84:0" + "src": "2268:84:0" }, { "expression": { @@ -1705,7 +1700,7 @@ "typeIdentifier": "t_bool", "typeString": "bool" }, - "id": 123, + "id": 122, "isConstant": false, "isLValue": false, "isPure": false, @@ -1716,26 +1711,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 118, + "id": 117, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 190, - "src": "2389:9:0", + "referencedDeclaration": 189, + "src": "2370:9:0", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$41_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$40_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract storage ref)" } }, - "id": 120, + "id": 119, "indexExpression": { "argumentTypes": null, - "id": 119, + "id": 118, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 104, - "src": "2399:11:0", + "referencedDeclaration": 103, + "src": "2380:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -1746,21 +1741,21 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "2389:22:0", + "src": "2370:22:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage", + "typeIdentifier": "t_struct$_LockContract_$40_storage", "typeString": "struct HashedTimelock.LockContract storage ref" } }, - "id": 121, + "id": 120, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "withdrawn", "nodeType": "MemberAccess", - "referencedDeclaration": 36, - "src": "2389:32:0", + "referencedDeclaration": 35, + "src": "2370:32:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -1771,14 +1766,14 @@ "rightExpression": { "argumentTypes": null, "hexValue": "66616c7365", - "id": 122, + "id": 121, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "2425:5:0", + "src": "2406:5:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -1786,7 +1781,7 @@ }, "value": "false" }, - "src": "2389:41:0", + "src": "2370:41:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -1795,14 +1790,14 @@ { "argumentTypes": null, "hexValue": "776974686472617761626c653a20616c72656164792077697468647261776e", - "id": 124, + "id": 123, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2432:33:0", + "src": "2413:33:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_a7a1491df76b63b166fa25b3631de654587363606d31ccfadcdf86382f44f0da", @@ -1822,21 +1817,21 @@ "typeString": "literal_string \"withdrawable: already withdrawn\"" } ], - "id": 117, + "id": 116, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "2381:7:0", + "referencedDeclaration": 1640, + "src": "2362:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 125, + "id": 124, "isConstant": false, "isLValue": false, "isPure": false, @@ -1844,15 +1839,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2381:85:0", + "src": "2362:85:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 126, + "id": 125, "nodeType": "ExpressionStatement", - "src": "2381:85:0" + "src": "2362:85:0" }, { "expression": { @@ -1864,7 +1859,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 133, + "id": 132, "isConstant": false, "isLValue": false, "isPure": false, @@ -1875,26 +1870,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 128, + "id": 127, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 190, - "src": "2484:9:0", + "referencedDeclaration": 189, + "src": "2465:9:0", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$41_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$40_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract storage ref)" } }, - "id": 130, + "id": 129, "indexExpression": { "argumentTypes": null, - "id": 129, + "id": 128, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 104, - "src": "2494:11:0", + "referencedDeclaration": 103, + "src": "2475:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -1905,21 +1900,21 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "2484:22:0", + "src": "2465:22:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage", + "typeIdentifier": "t_struct$_LockContract_$40_storage", "typeString": "struct HashedTimelock.LockContract storage ref" } }, - "id": 131, + "id": 130, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "timelock", "nodeType": "MemberAccess", - "referencedDeclaration": 34, - "src": "2484:31:0", + "referencedDeclaration": 33, + "src": "2465:31:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1929,18 +1924,18 @@ "operator": ">", "rightExpression": { "argumentTypes": null, - "id": 132, + "id": 131, "name": "now", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1053, - "src": "2518:3:0", + "referencedDeclaration": 1638, + "src": "2499:3:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "2484:37:0", + "src": "2465:37:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -1949,14 +1944,14 @@ { "argumentTypes": null, "hexValue": "776974686472617761626c653a2074696d656c6f636b2074696d65206d75737420626520696e2074686520667574757265", - "id": 134, + "id": 133, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2523:51:0", + "src": "2504:51:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_f90a5049b744d27b4e847d49b0f3d774706fdfcfc2fa7fe6498583db4e9e564f", @@ -1976,21 +1971,21 @@ "typeString": "literal_string \"withdrawable: timelock time must be in the future\"" } ], - "id": 127, + "id": 126, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "2476:7:0", + "referencedDeclaration": 1640, + "src": "2457:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 135, + "id": 134, "isConstant": false, "isLValue": false, "isPure": false, @@ -1998,38 +1993,38 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2476:99:0", + "src": "2457:99:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 136, + "id": 135, "nodeType": "ExpressionStatement", - "src": "2476:99:0" + "src": "2457:99:0" }, { - "id": 137, + "id": 136, "nodeType": "PlaceholderStatement", - "src": "2585:1:0" + "src": "2566:1:0" } ] }, "documentation": null, - "id": 139, + "id": 138, "name": "withdrawable", "nodeType": "ModifierDefinition", "parameters": { - "id": 105, + "id": 104, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 104, + "id": 103, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 139, - "src": "2256:19:0", + "scope": 138, + "src": "2237:19:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -2037,10 +2032,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 103, + "id": 102, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "2256:7:0", + "src": "2237:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -2050,16 +2045,16 @@ "visibility": "internal" } ], - "src": "2255:21:0" + "src": "2236:21:0" }, - "src": "2234:359:0", + "src": "2215:359:0", "visibility": "internal" }, { "body": { - "id": 185, + "id": 184, "nodeType": "Block", - "src": "2639:386:0", + "src": "2620:386:0", "statements": [ { "expression": { @@ -2068,10 +2063,10 @@ { "argumentTypes": null, "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, - "id": 150, + "id": 149, "isConstant": false, "isLValue": false, "isPure": false, @@ -2082,26 +2077,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 144, + "id": 143, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 190, - "src": "2657:9:0", + "referencedDeclaration": 189, + "src": "2638:9:0", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$41_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$40_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract storage ref)" } }, - "id": 146, + "id": 145, "indexExpression": { "argumentTypes": null, - "id": 145, + "id": 144, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 141, - "src": "2667:11:0", + "referencedDeclaration": 140, + "src": "2648:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -2112,24 +2107,24 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "2657:22:0", + "src": "2638:22:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage", + "typeIdentifier": "t_struct$_LockContract_$40_storage", "typeString": "struct HashedTimelock.LockContract storage ref" } }, - "id": 147, + "id": 146, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", - "referencedDeclaration": 26, - "src": "2657:29:0", + "referencedDeclaration": 25, + "src": "2638:29:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, "nodeType": "BinaryOperation", @@ -2138,18 +2133,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 148, + "id": 147, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "2690:3:0", + "referencedDeclaration": 1636, + "src": "2671:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 149, + "id": 148, "isConstant": false, "isLValue": false, "isPure": false, @@ -2157,13 +2152,13 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "2690:10:0", + "src": "2671:10:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, - "src": "2657:43:0", + "src": "2638:43:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -2172,14 +2167,14 @@ { "argumentTypes": null, "hexValue": "726566756e6461626c653a206e6f742073656e646572", - "id": 151, + "id": 150, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2702:24:0", + "src": "2683:24:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_edd5bfdacb483bdf26b05ebe186281e97d155ca7c516ffe52d11b5e39d79c23a", @@ -2199,21 +2194,21 @@ "typeString": "literal_string \"refundable: not sender\"" } ], - "id": 143, + "id": 142, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "2649:7:0", + "referencedDeclaration": 1640, + "src": "2630:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 152, + "id": 151, "isConstant": false, "isLValue": false, "isPure": false, @@ -2221,15 +2216,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2649:78:0", + "src": "2630:78:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 153, + "id": 152, "nodeType": "ExpressionStatement", - "src": "2649:78:0" + "src": "2630:78:0" }, { "expression": { @@ -2241,7 +2236,7 @@ "typeIdentifier": "t_bool", "typeString": "bool" }, - "id": 160, + "id": 159, "isConstant": false, "isLValue": false, "isPure": false, @@ -2252,26 +2247,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 155, + "id": 154, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 190, - "src": "2745:9:0", + "referencedDeclaration": 189, + "src": "2726:9:0", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$41_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$40_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract storage ref)" } }, - "id": 157, + "id": 156, "indexExpression": { "argumentTypes": null, - "id": 156, + "id": 155, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 141, - "src": "2755:11:0", + "referencedDeclaration": 140, + "src": "2736:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -2282,21 +2277,21 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "2745:22:0", + "src": "2726:22:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage", + "typeIdentifier": "t_struct$_LockContract_$40_storage", "typeString": "struct HashedTimelock.LockContract storage ref" } }, - "id": 158, + "id": 157, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "refunded", "nodeType": "MemberAccess", - "referencedDeclaration": 38, - "src": "2745:31:0", + "referencedDeclaration": 37, + "src": "2726:31:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -2307,14 +2302,14 @@ "rightExpression": { "argumentTypes": null, "hexValue": "66616c7365", - "id": 159, + "id": 158, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "2780:5:0", + "src": "2761:5:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -2322,7 +2317,7 @@ }, "value": "false" }, - "src": "2745:40:0", + "src": "2726:40:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -2331,14 +2326,14 @@ { "argumentTypes": null, "hexValue": "726566756e6461626c653a20616c726561647920726566756e646564", - "id": 161, + "id": 160, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2787:30:0", + "src": "2768:30:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_7b29f51b209a34fdcf95e658d91750e2d1af4c6890c540f7ec9b6060ebd16007", @@ -2358,21 +2353,21 @@ "typeString": "literal_string \"refundable: already refunded\"" } ], - "id": 154, + "id": 153, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "2737:7:0", + "referencedDeclaration": 1640, + "src": "2718:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 162, + "id": 161, "isConstant": false, "isLValue": false, "isPure": false, @@ -2380,15 +2375,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2737:81:0", + "src": "2718:81:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 163, + "id": 162, "nodeType": "ExpressionStatement", - "src": "2737:81:0" + "src": "2718:81:0" }, { "expression": { @@ -2400,7 +2395,7 @@ "typeIdentifier": "t_bool", "typeString": "bool" }, - "id": 170, + "id": 169, "isConstant": false, "isLValue": false, "isPure": false, @@ -2411,26 +2406,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 165, + "id": 164, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 190, - "src": "2836:9:0", + "referencedDeclaration": 189, + "src": "2817:9:0", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$41_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$40_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract storage ref)" } }, - "id": 167, + "id": 166, "indexExpression": { "argumentTypes": null, - "id": 166, + "id": 165, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 141, - "src": "2846:11:0", + "referencedDeclaration": 140, + "src": "2827:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -2441,21 +2436,21 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "2836:22:0", + "src": "2817:22:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage", + "typeIdentifier": "t_struct$_LockContract_$40_storage", "typeString": "struct HashedTimelock.LockContract storage ref" } }, - "id": 168, + "id": 167, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "withdrawn", "nodeType": "MemberAccess", - "referencedDeclaration": 36, - "src": "2836:32:0", + "referencedDeclaration": 35, + "src": "2817:32:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -2466,14 +2461,14 @@ "rightExpression": { "argumentTypes": null, "hexValue": "66616c7365", - "id": 169, + "id": 168, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "2872:5:0", + "src": "2853:5:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -2481,7 +2476,7 @@ }, "value": "false" }, - "src": "2836:41:0", + "src": "2817:41:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -2490,14 +2485,14 @@ { "argumentTypes": null, "hexValue": "726566756e6461626c653a20616c72656164792077697468647261776e", - "id": 171, + "id": 170, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2879:31:0", + "src": "2860:31:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_3b5b42a6105acb76ce8eb8957616623bad95a1e8514f0d2809f4b82a9c3b0fce", @@ -2517,21 +2512,21 @@ "typeString": "literal_string \"refundable: already withdrawn\"" } ], - "id": 164, + "id": 163, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "2828:7:0", + "referencedDeclaration": 1640, + "src": "2809:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 172, + "id": 171, "isConstant": false, "isLValue": false, "isPure": false, @@ -2539,15 +2534,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2828:83:0", + "src": "2809:83:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 173, + "id": 172, "nodeType": "ExpressionStatement", - "src": "2828:83:0" + "src": "2809:83:0" }, { "expression": { @@ -2559,7 +2554,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 180, + "id": 179, "isConstant": false, "isLValue": false, "isPure": false, @@ -2570,26 +2565,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 175, + "id": 174, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 190, - "src": "2929:9:0", + "referencedDeclaration": 189, + "src": "2910:9:0", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$41_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$40_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract storage ref)" } }, - "id": 177, + "id": 176, "indexExpression": { "argumentTypes": null, - "id": 176, + "id": 175, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 141, - "src": "2939:11:0", + "referencedDeclaration": 140, + "src": "2920:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -2600,21 +2595,21 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "2929:22:0", + "src": "2910:22:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage", + "typeIdentifier": "t_struct$_LockContract_$40_storage", "typeString": "struct HashedTimelock.LockContract storage ref" } }, - "id": 178, + "id": 177, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "timelock", "nodeType": "MemberAccess", - "referencedDeclaration": 34, - "src": "2929:31:0", + "referencedDeclaration": 33, + "src": "2910:31:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -2624,18 +2619,18 @@ "operator": "<=", "rightExpression": { "argumentTypes": null, - "id": 179, + "id": 178, "name": "now", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1053, - "src": "2964:3:0", + "referencedDeclaration": 1638, + "src": "2945:3:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "2929:38:0", + "src": "2910:38:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -2644,14 +2639,14 @@ { "argumentTypes": null, "hexValue": "726566756e6461626c653a2074696d656c6f636b206e6f742079657420706173736564", - "id": 181, + "id": 180, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2969:37:0", + "src": "2950:37:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_53ffb24e93d3b349bff6339724d28c73880587cacedffccbcdea5da101fc50b9", @@ -2671,21 +2666,21 @@ "typeString": "literal_string \"refundable: timelock not yet passed\"" } ], - "id": 174, + "id": 173, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "2921:7:0", + "referencedDeclaration": 1640, + "src": "2902:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 182, + "id": 181, "isConstant": false, "isLValue": false, "isPure": false, @@ -2693,38 +2688,38 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2921:86:0", + "src": "2902:86:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 183, + "id": 182, "nodeType": "ExpressionStatement", - "src": "2921:86:0" + "src": "2902:86:0" }, { - "id": 184, + "id": 183, "nodeType": "PlaceholderStatement", - "src": "3017:1:0" + "src": "2998:1:0" } ] }, "documentation": null, - "id": 186, + "id": 185, "name": "refundable", "nodeType": "ModifierDefinition", "parameters": { - "id": 142, + "id": 141, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 141, + "id": 140, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 186, - "src": "2618:19:0", + "scope": 185, + "src": "2599:19:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -2732,10 +2727,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 140, + "id": 139, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "2618:7:0", + "src": "2599:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -2745,51 +2740,51 @@ "visibility": "internal" } ], - "src": "2617:21:0" + "src": "2598:21:0" }, - "src": "2598:427:0", + "src": "2579:427:0", "visibility": "internal" }, { "constant": false, - "id": 190, + "id": 189, "name": "contracts", "nodeType": "VariableDeclaration", - "scope": 425, - "src": "3031:43:0", + "scope": 437, + "src": "3012:43:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$41_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$40_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract)" }, "typeName": { - "id": 189, + "id": 188, "keyType": { - "id": 187, + "id": 186, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "3040:7:0", + "src": "3021:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "Mapping", - "src": "3031:33:0", + "src": "3012:33:0", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$41_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$40_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract)" }, "valueType": { "contractScope": null, - "id": 188, + "id": 187, "name": "LockContract", "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 41, - "src": "3051:12:0", + "referencedDeclaration": 40, + "src": "3032:12:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract" } } @@ -2799,26 +2794,26 @@ }, { "body": { - "id": 256, + "id": 255, "nodeType": "Block", - "src": "3773:869:0", + "src": "3762:869:0", "statements": [ { "expression": { "argumentTypes": null, - "id": 219, + "id": 218, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, - "id": 206, + "id": 205, "name": "contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "3783:10:0", + "referencedDeclaration": 203, + "src": "3772:10:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -2836,18 +2831,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 210, + "id": 209, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "3850:3:0", + "referencedDeclaration": 1636, + "src": "3839:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 211, + "id": 210, "isConstant": false, "isLValue": false, "isPure": false, @@ -2855,41 +2850,41 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "3850:10:0", + "src": "3839:10:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, { "argumentTypes": null, - "id": 212, + "id": 211, "name": "_receiver", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 192, - "src": "3878:9:0", + "referencedDeclaration": 191, + "src": "3867:9:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, { "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 213, + "id": 212, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "3905:3:0", + "referencedDeclaration": 1636, + "src": "3894:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 214, + "id": 213, "isConstant": false, "isLValue": false, "isPure": false, @@ -2897,7 +2892,7 @@ "memberName": "value", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "3905:9:0", + "src": "3894:9:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -2905,12 +2900,12 @@ }, { "argumentTypes": null, - "id": 215, + "id": 214, "name": "_hashlock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 194, - "src": "3932:9:0", + "referencedDeclaration": 193, + "src": "3921:9:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -2918,12 +2913,12 @@ }, { "argumentTypes": null, - "id": 216, + "id": 215, "name": "_timelock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 196, - "src": "3959:9:0", + "referencedDeclaration": 195, + "src": "3948:9:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -2933,12 +2928,12 @@ "expression": { "argumentTypes": [ { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, { "typeIdentifier": "t_uint256", @@ -2955,18 +2950,18 @@ ], "expression": { "argumentTypes": null, - "id": 208, + "id": 207, "name": "abi", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1038, - "src": "3816:3:0", + "referencedDeclaration": 1623, + "src": "3805:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_abi", "typeString": "abi" } }, - "id": 209, + "id": 208, "isConstant": false, "isLValue": false, "isPure": true, @@ -2974,13 +2969,13 @@ "memberName": "encodePacked", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "3816:16:0", + "src": "3805:16:0", "typeDescriptions": { "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", "typeString": "function () pure returns (bytes memory)" } }, - "id": 217, + "id": 216, "isConstant": false, "isLValue": false, "isPure": false, @@ -2988,7 +2983,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "3816:166:0", + "src": "3805:166:0", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" @@ -3002,18 +2997,18 @@ "typeString": "bytes memory" } ], - "id": 207, + "id": 206, "name": "sha256", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1060, - "src": "3796:6:0", + "referencedDeclaration": 1645, + "src": "3785:6:0", "typeDescriptions": { - "typeIdentifier": "t_function_sha256_pure$__$returns$_t_bytes32_$", - "typeString": "function () pure returns (bytes32)" + "typeIdentifier": "t_function_sha256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" } }, - "id": 218, + "id": 217, "isConstant": false, "isLValue": false, "isPure": false, @@ -3021,21 +3016,21 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "3796:196:0", + "src": "3785:196:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "src": "3783:209:0", + "src": "3772:209:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "id": 220, + "id": 219, "nodeType": "ExpressionStatement", - "src": "3783:209:0" + "src": "3772:209:0" }, { "condition": { @@ -3043,12 +3038,12 @@ "arguments": [ { "argumentTypes": null, - "id": 222, + "id": 221, "name": "contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "4198:10:0", + "referencedDeclaration": 203, + "src": "4187:10:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -3062,18 +3057,18 @@ "typeString": "bytes32" } ], - "id": 221, + "id": 220, "name": "haveContract", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 424, - "src": "4185:12:0", + "referencedDeclaration": 436, + "src": "4174:12:0", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bool_$", "typeString": "function (bytes32) view returns (bool)" } }, - "id": 223, + "id": 222, "isConstant": false, "isLValue": false, "isPure": false, @@ -3081,37 +3076,37 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "4185:24:0", + "src": "4174:24:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, - "id": 227, + "id": 226, "nodeType": "IfStatement", - "src": "4181:50:0", + "src": "4170:50:0", "trueBody": { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], - "id": 224, + "id": 223, "name": "revert", "nodeType": "Identifier", "overloadedDeclarations": [ - 1056, - 1057 + 1641, + 1642 ], - "referencedDeclaration": 1056, - "src": "4223:6:0", + "referencedDeclaration": 1641, + "src": "4212:6:0", "typeDescriptions": { "typeIdentifier": "t_function_revert_pure$__$returns$__$", "typeString": "function () pure" } }, - "id": 225, + "id": 224, "isConstant": false, "isLValue": false, "isPure": false, @@ -3119,21 +3114,21 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "4223:8:0", + "src": "4212:8:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 226, + "id": 225, "nodeType": "ExpressionStatement", - "src": "4223:8:0" + "src": "4212:8:0" } }, { "expression": { "argumentTypes": null, - "id": 243, + "id": 242, "isConstant": false, "isLValue": false, "isPure": false, @@ -3142,26 +3137,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 228, + "id": 227, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 190, - "src": "4242:9:0", + "referencedDeclaration": 189, + "src": "4231:9:0", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$41_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$40_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract storage ref)" } }, - "id": 230, + "id": 229, "indexExpression": { "argumentTypes": null, - "id": 229, + "id": 228, "name": "contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "4252:10:0", + "referencedDeclaration": 203, + "src": "4241:10:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -3172,9 +3167,9 @@ "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", - "src": "4242:21:0", + "src": "4231:21:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage", + "typeIdentifier": "t_struct$_LockContract_$40_storage", "typeString": "struct HashedTimelock.LockContract storage ref" } }, @@ -3187,18 +3182,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 232, + "id": 231, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "4292:3:0", + "referencedDeclaration": 1636, + "src": "4281:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 233, + "id": 232, "isConstant": false, "isLValue": false, "isPure": false, @@ -3206,41 +3201,41 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "4292:10:0", + "src": "4281:10:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, { "argumentTypes": null, - "id": 234, + "id": 233, "name": "_receiver", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 192, - "src": "4316:9:0", + "referencedDeclaration": 191, + "src": "4305:9:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, { "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 235, + "id": 234, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "4339:3:0", + "referencedDeclaration": 1636, + "src": "4328:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 236, + "id": 235, "isConstant": false, "isLValue": false, "isPure": false, @@ -3248,7 +3243,7 @@ "memberName": "value", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "4339:9:0", + "src": "4328:9:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3256,12 +3251,12 @@ }, { "argumentTypes": null, - "id": 237, + "id": 236, "name": "_hashlock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 194, - "src": "4362:9:0", + "referencedDeclaration": 193, + "src": "4351:9:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -3269,12 +3264,12 @@ }, { "argumentTypes": null, - "id": 238, + "id": 237, "name": "_timelock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 196, - "src": "4385:9:0", + "referencedDeclaration": 195, + "src": "4374:9:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3283,14 +3278,14 @@ { "argumentTypes": null, "hexValue": "66616c7365", - "id": 239, + "id": 238, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "4408:5:0", + "src": "4397:5:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -3301,14 +3296,14 @@ { "argumentTypes": null, "hexValue": "66616c7365", - "id": 240, + "id": 239, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "4427:5:0", + "src": "4416:5:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -3319,14 +3314,14 @@ { "argumentTypes": null, "hexValue": "307830", - "id": 241, + "id": 240, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "4446:3:0", + "src": "4435:3:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", @@ -3338,12 +3333,12 @@ "expression": { "argumentTypes": [ { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, { "typeIdentifier": "t_uint256", @@ -3370,18 +3365,18 @@ "typeString": "int_const 0" } ], - "id": 231, + "id": 230, "name": "LockContract", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 41, - "src": "4266:12:0", + "referencedDeclaration": 40, + "src": "4255:12:0", "typeDescriptions": { - "typeIdentifier": "t_type$_t_struct$_LockContract_$41_storage_ptr_$", + "typeIdentifier": "t_type$_t_struct$_LockContract_$40_storage_ptr_$", "typeString": "type(struct HashedTimelock.LockContract storage pointer)" } }, - "id": 242, + "id": 241, "isConstant": false, "isLValue": false, "isPure": false, @@ -3389,21 +3384,21 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "4266:193:0", + "src": "4255:193:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_memory", + "typeIdentifier": "t_struct$_LockContract_$40_memory", "typeString": "struct HashedTimelock.LockContract memory" } }, - "src": "4242:217:0", + "src": "4231:217:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage", + "typeIdentifier": "t_struct$_LockContract_$40_storage", "typeString": "struct HashedTimelock.LockContract storage ref" } }, - "id": 244, + "id": 243, "nodeType": "ExpressionStatement", - "src": "4242:217:0" + "src": "4231:217:0" }, { "eventCall": { @@ -3411,12 +3406,12 @@ "arguments": [ { "argumentTypes": null, - "id": 246, + "id": 245, "name": "contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "4499:10:0", + "referencedDeclaration": 203, + "src": "4488:10:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -3426,18 +3421,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 247, + "id": 246, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "4523:3:0", + "referencedDeclaration": 1636, + "src": "4512:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 248, + "id": 247, "isConstant": false, "isLValue": false, "isPure": false, @@ -3445,41 +3440,41 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "4523:10:0", + "src": "4512:10:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, { "argumentTypes": null, - "id": 249, + "id": 248, "name": "_receiver", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 192, - "src": "4547:9:0", + "referencedDeclaration": 191, + "src": "4536:9:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, { "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 250, + "id": 249, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "4570:3:0", + "referencedDeclaration": 1636, + "src": "4559:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 251, + "id": 250, "isConstant": false, "isLValue": false, "isPure": false, @@ -3487,7 +3482,7 @@ "memberName": "value", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "4570:9:0", + "src": "4559:9:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3495,12 +3490,12 @@ }, { "argumentTypes": null, - "id": 252, + "id": 251, "name": "_hashlock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 194, - "src": "4593:9:0", + "referencedDeclaration": 193, + "src": "4582:9:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -3508,12 +3503,12 @@ }, { "argumentTypes": null, - "id": 253, + "id": 252, "name": "_timelock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 196, - "src": "4616:9:0", + "referencedDeclaration": 195, + "src": "4605:9:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3527,12 +3522,12 @@ "typeString": "bytes32" }, { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, { "typeIdentifier": "t_uint256", @@ -3547,18 +3542,18 @@ "typeString": "uint256" } ], - "id": 245, + "id": 244, "name": "LogHTLCNew", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 16, - "src": "4475:10:0", + "referencedDeclaration": 15, + "src": "4464:10:0", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_address_$_t_uint256_$_t_bytes32_$_t_uint256_$returns$__$", "typeString": "function (bytes32,address,address,uint256,bytes32,uint256)" } }, - "id": 254, + "id": 253, "isConstant": false, "isLValue": false, "isPure": false, @@ -3566,104 +3561,104 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "4475:160:0", + "src": "4464:160:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 255, + "id": 254, "nodeType": "EmitStatement", - "src": "4470:165:0" + "src": "4459:165:0" } ] }, "documentation": "@dev Sender sets up a new hash time lock contract depositing the ETH and \nproviding the reciever lock terms.\n * @param _receiver Receiver of the ETH.\n@param _hashlock A sha-2 sha256 hash hashlock.\n@param _timelock UNIX epoch seconds time that the lock expires at. \n Refunds can be made after this time.\n@return contractId Id of the new HTLC. This is needed for subsequent \n calls.", - "id": 257, + "id": 256, "implemented": true, - "isConstructor": false, - "isDeclaredConst": false, + "kind": "function", "modifiers": [ { "arguments": null, - "id": 199, + "id": 198, "modifierName": { "argumentTypes": null, - "id": 198, + "id": 197, "name": "fundsSent", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "3688:9:0", + "referencedDeclaration": 52, + "src": "3677:9:0", "typeDescriptions": { "typeIdentifier": "t_modifier$__$", "typeString": "modifier ()" } }, "nodeType": "ModifierInvocation", - "src": "3688:9:0" + "src": "3677:9:0" }, { "arguments": [ { "argumentTypes": null, - "id": 201, + "id": 200, "name": "_timelock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 196, - "src": "3721:9:0", + "referencedDeclaration": 195, + "src": "3710:9:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], - "id": 202, + "id": 201, "modifierName": { "argumentTypes": null, - "id": 200, + "id": 199, "name": "futureTimelock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 66, - "src": "3706:14:0", + "referencedDeclaration": 65, + "src": "3695:14:0", "typeDescriptions": { "typeIdentifier": "t_modifier$_t_uint256_$", "typeString": "modifier (uint256)" } }, "nodeType": "ModifierInvocation", - "src": "3706:25:0" + "src": "3695:25:0" } ], "name": "newContract", "nodeType": "FunctionDefinition", "parameters": { - "id": 197, + "id": 196, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 192, + "id": 191, "name": "_receiver", "nodeType": "VariableDeclaration", - "scope": 257, - "src": "3593:17:0", + "scope": 256, + "src": "3574:25:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, "typeName": { - "id": 191, + "id": 190, "name": "address", "nodeType": "ElementaryTypeName", - "src": "3593:7:0", + "src": "3574:15:0", + "stateMutability": "payable", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, "value": null, @@ -3671,11 +3666,11 @@ }, { "constant": false, - "id": 194, + "id": 193, "name": "_hashlock", "nodeType": "VariableDeclaration", - "scope": 257, - "src": "3612:17:0", + "scope": 256, + "src": "3601:17:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -3683,10 +3678,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 193, + "id": 192, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "3612:7:0", + "src": "3601:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -3697,11 +3692,11 @@ }, { "constant": false, - "id": 196, + "id": 195, "name": "_timelock", "nodeType": "VariableDeclaration", - "scope": 257, - "src": "3631:14:0", + "scope": 256, + "src": "3620:14:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -3709,10 +3704,10 @@ "typeString": "uint256" }, "typeName": { - "id": 195, + "id": 194, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "3631:4:0", + "src": "3620:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3722,20 +3717,19 @@ "visibility": "internal" } ], - "src": "3592:54:0" + "src": "3573:62:0" }, - "payable": true, "returnParameters": { - "id": 205, + "id": 204, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 204, + "id": 203, "name": "contractId", "nodeType": "VariableDeclaration", - "scope": 257, - "src": "3749:18:0", + "scope": 256, + "src": "3738:18:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -3743,10 +3737,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 203, + "id": 202, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "3749:7:0", + "src": "3738:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -3756,47 +3750,47 @@ "visibility": "internal" } ], - "src": "3748:20:0" + "src": "3737:20:0" }, - "scope": 425, - "src": "3572:1070:0", + "scope": 437, + "src": "3553:1078:0", "stateMutability": "payable", "superFunction": null, "visibility": "external" }, { "body": { - "id": 309, + "id": 308, "nodeType": "Block", - "src": "5188:227:0", + "src": "5177:227:0", "statements": [ { "assignments": [ - 277 + 276 ], "declarations": [ { "constant": false, - "id": 277, + "id": 276, "name": "c", "nodeType": "VariableDeclaration", - "scope": 309, - "src": "5198:22:0", + "scope": 308, + "src": "5187:22:0", "stateVariable": false, "storageLocation": "storage", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract" }, "typeName": { "contractScope": null, - "id": 276, + "id": 275, "name": "LockContract", "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 41, - "src": "5198:12:0", + "referencedDeclaration": 40, + "src": "5187:12:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract" } }, @@ -3804,31 +3798,31 @@ "visibility": "internal" } ], - "id": 281, + "id": 280, "initialValue": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 278, + "id": 277, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 190, - "src": "5223:9:0", + "referencedDeclaration": 189, + "src": "5212:9:0", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$41_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$40_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract storage ref)" } }, - "id": 280, + "id": 279, "indexExpression": { "argumentTypes": null, - "id": 279, + "id": 278, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 259, - "src": "5233:11:0", + "referencedDeclaration": 258, + "src": "5222:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -3839,19 +3833,19 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "5223:22:0", + "src": "5212:22:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage", + "typeIdentifier": "t_struct$_LockContract_$40_storage", "typeString": "struct HashedTimelock.LockContract storage ref" } }, "nodeType": "VariableDeclarationStatement", - "src": "5198:47:0" + "src": "5187:47:0" }, { "expression": { "argumentTypes": null, - "id": 286, + "id": 285, "isConstant": false, "isLValue": false, "isPure": false, @@ -3860,26 +3854,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 282, + "id": 281, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 277, - "src": "5255:1:0", + "referencedDeclaration": 276, + "src": "5244:1:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract storage pointer" } }, - "id": 284, + "id": 283, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "memberName": "preimage", "nodeType": "MemberAccess", - "referencedDeclaration": 40, - "src": "5255:10:0", + "referencedDeclaration": 39, + "src": "5244:10:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -3889,31 +3883,31 @@ "operator": "=", "rightHandSide": { "argumentTypes": null, - "id": 285, + "id": 284, "name": "_preimage", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "5268:9:0", + "referencedDeclaration": 260, + "src": "5257:9:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "src": "5255:22:0", + "src": "5244:22:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "id": 287, + "id": 286, "nodeType": "ExpressionStatement", - "src": "5255:22:0" + "src": "5244:22:0" }, { "expression": { "argumentTypes": null, - "id": 292, + "id": 291, "isConstant": false, "isLValue": false, "isPure": false, @@ -3922,26 +3916,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 288, + "id": 287, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 277, - "src": "5287:1:0", + "referencedDeclaration": 276, + "src": "5276:1:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract storage pointer" } }, - "id": 290, + "id": 289, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "memberName": "withdrawn", "nodeType": "MemberAccess", - "referencedDeclaration": 36, - "src": "5287:11:0", + "referencedDeclaration": 35, + "src": "5276:11:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -3952,14 +3946,14 @@ "rightHandSide": { "argumentTypes": null, "hexValue": "74727565", - "id": 291, + "id": 290, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "5301:4:0", + "src": "5290:4:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -3967,15 +3961,15 @@ }, "value": "true" }, - "src": "5287:18:0", + "src": "5276:18:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "id": 293, + "id": 292, "nodeType": "ExpressionStatement", - "src": "5287:18:0" + "src": "5276:18:0" }, { "expression": { @@ -3985,26 +3979,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 299, + "id": 298, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 277, - "src": "5335:1:0", + "referencedDeclaration": 276, + "src": "5324:1:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract storage pointer" } }, - "id": 300, + "id": 299, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "amount", "nodeType": "MemberAccess", - "referencedDeclaration": 30, - "src": "5335:8:0", + "referencedDeclaration": 29, + "src": "5324:8:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -4022,32 +4016,32 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 294, + "id": 293, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 277, - "src": "5315:1:0", + "referencedDeclaration": 276, + "src": "5304:1:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract storage pointer" } }, - "id": 297, + "id": 296, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "receiver", "nodeType": "MemberAccess", - "referencedDeclaration": 28, - "src": "5315:10:0", + "referencedDeclaration": 27, + "src": "5304:10:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, - "id": 298, + "id": 297, "isConstant": false, "isLValue": false, "isPure": false, @@ -4055,13 +4049,13 @@ "memberName": "transfer", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "5315:19:0", + "src": "5304:19:0", "typeDescriptions": { "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", "typeString": "function (uint256)" } }, - "id": 301, + "id": 300, "isConstant": false, "isLValue": false, "isPure": false, @@ -4069,15 +4063,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "5315:29:0", + "src": "5304:29:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 302, + "id": 301, "nodeType": "ExpressionStatement", - "src": "5315:29:0" + "src": "5304:29:0" }, { "eventCall": { @@ -4085,12 +4079,12 @@ "arguments": [ { "argumentTypes": null, - "id": 304, + "id": 303, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 259, - "src": "5375:11:0", + "referencedDeclaration": 258, + "src": "5364:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -4104,18 +4098,18 @@ "typeString": "bytes32" } ], - "id": 303, + "id": 302, "name": "LogHTLCWithdraw", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "5359:15:0", + "referencedDeclaration": 19, + "src": "5348:15:0", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$returns$__$", "typeString": "function (bytes32)" } }, - "id": 305, + "id": 304, "isConstant": false, "isLValue": false, "isPure": false, @@ -4123,28 +4117,28 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "5359:28:0", + "src": "5348:28:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 306, + "id": 305, "nodeType": "EmitStatement", - "src": "5354:33:0" + "src": "5343:33:0" }, { "expression": { "argumentTypes": null, "hexValue": "74727565", - "id": 307, + "id": 306, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "5404:4:0", + "src": "5393:4:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -4152,62 +4146,61 @@ }, "value": "true" }, - "functionReturnParameters": 275, - "id": 308, + "functionReturnParameters": 274, + "id": 307, "nodeType": "Return", - "src": "5397:11:0" + "src": "5386:11:0" } ] }, "documentation": "@dev Called by the receiver once they know the preimage of the hashlock.\nThis will transfer the locked funds to their address.\n * @param _contractId Id of the HTLC.\n@param _preimage sha256(_preimage) should equal the contract hashlock.\n@return bool true on success", - "id": 310, + "id": 309, "implemented": true, - "isConstructor": false, - "isDeclaredConst": false, + "kind": "function", "modifiers": [ { "arguments": [ { "argumentTypes": null, - "id": 264, + "id": 263, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 259, - "src": "5066:11:0", + "referencedDeclaration": 258, + "src": "5055:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], - "id": 265, + "id": 264, "modifierName": { "argumentTypes": null, - "id": 263, + "id": 262, "name": "contractExists", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "5051:14:0", + "referencedDeclaration": 78, + "src": "5040:14:0", "typeDescriptions": { "typeIdentifier": "t_modifier$_t_bytes32_$", "typeString": "modifier (bytes32)" } }, "nodeType": "ModifierInvocation", - "src": "5051:27:0" + "src": "5040:27:0" }, { "arguments": [ { "argumentTypes": null, - "id": 267, + "id": 266, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 259, - "src": "5103:11:0", + "referencedDeclaration": 258, + "src": "5092:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -4215,82 +4208,82 @@ }, { "argumentTypes": null, - "id": 268, + "id": 267, "name": "_preimage", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "5116:9:0", + "referencedDeclaration": 260, + "src": "5105:9:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], - "id": 269, + "id": 268, "modifierName": { "argumentTypes": null, - "id": 266, + "id": 265, "name": "hashlockMatches", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 102, - "src": "5087:15:0", + "referencedDeclaration": 101, + "src": "5076:15:0", "typeDescriptions": { "typeIdentifier": "t_modifier$_t_bytes32_$_t_bytes32_$", "typeString": "modifier (bytes32,bytes32)" } }, "nodeType": "ModifierInvocation", - "src": "5087:39:0" + "src": "5076:39:0" }, { "arguments": [ { "argumentTypes": null, - "id": 271, + "id": 270, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 259, - "src": "5148:11:0", + "referencedDeclaration": 258, + "src": "5137:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], - "id": 272, + "id": 271, "modifierName": { "argumentTypes": null, - "id": 270, + "id": 269, "name": "withdrawable", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 139, - "src": "5135:12:0", + "referencedDeclaration": 138, + "src": "5124:12:0", "typeDescriptions": { "typeIdentifier": "t_modifier$_t_bytes32_$", "typeString": "modifier (bytes32)" } }, "nodeType": "ModifierInvocation", - "src": "5135:25:0" + "src": "5124:25:0" } ], "name": "withdraw", "nodeType": "FunctionDefinition", "parameters": { - "id": 262, + "id": 261, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 259, + "id": 258, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 310, - "src": "4986:19:0", + "scope": 309, + "src": "4975:19:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -4298,10 +4291,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 258, + "id": 257, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "4986:7:0", + "src": "4975:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -4312,11 +4305,11 @@ }, { "constant": false, - "id": 261, + "id": 260, "name": "_preimage", "nodeType": "VariableDeclaration", - "scope": 310, - "src": "5007:17:0", + "scope": 309, + "src": "4996:17:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -4324,10 +4317,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 260, + "id": 259, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "5007:7:0", + "src": "4996:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -4337,20 +4330,19 @@ "visibility": "internal" } ], - "src": "4985:40:0" + "src": "4974:40:0" }, - "payable": false, "returnParameters": { - "id": 275, + "id": 274, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 274, + "id": 273, "name": "", "nodeType": "VariableDeclaration", - "scope": 310, - "src": "5178:4:0", + "scope": 309, + "src": "5167:4:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -4358,10 +4350,10 @@ "typeString": "bool" }, "typeName": { - "id": 273, + "id": 272, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "5178:4:0", + "src": "5167:4:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -4371,47 +4363,47 @@ "visibility": "internal" } ], - "src": "5177:6:0" + "src": "5166:6:0" }, - "scope": 425, - "src": "4968:447:0", + "scope": 437, + "src": "4957:447:0", "stateMutability": "nonpayable", "superFunction": null, "visibility": "external" }, { "body": { - "id": 350, + "id": 349, "nodeType": "Block", - "src": "5816:190:0", + "src": "5805:190:0", "statements": [ { "assignments": [ - 324 + 323 ], "declarations": [ { "constant": false, - "id": 324, + "id": 323, "name": "c", "nodeType": "VariableDeclaration", - "scope": 350, - "src": "5826:22:0", + "scope": 349, + "src": "5815:22:0", "stateVariable": false, "storageLocation": "storage", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract" }, "typeName": { "contractScope": null, - "id": 323, + "id": 322, "name": "LockContract", "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 41, - "src": "5826:12:0", + "referencedDeclaration": 40, + "src": "5815:12:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract" } }, @@ -4419,31 +4411,31 @@ "visibility": "internal" } ], - "id": 328, + "id": 327, "initialValue": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 325, + "id": 324, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 190, - "src": "5851:9:0", + "referencedDeclaration": 189, + "src": "5840:9:0", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$41_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$40_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract storage ref)" } }, - "id": 327, + "id": 326, "indexExpression": { "argumentTypes": null, - "id": 326, + "id": 325, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 312, - "src": "5861:11:0", + "referencedDeclaration": 311, + "src": "5850:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -4454,19 +4446,19 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "5851:22:0", + "src": "5840:22:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage", + "typeIdentifier": "t_struct$_LockContract_$40_storage", "typeString": "struct HashedTimelock.LockContract storage ref" } }, "nodeType": "VariableDeclarationStatement", - "src": "5826:47:0" + "src": "5815:47:0" }, { "expression": { "argumentTypes": null, - "id": 333, + "id": 332, "isConstant": false, "isLValue": false, "isPure": false, @@ -4475,26 +4467,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 329, + "id": 328, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 324, - "src": "5883:1:0", + "referencedDeclaration": 323, + "src": "5872:1:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract storage pointer" } }, - "id": 331, + "id": 330, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "memberName": "refunded", "nodeType": "MemberAccess", - "referencedDeclaration": 38, - "src": "5883:10:0", + "referencedDeclaration": 37, + "src": "5872:10:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -4505,14 +4497,14 @@ "rightHandSide": { "argumentTypes": null, "hexValue": "74727565", - "id": 332, + "id": 331, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "5896:4:0", + "src": "5885:4:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -4520,15 +4512,15 @@ }, "value": "true" }, - "src": "5883:17:0", + "src": "5872:17:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "id": 334, + "id": 333, "nodeType": "ExpressionStatement", - "src": "5883:17:0" + "src": "5872:17:0" }, { "expression": { @@ -4538,26 +4530,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 340, + "id": 339, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 324, - "src": "5928:1:0", + "referencedDeclaration": 323, + "src": "5917:1:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract storage pointer" } }, - "id": 341, + "id": 340, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "amount", "nodeType": "MemberAccess", - "referencedDeclaration": 30, - "src": "5928:8:0", + "referencedDeclaration": 29, + "src": "5917:8:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -4575,32 +4567,32 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 335, + "id": 334, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 324, - "src": "5910:1:0", + "referencedDeclaration": 323, + "src": "5899:1:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract storage pointer" } }, - "id": 338, + "id": 337, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", - "referencedDeclaration": 26, - "src": "5910:8:0", + "referencedDeclaration": 25, + "src": "5899:8:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, - "id": 339, + "id": 338, "isConstant": false, "isLValue": false, "isPure": false, @@ -4608,13 +4600,13 @@ "memberName": "transfer", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "5910:17:0", + "src": "5899:17:0", "typeDescriptions": { "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", "typeString": "function (uint256)" } }, - "id": 342, + "id": 341, "isConstant": false, "isLValue": false, "isPure": false, @@ -4622,15 +4614,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "5910:27:0", + "src": "5899:27:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 343, + "id": 342, "nodeType": "ExpressionStatement", - "src": "5910:27:0" + "src": "5899:27:0" }, { "eventCall": { @@ -4638,12 +4630,12 @@ "arguments": [ { "argumentTypes": null, - "id": 345, + "id": 344, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 312, - "src": "5966:11:0", + "referencedDeclaration": 311, + "src": "5955:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -4657,18 +4649,18 @@ "typeString": "bytes32" } ], - "id": 344, + "id": 343, "name": "LogHTLCRefund", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 24, - "src": "5952:13:0", + "referencedDeclaration": 23, + "src": "5941:13:0", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$returns$__$", "typeString": "function (bytes32)" } }, - "id": 346, + "id": 345, "isConstant": false, "isLValue": false, "isPure": false, @@ -4676,28 +4668,28 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "5952:26:0", + "src": "5941:26:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 347, + "id": 346, "nodeType": "EmitStatement", - "src": "5947:31:0" + "src": "5936:31:0" }, { "expression": { "argumentTypes": null, "hexValue": "74727565", - "id": 348, + "id": 347, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "5995:4:0", + "src": "5984:4:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -4705,99 +4697,98 @@ }, "value": "true" }, - "functionReturnParameters": 322, - "id": 349, + "functionReturnParameters": 321, + "id": 348, "nodeType": "Return", - "src": "5988:11:0" + "src": "5977:11:0" } ] }, "documentation": "@dev Called by the sender if there was no withdraw AND the time lock has\nexpired. This will refund the contract amount.\n * @param _contractId Id of HTLC to refund from.\n@return bool true on success", - "id": 351, + "id": 350, "implemented": true, - "isConstructor": false, - "isDeclaredConst": false, + "kind": "function", "modifiers": [ { "arguments": [ { "argumentTypes": null, - "id": 315, + "id": 314, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 312, - "src": "5744:11:0", + "referencedDeclaration": 311, + "src": "5733:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], - "id": 316, + "id": 315, "modifierName": { "argumentTypes": null, - "id": 314, + "id": 313, "name": "contractExists", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "5729:14:0", + "referencedDeclaration": 78, + "src": "5718:14:0", "typeDescriptions": { "typeIdentifier": "t_modifier$_t_bytes32_$", "typeString": "modifier (bytes32)" } }, "nodeType": "ModifierInvocation", - "src": "5729:27:0" + "src": "5718:27:0" }, { "arguments": [ { "argumentTypes": null, - "id": 318, + "id": 317, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 312, - "src": "5776:11:0", + "referencedDeclaration": 311, + "src": "5765:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], - "id": 319, + "id": 318, "modifierName": { "argumentTypes": null, - "id": 317, + "id": 316, "name": "refundable", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 186, - "src": "5765:10:0", + "referencedDeclaration": 185, + "src": "5754:10:0", "typeDescriptions": { "typeIdentifier": "t_modifier$_t_bytes32_$", "typeString": "modifier (bytes32)" } }, "nodeType": "ModifierInvocation", - "src": "5765:23:0" + "src": "5754:23:0" } ], "name": "refund", "nodeType": "FunctionDefinition", "parameters": { - "id": 313, + "id": 312, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 312, + "id": 311, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 351, - "src": "5683:19:0", + "scope": 350, + "src": "5672:19:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -4805,10 +4796,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 311, + "id": 310, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "5683:7:0", + "src": "5672:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -4818,20 +4809,19 @@ "visibility": "internal" } ], - "src": "5682:21:0" + "src": "5671:21:0" }, - "payable": false, "returnParameters": { - "id": 322, + "id": 321, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 321, + "id": 320, "name": "", "nodeType": "VariableDeclaration", - "scope": 351, - "src": "5806:4:0", + "scope": 350, + "src": "5795:4:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -4839,10 +4829,10 @@ "typeString": "bool" }, "typeName": { - "id": 320, + "id": 319, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "5806:4:0", + "src": "5795:4:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -4852,19 +4842,19 @@ "visibility": "internal" } ], - "src": "5805:6:0" + "src": "5794:6:0" }, - "scope": 425, - "src": "5667:339:0", + "scope": 437, + "src": "5656:339:0", "stateMutability": "nonpayable", "superFunction": null, "visibility": "external" }, { "body": { - "id": 403, + "id": 415, "nodeType": "Block", - "src": "6505:258:0", + "src": "6494:309:0", "statements": [ { "condition": { @@ -4873,7 +4863,7 @@ "typeIdentifier": "t_bool", "typeString": "bool" }, - "id": 376, + "id": 375, "isConstant": false, "isLValue": false, "isPure": false, @@ -4883,12 +4873,12 @@ "arguments": [ { "argumentTypes": null, - "id": 373, + "id": 372, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 353, - "src": "6532:11:0", + "referencedDeclaration": 352, + "src": "6521:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -4902,18 +4892,18 @@ "typeString": "bytes32" } ], - "id": 372, + "id": 371, "name": "haveContract", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 424, - "src": "6519:12:0", + "referencedDeclaration": 436, + "src": "6508:12:0", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bool_$", "typeString": "function (bytes32) view returns (bool)" } }, - "id": 374, + "id": 373, "isConstant": false, "isLValue": false, "isPure": false, @@ -4921,7 +4911,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "6519:25:0", + "src": "6508:25:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -4932,14 +4922,14 @@ "rightExpression": { "argumentTypes": null, "hexValue": "66616c7365", - "id": 375, + "id": 374, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "6548:5:0", + "src": "6537:5:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -4947,188 +4937,424 @@ }, "value": "false" }, - "src": "6519:34:0", + "src": "6508:34:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, - "id": 378, + "id": 390, "nodeType": "IfStatement", - "src": "6515:59:0", + "src": "6504:109:0", "trueBody": { - "expression": null, - "functionReturnParameters": 371, - "id": 377, - "nodeType": "Return", - "src": "6567:7:0" - } - }, - { - "assignments": [ - 380 - ], - "declarations": [ - { - "constant": false, - "id": 380, - "name": "c", - "nodeType": "VariableDeclaration", - "scope": 403, - "src": "6583:22:0", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", - "typeString": "struct HashedTimelock.LockContract" - }, - "typeName": { - "contractScope": null, - "id": 379, - "name": "LockContract", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 41, - "src": "6583:12:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", - "typeString": "struct HashedTimelock.LockContract" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 384, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 381, - "name": "contracts", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 190, - "src": "6608:9:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$41_storage_$", - "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract storage ref)" - } - }, - "id": 383, - "indexExpression": { + "expression": { "argumentTypes": null, - "id": 382, - "name": "_contractId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 353, - "src": "6618:11:0", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6608:22:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage", - "typeString": "struct HashedTimelock.LockContract storage ref" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "6583:47:0" - }, - { - "expression": { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "expression": { + "components": [ + { "argumentTypes": null, - "id": 385, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 380, - "src": "6648:1:0", + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 377, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6572:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 376, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6564:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 378, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6564:10:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", - "typeString": "struct HashedTimelock.LockContract storage pointer" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, - "id": 386, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": 26, - "src": "6648:8:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { + { "argumentTypes": null, - "id": 387, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 380, - "src": "6658:1:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", - "typeString": "struct HashedTimelock.LockContract storage pointer" - } - }, - "id": 388, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "receiver", - "nodeType": "MemberAccess", - "referencedDeclaration": 28, - "src": "6658:10:0", + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 380, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6584:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 379, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6576:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 381, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6576:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 382, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6588:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 383, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6591:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 384, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6594:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 385, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6597:5:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 386, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6604:5:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 387, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6611:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "id": 388, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "6563:50:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_address_payable_$_t_address_payable_$_t_rational_0_by_1_$_t_rational_0_by_1_$_t_rational_0_by_1_$_t_bool_$_t_bool_$_t_rational_0_by_1_$", + "typeString": "tuple(address payable,address payable,int_const 0,int_const 0,int_const 0,bool,bool,int_const 0)" + } + }, + "functionReturnParameters": 370, + "id": 389, + "nodeType": "Return", + "src": "6556:57:0" + } + }, + { + "assignments": [ + 392 + ], + "declarations": [ + { + "constant": false, + "id": 392, + "name": "c", + "nodeType": "VariableDeclaration", + "scope": 415, + "src": "6623:22:0", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", + "typeString": "struct HashedTimelock.LockContract" + }, + "typeName": { + "contractScope": null, + "id": 391, + "name": "LockContract", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 40, + "src": "6623:12:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", + "typeString": "struct HashedTimelock.LockContract" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 396, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 393, + "name": "contracts", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 189, + "src": "6648:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$40_storage_$", + "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract storage ref)" + } + }, + "id": 395, + "indexExpression": { + "argumentTypes": null, + "id": 394, + "name": "_contractId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 352, + "src": "6658:11:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6648:22:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_LockContract_$40_storage", + "typeString": "struct HashedTimelock.LockContract storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6623:47:0" + }, + { + "expression": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 397, + "name": "c", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 392, + "src": "6688:1:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", + "typeString": "struct HashedTimelock.LockContract storage pointer" + } + }, + "id": 398, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": 25, + "src": "6688:8:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, { "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 389, + "id": 399, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 380, - "src": "6670:1:0", + "referencedDeclaration": 392, + "src": "6698:1:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract storage pointer" } }, - "id": 390, + "id": 400, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "receiver", + "nodeType": "MemberAccess", + "referencedDeclaration": 27, + "src": "6698:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 401, + "name": "c", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 392, + "src": "6710:1:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", + "typeString": "struct HashedTimelock.LockContract storage pointer" + } + }, + "id": 402, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "amount", "nodeType": "MemberAccess", - "referencedDeclaration": 30, - "src": "6670:8:0", + "referencedDeclaration": 29, + "src": "6710:8:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -5138,26 +5364,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 391, + "id": 403, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 380, - "src": "6680:1:0", + "referencedDeclaration": 392, + "src": "6720:1:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract storage pointer" } }, - "id": 392, + "id": 404, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "hashlock", "nodeType": "MemberAccess", - "referencedDeclaration": 32, - "src": "6680:10:0", + "referencedDeclaration": 31, + "src": "6720:10:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -5167,26 +5393,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 393, + "id": 405, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 380, - "src": "6692:1:0", + "referencedDeclaration": 392, + "src": "6732:1:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract storage pointer" } }, - "id": 394, + "id": 406, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "timelock", "nodeType": "MemberAccess", - "referencedDeclaration": 34, - "src": "6692:10:0", + "referencedDeclaration": 33, + "src": "6732:10:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -5196,26 +5422,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 395, + "id": 407, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 380, - "src": "6720:1:0", + "referencedDeclaration": 392, + "src": "6760:1:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract storage pointer" } }, - "id": 396, + "id": 408, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "withdrawn", "nodeType": "MemberAccess", - "referencedDeclaration": 36, - "src": "6720:11:0", + "referencedDeclaration": 35, + "src": "6760:11:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -5225,26 +5451,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 397, + "id": 409, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 380, - "src": "6733:1:0", + "referencedDeclaration": 392, + "src": "6773:1:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract storage pointer" } }, - "id": 398, + "id": 410, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "refunded", "nodeType": "MemberAccess", - "referencedDeclaration": 38, - "src": "6733:10:0", + "referencedDeclaration": 37, + "src": "6773:10:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -5254,71 +5480,70 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 399, + "id": 411, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 380, - "src": "6745:1:0", + "referencedDeclaration": 392, + "src": "6785:1:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract storage pointer" } }, - "id": 400, + "id": 412, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "preimage", "nodeType": "MemberAccess", - "referencedDeclaration": 40, - "src": "6745:10:0", + "referencedDeclaration": 39, + "src": "6785:10:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], - "id": 401, + "id": 413, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", - "src": "6647:109:0", + "src": "6687:109:0", "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_address_$_t_address_$_t_uint256_$_t_bytes32_$_t_uint256_$_t_bool_$_t_bool_$_t_bytes32_$", - "typeString": "tuple(address,address,uint256,bytes32,uint256,bool,bool,bytes32)" + "typeIdentifier": "t_tuple$_t_address_payable_$_t_address_payable_$_t_uint256_$_t_bytes32_$_t_uint256_$_t_bool_$_t_bool_$_t_bytes32_$", + "typeString": "tuple(address payable,address payable,uint256,bytes32,uint256,bool,bool,bytes32)" } }, - "functionReturnParameters": 371, - "id": 402, + "functionReturnParameters": 370, + "id": 414, "nodeType": "Return", - "src": "6640:116:0" + "src": "6680:116:0" } ] }, "documentation": "@dev Get contract details.\n@param _contractId HTLC contract id\n@return All parameters in struct LockContract for _contractId HTLC", - "id": 404, + "id": 416, "implemented": true, - "isConstructor": false, - "isDeclaredConst": true, + "kind": "function", "modifiers": [], "name": "getContract", "nodeType": "FunctionDefinition", "parameters": { - "id": 354, + "id": 353, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 353, + "id": 352, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 404, - "src": "6200:19:0", + "scope": 416, + "src": "6189:19:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -5326,10 +5551,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 352, + "id": 351, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "6200:7:0", + "src": "6189:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -5339,20 +5564,19 @@ "visibility": "internal" } ], - "src": "6199:21:0" + "src": "6188:21:0" }, - "payable": false, "returnParameters": { - "id": 371, + "id": 370, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 356, + "id": 355, "name": "sender", "nodeType": "VariableDeclaration", - "scope": 404, - "src": "6279:14:0", + "scope": 416, + "src": "6268:14:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -5360,10 +5584,11 @@ "typeString": "address" }, "typeName": { - "id": 355, + "id": 354, "name": "address", "nodeType": "ElementaryTypeName", - "src": "6279:7:0", + "src": "6268:7:0", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -5374,11 +5599,11 @@ }, { "constant": false, - "id": 358, + "id": 357, "name": "receiver", "nodeType": "VariableDeclaration", - "scope": 404, - "src": "6307:16:0", + "scope": 416, + "src": "6296:16:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -5386,10 +5611,11 @@ "typeString": "address" }, "typeName": { - "id": 357, + "id": 356, "name": "address", "nodeType": "ElementaryTypeName", - "src": "6307:7:0", + "src": "6296:7:0", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -5400,11 +5626,11 @@ }, { "constant": false, - "id": 360, + "id": 359, "name": "amount", "nodeType": "VariableDeclaration", - "scope": 404, - "src": "6337:11:0", + "scope": 416, + "src": "6326:11:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -5412,10 +5638,10 @@ "typeString": "uint256" }, "typeName": { - "id": 359, + "id": 358, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "6337:4:0", + "src": "6326:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -5426,11 +5652,11 @@ }, { "constant": false, - "id": 362, + "id": 361, "name": "hashlock", "nodeType": "VariableDeclaration", - "scope": 404, - "src": "6362:16:0", + "scope": 416, + "src": "6351:16:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -5438,10 +5664,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 361, + "id": 360, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "6362:7:0", + "src": "6351:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -5452,11 +5678,11 @@ }, { "constant": false, - "id": 364, + "id": 363, "name": "timelock", "nodeType": "VariableDeclaration", - "scope": 404, - "src": "6392:13:0", + "scope": 416, + "src": "6381:13:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -5464,10 +5690,10 @@ "typeString": "uint256" }, "typeName": { - "id": 363, + "id": 362, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "6392:4:0", + "src": "6381:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -5478,11 +5704,11 @@ }, { "constant": false, - "id": 366, + "id": 365, "name": "withdrawn", "nodeType": "VariableDeclaration", - "scope": 404, - "src": "6419:14:0", + "scope": 416, + "src": "6408:14:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -5490,10 +5716,10 @@ "typeString": "bool" }, "typeName": { - "id": 365, + "id": 364, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "6419:4:0", + "src": "6408:4:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -5504,11 +5730,11 @@ }, { "constant": false, - "id": 368, + "id": 367, "name": "refunded", "nodeType": "VariableDeclaration", - "scope": 404, - "src": "6447:13:0", + "scope": 416, + "src": "6436:13:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -5516,10 +5742,10 @@ "typeString": "bool" }, "typeName": { - "id": 367, + "id": 366, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "6447:4:0", + "src": "6436:4:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -5530,11 +5756,11 @@ }, { "constant": false, - "id": 370, + "id": 369, "name": "preimage", "nodeType": "VariableDeclaration", - "scope": 404, - "src": "6474:16:0", + "scope": 416, + "src": "6463:16:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -5542,10 +5768,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 369, + "id": 368, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "6474:7:0", + "src": "6463:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -5555,36 +5781,36 @@ "visibility": "internal" } ], - "src": "6265:235:0" + "src": "6254:235:0" }, - "scope": 425, - "src": "6179:584:0", + "scope": 437, + "src": "6168:635:0", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { - "id": 423, + "id": 435, "nodeType": "Block", - "src": "6998:71:0", + "src": "7038:71:0", "statements": [ { "expression": { "argumentTypes": null, - "id": 421, + "id": 433, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, - "id": 411, + "id": 423, "name": "exists", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 409, - "src": "7008:6:0", + "referencedDeclaration": 421, + "src": "7048:6:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -5598,10 +5824,10 @@ { "argumentTypes": null, "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, - "id": 419, + "id": 431, "isConstant": false, "isLValue": false, "isPure": false, @@ -5612,26 +5838,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 412, + "id": 424, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 190, - "src": "7018:9:0", + "referencedDeclaration": 189, + "src": "7058:9:0", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$41_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$40_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract storage ref)" } }, - "id": 414, + "id": 426, "indexExpression": { "argumentTypes": null, - "id": 413, + "id": 425, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 406, - "src": "7028:11:0", + "referencedDeclaration": 418, + "src": "7068:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -5642,24 +5868,24 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "7018:22:0", + "src": "7058:22:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage", + "typeIdentifier": "t_struct$_LockContract_$40_storage", "typeString": "struct HashedTimelock.LockContract storage ref" } }, - "id": 415, + "id": 427, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", - "referencedDeclaration": 26, - "src": "7018:29:0", + "referencedDeclaration": 25, + "src": "7058:29:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, "nodeType": "BinaryOperation", @@ -5670,14 +5896,14 @@ { "argumentTypes": null, "hexValue": "30", - "id": 417, + "id": 429, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "7059:1:0", + "src": "7099:1:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", @@ -5693,20 +5919,20 @@ "typeString": "int_const 0" } ], - "id": 416, + "id": 428, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", - "src": "7051:7:0", + "src": "7091:7:0", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, - "id": 418, + "id": 430, "isConstant": false, "isLValue": false, "isPure": true, @@ -5714,63 +5940,62 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "7051:10:0", + "src": "7091:10:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, - "src": "7018:43:0", + "src": "7058:43:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], - "id": 420, + "id": 432, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", - "src": "7017:45:0", + "src": "7057:45:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "src": "7008:54:0", + "src": "7048:54:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "id": 422, + "id": 434, "nodeType": "ExpressionStatement", - "src": "7008:54:0" + "src": "7048:54:0" } ] }, "documentation": "@dev Is there a contract with id _contractId.\n@param _contractId Id into contracts mapping.", - "id": 424, + "id": 436, "implemented": true, - "isConstructor": false, - "isDeclaredConst": true, + "kind": "function", "modifiers": [], "name": "haveContract", "nodeType": "FunctionDefinition", "parameters": { - "id": 407, + "id": 419, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 406, + "id": 418, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 424, - "src": "6913:19:0", + "scope": 436, + "src": "6953:19:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -5778,10 +6003,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 405, + "id": 417, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "6913:7:0", + "src": "6953:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -5791,20 +6016,19 @@ "visibility": "internal" } ], - "src": "6912:21:0" + "src": "6952:21:0" }, - "payable": false, "returnParameters": { - "id": 410, + "id": 422, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 409, + "id": 421, "name": "exists", "nodeType": "VariableDeclaration", - "scope": 424, - "src": "6981:11:0", + "scope": 436, + "src": "7021:11:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -5812,10 +6036,10 @@ "typeString": "bool" }, "typeName": { - "id": 408, + "id": 420, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "6981:4:0", + "src": "7021:4:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -5825,29 +6049,29 @@ "visibility": "internal" } ], - "src": "6980:13:0" + "src": "7020:13:0" }, - "scope": 425, - "src": "6891:178:0", + "scope": 437, + "src": "6931:178:0", "stateMutability": "view", "superFunction": null, "visibility": "internal" } ], - "scope": 426, - "src": "783:6289:0" + "scope": 438, + "src": "752:6360:0" } ], - "src": "0:7073:0" + "src": "0:7113:0" }, "legacyAST": { - "absolutePath": "/home/hatch/eth/hashed-timelock-contract-ethereum/contracts/HashedTimelock.sol", + "absolutePath": "/home/hatch/src/eth/hashed-timelock-contract-ethereum/contracts/HashedTimelock.sol", "exportedSymbols": { "HashedTimelock": [ - 425 + 437 ] }, - "id": 426, + "id": 438, "nodeType": "SourceUnit", "nodes": [ { @@ -5855,20 +6079,11 @@ "literals": [ "solidity", "^", - "0.4", - ".24" + "0.5", + ".0" ], "nodeType": "PragmaDirective", - "src": "0:24:0" - }, - { - "id": 2, - "literals": [ - "experimental", - "v0.5.0" - ], - "nodeType": "PragmaDirective", - "src": "25:29:0" + "src": "0:23:0" }, { "baseContracts": [], @@ -5876,9 +6091,9 @@ "contractKind": "contract", "documentation": "@title Hashed Timelock Contracts (HTLCs) on Ethereum ETH.\n * This contract provides a way to create and keep HTLCs for ETH.\n * See HashedTimelockERC20.sol for a contract that provides the same functions \nfor ERC20 tokens.\n * Protocol:\n * 1) newContract(receiver, hashlock, timelock) - a sender calls this to create\n a new HTLC and gets back a 32 byte contract id\n 2) withdraw(contractId, preimage) - once the receiver knows the preimage of\n the hashlock hash they can claim the ETH with this function\n 3) refund() - after timelock has expired and if the receiver did not \n withdraw funds the sender / creater of the HTLC can get their ETH \n back with this function.", "fullyImplemented": true, - "id": 425, + "id": 437, "linearizedBaseContracts": [ - 425 + 437 ], "name": "HashedTimelock", "nodeType": "ContractDefinition", @@ -5886,21 +6101,21 @@ { "anonymous": false, "documentation": null, - "id": 16, + "id": 15, "name": "LogHTLCNew", "nodeType": "EventDefinition", "parameters": { - "id": 15, + "id": 14, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 4, + "id": 3, "indexed": true, "name": "contractId", "nodeType": "VariableDeclaration", - "scope": 16, - "src": "844:26:0", + "scope": 15, + "src": "809:26:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -5908,10 +6123,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 3, + "id": 2, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "844:7:0", + "src": "809:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -5922,12 +6137,12 @@ }, { "constant": false, - "id": 6, + "id": 5, "indexed": true, "name": "sender", "nodeType": "VariableDeclaration", - "scope": 16, - "src": "880:22:0", + "scope": 15, + "src": "845:22:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -5935,10 +6150,11 @@ "typeString": "address" }, "typeName": { - "id": 5, + "id": 4, "name": "address", "nodeType": "ElementaryTypeName", - "src": "880:7:0", + "src": "845:7:0", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -5949,12 +6165,12 @@ }, { "constant": false, - "id": 8, + "id": 7, "indexed": true, "name": "receiver", "nodeType": "VariableDeclaration", - "scope": 16, - "src": "912:24:0", + "scope": 15, + "src": "877:24:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -5962,10 +6178,11 @@ "typeString": "address" }, "typeName": { - "id": 7, + "id": 6, "name": "address", "nodeType": "ElementaryTypeName", - "src": "912:7:0", + "src": "877:7:0", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -5976,12 +6193,12 @@ }, { "constant": false, - "id": 10, + "id": 9, "indexed": false, "name": "amount", "nodeType": "VariableDeclaration", - "scope": 16, - "src": "946:11:0", + "scope": 15, + "src": "911:11:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -5989,10 +6206,10 @@ "typeString": "uint256" }, "typeName": { - "id": 9, + "id": 8, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "946:4:0", + "src": "911:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6003,12 +6220,12 @@ }, { "constant": false, - "id": 12, + "id": 11, "indexed": false, "name": "hashlock", "nodeType": "VariableDeclaration", - "scope": 16, - "src": "967:16:0", + "scope": 15, + "src": "932:16:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6016,10 +6233,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 11, + "id": 10, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "967:7:0", + "src": "932:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -6030,12 +6247,12 @@ }, { "constant": false, - "id": 14, + "id": 13, "indexed": false, "name": "timelock", "nodeType": "VariableDeclaration", - "scope": 16, - "src": "993:13:0", + "scope": 15, + "src": "958:13:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6043,10 +6260,10 @@ "typeString": "uint256" }, "typeName": { - "id": 13, + "id": 12, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "993:4:0", + "src": "958:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6056,28 +6273,28 @@ "visibility": "internal" } ], - "src": "834:178:0" + "src": "799:178:0" }, - "src": "818:195:0" + "src": "783:195:0" }, { "anonymous": false, "documentation": null, - "id": 20, + "id": 19, "name": "LogHTLCWithdraw", "nodeType": "EventDefinition", "parameters": { - "id": 19, + "id": 18, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 18, + "id": 17, "indexed": true, "name": "contractId", "nodeType": "VariableDeclaration", - "scope": 20, - "src": "1040:26:0", + "scope": 19, + "src": "1005:26:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6085,10 +6302,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 17, + "id": 16, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1040:7:0", + "src": "1005:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -6098,28 +6315,28 @@ "visibility": "internal" } ], - "src": "1039:28:0" + "src": "1004:28:0" }, - "src": "1018:50:0" + "src": "983:50:0" }, { "anonymous": false, "documentation": null, - "id": 24, + "id": 23, "name": "LogHTLCRefund", "nodeType": "EventDefinition", "parameters": { - "id": 23, + "id": 22, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 22, + "id": 21, "indexed": true, "name": "contractId", "nodeType": "VariableDeclaration", - "scope": 24, - "src": "1093:26:0", + "scope": 23, + "src": "1058:26:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6127,10 +6344,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 21, + "id": 20, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1093:7:0", + "src": "1058:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -6140,35 +6357,36 @@ "visibility": "internal" } ], - "src": "1092:28:0" + "src": "1057:28:0" }, - "src": "1073:48:0" + "src": "1038:48:0" }, { "canonicalName": "HashedTimelock.LockContract", - "id": 41, + "id": 40, "members": [ { "constant": false, - "id": 26, + "id": 25, "name": "sender", "nodeType": "VariableDeclaration", - "scope": 41, - "src": "1157:14:0", + "scope": 40, + "src": "1122:22:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, "typeName": { - "id": 25, + "id": 24, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1157:7:0", + "src": "1122:15:0", + "stateMutability": "payable", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, "value": null, @@ -6176,25 +6394,26 @@ }, { "constant": false, - "id": 28, + "id": 27, "name": "receiver", "nodeType": "VariableDeclaration", - "scope": 41, - "src": "1181:16:0", + "scope": 40, + "src": "1154:24:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, "typeName": { - "id": 27, + "id": 26, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1181:7:0", + "src": "1154:15:0", + "stateMutability": "payable", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, "value": null, @@ -6202,11 +6421,11 @@ }, { "constant": false, - "id": 30, + "id": 29, "name": "amount", "nodeType": "VariableDeclaration", - "scope": 41, - "src": "1207:11:0", + "scope": 40, + "src": "1188:11:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6214,10 +6433,10 @@ "typeString": "uint256" }, "typeName": { - "id": 29, + "id": 28, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "1207:4:0", + "src": "1188:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6228,11 +6447,11 @@ }, { "constant": false, - "id": 32, + "id": 31, "name": "hashlock", "nodeType": "VariableDeclaration", - "scope": 41, - "src": "1228:16:0", + "scope": 40, + "src": "1209:16:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6240,10 +6459,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 31, + "id": 30, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1228:7:0", + "src": "1209:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -6254,11 +6473,11 @@ }, { "constant": false, - "id": 34, + "id": 33, "name": "timelock", "nodeType": "VariableDeclaration", - "scope": 41, - "src": "1275:13:0", + "scope": 40, + "src": "1256:13:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6266,10 +6485,10 @@ "typeString": "uint256" }, "typeName": { - "id": 33, + "id": 32, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "1275:4:0", + "src": "1256:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6280,11 +6499,11 @@ }, { "constant": false, - "id": 36, + "id": 35, "name": "withdrawn", "nodeType": "VariableDeclaration", - "scope": 41, - "src": "1349:14:0", + "scope": 40, + "src": "1330:14:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6292,10 +6511,10 @@ "typeString": "bool" }, "typeName": { - "id": 35, + "id": 34, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "1349:4:0", + "src": "1330:4:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -6306,11 +6525,11 @@ }, { "constant": false, - "id": 38, + "id": 37, "name": "refunded", "nodeType": "VariableDeclaration", - "scope": 41, - "src": "1373:13:0", + "scope": 40, + "src": "1354:13:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6318,10 +6537,10 @@ "typeString": "bool" }, "typeName": { - "id": 37, + "id": 36, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "1373:4:0", + "src": "1354:4:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -6332,11 +6551,11 @@ }, { "constant": false, - "id": 40, + "id": 39, "name": "preimage", "nodeType": "VariableDeclaration", - "scope": 41, - "src": "1396:16:0", + "scope": 40, + "src": "1377:16:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6344,10 +6563,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 39, + "id": 38, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1396:7:0", + "src": "1377:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -6359,15 +6578,15 @@ ], "name": "LockContract", "nodeType": "StructDefinition", - "scope": 425, - "src": "1127:292:0", + "scope": 437, + "src": "1092:308:0", "visibility": "public" }, { "body": { - "id": 52, + "id": 51, "nodeType": "Block", - "src": "1446:75:0", + "src": "1427:75:0", "statements": [ { "expression": { @@ -6379,7 +6598,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 47, + "id": 46, "isConstant": false, "isLValue": false, "isPure": false, @@ -6388,18 +6607,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 44, + "id": 43, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "1464:3:0", + "referencedDeclaration": 1636, + "src": "1445:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 45, + "id": 44, "isConstant": false, "isLValue": false, "isPure": false, @@ -6407,7 +6626,7 @@ "memberName": "value", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "1464:9:0", + "src": "1445:9:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6418,14 +6637,14 @@ "rightExpression": { "argumentTypes": null, "hexValue": "30", - "id": 46, + "id": 45, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "1476:1:0", + "src": "1457:1:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", @@ -6433,7 +6652,7 @@ }, "value": "0" }, - "src": "1464:13:0", + "src": "1445:13:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -6442,14 +6661,14 @@ { "argumentTypes": null, "hexValue": "6d73672e76616c7565206d757374206265203e2030", - "id": 48, + "id": 47, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "1479:23:0", + "src": "1460:23:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_e732522f9e0ad111d95708b06d98aab65f1409b187a66ff1dfb881988d8f20b7", @@ -6469,21 +6688,21 @@ "typeString": "literal_string \"msg.value must be > 0\"" } ], - "id": 43, + "id": 42, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "1456:7:0", + "referencedDeclaration": 1640, + "src": "1437:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 49, + "id": 48, "isConstant": false, "isLValue": false, "isPure": false, @@ -6491,41 +6710,41 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "1456:47:0", + "src": "1437:47:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 50, + "id": 49, "nodeType": "ExpressionStatement", - "src": "1456:47:0" + "src": "1437:47:0" }, { - "id": 51, + "id": 50, "nodeType": "PlaceholderStatement", - "src": "1513:1:0" + "src": "1494:1:0" } ] }, "documentation": null, - "id": 53, + "id": 52, "name": "fundsSent", "nodeType": "ModifierDefinition", "parameters": { - "id": 42, + "id": 41, "nodeType": "ParameterList", "parameters": [], - "src": "1443:2:0" + "src": "1424:2:0" }, - "src": "1425:96:0", + "src": "1406:96:0", "visibility": "internal" }, { "body": { - "id": 65, + "id": 64, "nodeType": "Block", - "src": "1562:297:0", + "src": "1543:297:0", "statements": [ { "expression": { @@ -6537,19 +6756,19 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 60, + "id": 59, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, - "id": 58, + "id": 57, "name": "_time", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 55, - "src": "1790:5:0", + "referencedDeclaration": 54, + "src": "1771:5:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6559,18 +6778,18 @@ "operator": ">", "rightExpression": { "argumentTypes": null, - "id": 59, + "id": 58, "name": "now", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1053, - "src": "1798:3:0", + "referencedDeclaration": 1638, + "src": "1779:3:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "1790:11:0", + "src": "1771:11:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -6579,14 +6798,14 @@ { "argumentTypes": null, "hexValue": "74696d656c6f636b2074696d65206d75737420626520696e2074686520667574757265", - "id": 61, + "id": 60, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "1803:37:0", + "src": "1784:37:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_16dbfee8f738f21cc70987859d9176eb37f9ed0572f04024e006404bb83f7086", @@ -6606,21 +6825,21 @@ "typeString": "literal_string \"timelock time must be in the future\"" } ], - "id": 57, + "id": 56, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "1782:7:0", + "referencedDeclaration": 1640, + "src": "1763:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 62, + "id": 61, "isConstant": false, "isLValue": false, "isPure": false, @@ -6628,38 +6847,38 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "1782:59:0", + "src": "1763:59:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 63, + "id": 62, "nodeType": "ExpressionStatement", - "src": "1782:59:0" + "src": "1763:59:0" }, { - "id": 64, + "id": 63, "nodeType": "PlaceholderStatement", - "src": "1851:1:0" + "src": "1832:1:0" } ] }, "documentation": null, - "id": 66, + "id": 65, "name": "futureTimelock", "nodeType": "ModifierDefinition", "parameters": { - "id": 56, + "id": 55, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 55, + "id": 54, "name": "_time", "nodeType": "VariableDeclaration", - "scope": 66, - "src": "1550:10:0", + "scope": 65, + "src": "1531:10:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6667,10 +6886,10 @@ "typeString": "uint256" }, "typeName": { - "id": 54, + "id": 53, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "1550:4:0", + "src": "1531:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6680,16 +6899,16 @@ "visibility": "internal" } ], - "src": "1549:12:0" + "src": "1530:12:0" }, - "src": "1526:333:0", + "src": "1507:333:0", "visibility": "internal" }, { "body": { - "id": 78, + "id": 77, "nodeType": "Block", - "src": "1909:91:0", + "src": "1890:91:0", "statements": [ { "expression": { @@ -6700,12 +6919,12 @@ "arguments": [ { "argumentTypes": null, - "id": 72, + "id": 71, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "1940:11:0", + "referencedDeclaration": 67, + "src": "1921:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -6719,18 +6938,18 @@ "typeString": "bytes32" } ], - "id": 71, + "id": 70, "name": "haveContract", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 424, - "src": "1927:12:0", + "referencedDeclaration": 436, + "src": "1908:12:0", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bool_$", "typeString": "function (bytes32) view returns (bool)" } }, - "id": 73, + "id": 72, "isConstant": false, "isLValue": false, "isPure": false, @@ -6738,7 +6957,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "1927:25:0", + "src": "1908:25:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -6747,14 +6966,14 @@ { "argumentTypes": null, "hexValue": "636f6e7472616374496420646f6573206e6f74206578697374", - "id": 74, + "id": 73, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "1954:27:0", + "src": "1935:27:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_2ff20efe697688cf49352f50e84b155aa5e8db31cae40badce7570a4e72a088a", @@ -6774,21 +6993,21 @@ "typeString": "literal_string \"contractId does not exist\"" } ], - "id": 70, + "id": 69, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "1919:7:0", + "referencedDeclaration": 1640, + "src": "1900:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 75, + "id": 74, "isConstant": false, "isLValue": false, "isPure": false, @@ -6796,38 +7015,38 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "1919:63:0", + "src": "1900:63:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 76, + "id": 75, "nodeType": "ExpressionStatement", - "src": "1919:63:0" + "src": "1900:63:0" }, { - "id": 77, + "id": 76, "nodeType": "PlaceholderStatement", - "src": "1992:1:0" + "src": "1973:1:0" } ] }, "documentation": null, - "id": 79, + "id": 78, "name": "contractExists", "nodeType": "ModifierDefinition", "parameters": { - "id": 69, + "id": 68, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 68, + "id": 67, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 79, - "src": "1888:19:0", + "scope": 78, + "src": "1869:19:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6835,10 +7054,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 67, + "id": 66, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1888:7:0", + "src": "1869:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -6848,16 +7067,16 @@ "visibility": "internal" } ], - "src": "1887:21:0" + "src": "1868:21:0" }, - "src": "1864:136:0", + "src": "1845:136:0", "visibility": "internal" }, { "body": { - "id": 101, + "id": 100, "nodeType": "Block", - "src": "2063:166:0", + "src": "2044:166:0", "statements": [ { "expression": { @@ -6869,7 +7088,7 @@ "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, - "id": 96, + "id": 95, "isConstant": false, "isLValue": false, "isPure": false, @@ -6880,26 +7099,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 86, + "id": 85, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 190, - "src": "2094:9:0", + "referencedDeclaration": 189, + "src": "2075:9:0", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$41_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$40_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract storage ref)" } }, - "id": 88, + "id": 87, "indexExpression": { "argumentTypes": null, - "id": 87, + "id": 86, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "2104:11:0", + "referencedDeclaration": 80, + "src": "2085:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -6910,21 +7129,21 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "2094:22:0", + "src": "2075:22:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage", + "typeIdentifier": "t_struct$_LockContract_$40_storage", "typeString": "struct HashedTimelock.LockContract storage ref" } }, - "id": 89, + "id": 88, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "hashlock", "nodeType": "MemberAccess", - "referencedDeclaration": 32, - "src": "2094:31:0", + "referencedDeclaration": 31, + "src": "2075:31:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -6940,12 +7159,12 @@ "arguments": [ { "argumentTypes": null, - "id": 93, + "id": 92, "name": "_x", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 83, - "src": "2153:2:0", + "referencedDeclaration": 82, + "src": "2134:2:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -6961,18 +7180,18 @@ ], "expression": { "argumentTypes": null, - "id": 91, + "id": 90, "name": "abi", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1038, - "src": "2136:3:0", + "referencedDeclaration": 1623, + "src": "2117:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_abi", "typeString": "abi" } }, - "id": 92, + "id": 91, "isConstant": false, "isLValue": false, "isPure": true, @@ -6980,13 +7199,13 @@ "memberName": "encodePacked", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "2136:16:0", + "src": "2117:16:0", "typeDescriptions": { "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", "typeString": "function () pure returns (bytes memory)" } }, - "id": 94, + "id": 93, "isConstant": false, "isLValue": false, "isPure": false, @@ -6994,7 +7213,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2136:20:0", + "src": "2117:20:0", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" @@ -7008,18 +7227,18 @@ "typeString": "bytes memory" } ], - "id": 90, + "id": 89, "name": "sha256", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1060, - "src": "2129:6:0", + "referencedDeclaration": 1645, + "src": "2110:6:0", "typeDescriptions": { - "typeIdentifier": "t_function_sha256_pure$__$returns$_t_bytes32_$", - "typeString": "function () pure returns (bytes32)" + "typeIdentifier": "t_function_sha256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" } }, - "id": 95, + "id": 94, "isConstant": false, "isLValue": false, "isPure": false, @@ -7027,13 +7246,13 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2129:28:0", + "src": "2110:28:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "src": "2094:63:0", + "src": "2075:63:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -7042,14 +7261,14 @@ { "argumentTypes": null, "hexValue": "686173686c6f636b206861736820646f6573206e6f74206d61746368", - "id": 97, + "id": 96, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2171:30:0", + "src": "2152:30:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_f69d465af376b0946a94d153fa61e1120954d7550ccad2ede50c179df9b911a9", @@ -7069,21 +7288,21 @@ "typeString": "literal_string \"hashlock hash does not match\"" } ], - "id": 85, + "id": 84, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "2073:7:0", + "referencedDeclaration": 1640, + "src": "2054:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 98, + "id": 97, "isConstant": false, "isLValue": false, "isPure": false, @@ -7091,38 +7310,38 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2073:138:0", + "src": "2054:138:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 99, + "id": 98, "nodeType": "ExpressionStatement", - "src": "2073:138:0" + "src": "2054:138:0" }, { - "id": 100, + "id": 99, "nodeType": "PlaceholderStatement", - "src": "2221:1:0" + "src": "2202:1:0" } ] }, "documentation": null, - "id": 102, + "id": 101, "name": "hashlockMatches", "nodeType": "ModifierDefinition", "parameters": { - "id": 84, + "id": 83, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 81, + "id": 80, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 102, - "src": "2030:19:0", + "scope": 101, + "src": "2011:19:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -7130,10 +7349,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 80, + "id": 79, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "2030:7:0", + "src": "2011:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -7144,11 +7363,11 @@ }, { "constant": false, - "id": 83, + "id": 82, "name": "_x", "nodeType": "VariableDeclaration", - "scope": 102, - "src": "2051:10:0", + "scope": 101, + "src": "2032:10:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -7156,10 +7375,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 82, + "id": 81, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "2051:7:0", + "src": "2032:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -7169,16 +7388,16 @@ "visibility": "internal" } ], - "src": "2029:33:0" + "src": "2010:33:0" }, - "src": "2005:224:0", + "src": "1986:224:0", "visibility": "internal" }, { "body": { - "id": 138, + "id": 137, "nodeType": "Block", - "src": "2277:316:0", + "src": "2258:316:0", "statements": [ { "expression": { @@ -7187,10 +7406,10 @@ { "argumentTypes": null, "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, - "id": 113, + "id": 112, "isConstant": false, "isLValue": false, "isPure": false, @@ -7201,26 +7420,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 107, + "id": 106, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 190, - "src": "2295:9:0", + "referencedDeclaration": 189, + "src": "2276:9:0", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$41_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$40_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract storage ref)" } }, - "id": 109, + "id": 108, "indexExpression": { "argumentTypes": null, - "id": 108, + "id": 107, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 104, - "src": "2305:11:0", + "referencedDeclaration": 103, + "src": "2286:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -7231,24 +7450,24 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "2295:22:0", + "src": "2276:22:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage", + "typeIdentifier": "t_struct$_LockContract_$40_storage", "typeString": "struct HashedTimelock.LockContract storage ref" } }, - "id": 110, + "id": 109, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "receiver", "nodeType": "MemberAccess", - "referencedDeclaration": 28, - "src": "2295:31:0", + "referencedDeclaration": 27, + "src": "2276:31:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, "nodeType": "BinaryOperation", @@ -7257,18 +7476,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 111, + "id": 110, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "2330:3:0", + "referencedDeclaration": 1636, + "src": "2311:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 112, + "id": 111, "isConstant": false, "isLValue": false, "isPure": false, @@ -7276,13 +7495,13 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "2330:10:0", + "src": "2311:10:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, - "src": "2295:45:0", + "src": "2276:45:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -7291,14 +7510,14 @@ { "argumentTypes": null, "hexValue": "776974686472617761626c653a206e6f74207265636569766572", - "id": 114, + "id": 113, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2342:28:0", + "src": "2323:28:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_2996fe9bb22eca23c8f30e4ecaf6f5ab8925bbafce446942fa02db59ed0654ee", @@ -7318,21 +7537,21 @@ "typeString": "literal_string \"withdrawable: not receiver\"" } ], - "id": 106, + "id": 105, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "2287:7:0", + "referencedDeclaration": 1640, + "src": "2268:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 115, + "id": 114, "isConstant": false, "isLValue": false, "isPure": false, @@ -7340,15 +7559,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2287:84:0", + "src": "2268:84:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 116, + "id": 115, "nodeType": "ExpressionStatement", - "src": "2287:84:0" + "src": "2268:84:0" }, { "expression": { @@ -7360,7 +7579,7 @@ "typeIdentifier": "t_bool", "typeString": "bool" }, - "id": 123, + "id": 122, "isConstant": false, "isLValue": false, "isPure": false, @@ -7371,26 +7590,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 118, + "id": 117, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 190, - "src": "2389:9:0", + "referencedDeclaration": 189, + "src": "2370:9:0", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$41_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$40_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract storage ref)" } }, - "id": 120, + "id": 119, "indexExpression": { "argumentTypes": null, - "id": 119, + "id": 118, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 104, - "src": "2399:11:0", + "referencedDeclaration": 103, + "src": "2380:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -7401,21 +7620,21 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "2389:22:0", + "src": "2370:22:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage", + "typeIdentifier": "t_struct$_LockContract_$40_storage", "typeString": "struct HashedTimelock.LockContract storage ref" } }, - "id": 121, + "id": 120, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "withdrawn", "nodeType": "MemberAccess", - "referencedDeclaration": 36, - "src": "2389:32:0", + "referencedDeclaration": 35, + "src": "2370:32:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -7426,14 +7645,14 @@ "rightExpression": { "argumentTypes": null, "hexValue": "66616c7365", - "id": 122, + "id": 121, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "2425:5:0", + "src": "2406:5:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -7441,7 +7660,7 @@ }, "value": "false" }, - "src": "2389:41:0", + "src": "2370:41:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -7450,14 +7669,14 @@ { "argumentTypes": null, "hexValue": "776974686472617761626c653a20616c72656164792077697468647261776e", - "id": 124, + "id": 123, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2432:33:0", + "src": "2413:33:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_a7a1491df76b63b166fa25b3631de654587363606d31ccfadcdf86382f44f0da", @@ -7477,21 +7696,21 @@ "typeString": "literal_string \"withdrawable: already withdrawn\"" } ], - "id": 117, + "id": 116, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "2381:7:0", + "referencedDeclaration": 1640, + "src": "2362:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 125, + "id": 124, "isConstant": false, "isLValue": false, "isPure": false, @@ -7499,15 +7718,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2381:85:0", + "src": "2362:85:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 126, + "id": 125, "nodeType": "ExpressionStatement", - "src": "2381:85:0" + "src": "2362:85:0" }, { "expression": { @@ -7519,7 +7738,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 133, + "id": 132, "isConstant": false, "isLValue": false, "isPure": false, @@ -7530,26 +7749,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 128, + "id": 127, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 190, - "src": "2484:9:0", + "referencedDeclaration": 189, + "src": "2465:9:0", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$41_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$40_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract storage ref)" } }, - "id": 130, + "id": 129, "indexExpression": { "argumentTypes": null, - "id": 129, + "id": 128, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 104, - "src": "2494:11:0", + "referencedDeclaration": 103, + "src": "2475:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -7560,21 +7779,21 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "2484:22:0", + "src": "2465:22:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage", + "typeIdentifier": "t_struct$_LockContract_$40_storage", "typeString": "struct HashedTimelock.LockContract storage ref" } }, - "id": 131, + "id": 130, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "timelock", "nodeType": "MemberAccess", - "referencedDeclaration": 34, - "src": "2484:31:0", + "referencedDeclaration": 33, + "src": "2465:31:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -7584,18 +7803,18 @@ "operator": ">", "rightExpression": { "argumentTypes": null, - "id": 132, + "id": 131, "name": "now", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1053, - "src": "2518:3:0", + "referencedDeclaration": 1638, + "src": "2499:3:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "2484:37:0", + "src": "2465:37:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -7604,14 +7823,14 @@ { "argumentTypes": null, "hexValue": "776974686472617761626c653a2074696d656c6f636b2074696d65206d75737420626520696e2074686520667574757265", - "id": 134, + "id": 133, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2523:51:0", + "src": "2504:51:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_f90a5049b744d27b4e847d49b0f3d774706fdfcfc2fa7fe6498583db4e9e564f", @@ -7631,21 +7850,21 @@ "typeString": "literal_string \"withdrawable: timelock time must be in the future\"" } ], - "id": 127, + "id": 126, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "2476:7:0", + "referencedDeclaration": 1640, + "src": "2457:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 135, + "id": 134, "isConstant": false, "isLValue": false, "isPure": false, @@ -7653,38 +7872,38 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2476:99:0", + "src": "2457:99:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 136, + "id": 135, "nodeType": "ExpressionStatement", - "src": "2476:99:0" + "src": "2457:99:0" }, { - "id": 137, + "id": 136, "nodeType": "PlaceholderStatement", - "src": "2585:1:0" + "src": "2566:1:0" } ] }, "documentation": null, - "id": 139, + "id": 138, "name": "withdrawable", "nodeType": "ModifierDefinition", "parameters": { - "id": 105, + "id": 104, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 104, + "id": 103, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 139, - "src": "2256:19:0", + "scope": 138, + "src": "2237:19:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -7692,10 +7911,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 103, + "id": 102, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "2256:7:0", + "src": "2237:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -7705,16 +7924,16 @@ "visibility": "internal" } ], - "src": "2255:21:0" + "src": "2236:21:0" }, - "src": "2234:359:0", + "src": "2215:359:0", "visibility": "internal" }, { "body": { - "id": 185, + "id": 184, "nodeType": "Block", - "src": "2639:386:0", + "src": "2620:386:0", "statements": [ { "expression": { @@ -7723,10 +7942,10 @@ { "argumentTypes": null, "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, - "id": 150, + "id": 149, "isConstant": false, "isLValue": false, "isPure": false, @@ -7737,26 +7956,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 144, + "id": 143, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 190, - "src": "2657:9:0", + "referencedDeclaration": 189, + "src": "2638:9:0", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$41_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$40_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract storage ref)" } }, - "id": 146, + "id": 145, "indexExpression": { "argumentTypes": null, - "id": 145, + "id": 144, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 141, - "src": "2667:11:0", + "referencedDeclaration": 140, + "src": "2648:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -7767,24 +7986,24 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "2657:22:0", + "src": "2638:22:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage", + "typeIdentifier": "t_struct$_LockContract_$40_storage", "typeString": "struct HashedTimelock.LockContract storage ref" } }, - "id": 147, + "id": 146, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", - "referencedDeclaration": 26, - "src": "2657:29:0", + "referencedDeclaration": 25, + "src": "2638:29:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, "nodeType": "BinaryOperation", @@ -7793,18 +8012,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 148, + "id": 147, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "2690:3:0", + "referencedDeclaration": 1636, + "src": "2671:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 149, + "id": 148, "isConstant": false, "isLValue": false, "isPure": false, @@ -7812,13 +8031,13 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "2690:10:0", + "src": "2671:10:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, - "src": "2657:43:0", + "src": "2638:43:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -7827,14 +8046,14 @@ { "argumentTypes": null, "hexValue": "726566756e6461626c653a206e6f742073656e646572", - "id": 151, + "id": 150, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2702:24:0", + "src": "2683:24:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_edd5bfdacb483bdf26b05ebe186281e97d155ca7c516ffe52d11b5e39d79c23a", @@ -7854,21 +8073,21 @@ "typeString": "literal_string \"refundable: not sender\"" } ], - "id": 143, + "id": 142, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "2649:7:0", + "referencedDeclaration": 1640, + "src": "2630:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 152, + "id": 151, "isConstant": false, "isLValue": false, "isPure": false, @@ -7876,15 +8095,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2649:78:0", + "src": "2630:78:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 153, + "id": 152, "nodeType": "ExpressionStatement", - "src": "2649:78:0" + "src": "2630:78:0" }, { "expression": { @@ -7896,7 +8115,7 @@ "typeIdentifier": "t_bool", "typeString": "bool" }, - "id": 160, + "id": 159, "isConstant": false, "isLValue": false, "isPure": false, @@ -7907,26 +8126,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 155, + "id": 154, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 190, - "src": "2745:9:0", + "referencedDeclaration": 189, + "src": "2726:9:0", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$41_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$40_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract storage ref)" } }, - "id": 157, + "id": 156, "indexExpression": { "argumentTypes": null, - "id": 156, + "id": 155, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 141, - "src": "2755:11:0", + "referencedDeclaration": 140, + "src": "2736:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -7937,21 +8156,21 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "2745:22:0", + "src": "2726:22:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage", + "typeIdentifier": "t_struct$_LockContract_$40_storage", "typeString": "struct HashedTimelock.LockContract storage ref" } }, - "id": 158, + "id": 157, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "refunded", "nodeType": "MemberAccess", - "referencedDeclaration": 38, - "src": "2745:31:0", + "referencedDeclaration": 37, + "src": "2726:31:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -7962,14 +8181,14 @@ "rightExpression": { "argumentTypes": null, "hexValue": "66616c7365", - "id": 159, + "id": 158, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "2780:5:0", + "src": "2761:5:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -7977,7 +8196,7 @@ }, "value": "false" }, - "src": "2745:40:0", + "src": "2726:40:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -7986,14 +8205,14 @@ { "argumentTypes": null, "hexValue": "726566756e6461626c653a20616c726561647920726566756e646564", - "id": 161, + "id": 160, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2787:30:0", + "src": "2768:30:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_7b29f51b209a34fdcf95e658d91750e2d1af4c6890c540f7ec9b6060ebd16007", @@ -8013,21 +8232,21 @@ "typeString": "literal_string \"refundable: already refunded\"" } ], - "id": 154, + "id": 153, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "2737:7:0", + "referencedDeclaration": 1640, + "src": "2718:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 162, + "id": 161, "isConstant": false, "isLValue": false, "isPure": false, @@ -8035,15 +8254,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2737:81:0", + "src": "2718:81:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 163, + "id": 162, "nodeType": "ExpressionStatement", - "src": "2737:81:0" + "src": "2718:81:0" }, { "expression": { @@ -8055,7 +8274,7 @@ "typeIdentifier": "t_bool", "typeString": "bool" }, - "id": 170, + "id": 169, "isConstant": false, "isLValue": false, "isPure": false, @@ -8066,26 +8285,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 165, + "id": 164, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 190, - "src": "2836:9:0", + "referencedDeclaration": 189, + "src": "2817:9:0", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$41_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$40_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract storage ref)" } }, - "id": 167, + "id": 166, "indexExpression": { "argumentTypes": null, - "id": 166, + "id": 165, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 141, - "src": "2846:11:0", + "referencedDeclaration": 140, + "src": "2827:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -8096,21 +8315,21 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "2836:22:0", + "src": "2817:22:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage", + "typeIdentifier": "t_struct$_LockContract_$40_storage", "typeString": "struct HashedTimelock.LockContract storage ref" } }, - "id": 168, + "id": 167, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "withdrawn", "nodeType": "MemberAccess", - "referencedDeclaration": 36, - "src": "2836:32:0", + "referencedDeclaration": 35, + "src": "2817:32:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -8121,14 +8340,14 @@ "rightExpression": { "argumentTypes": null, "hexValue": "66616c7365", - "id": 169, + "id": 168, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "2872:5:0", + "src": "2853:5:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -8136,7 +8355,7 @@ }, "value": "false" }, - "src": "2836:41:0", + "src": "2817:41:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -8145,14 +8364,14 @@ { "argumentTypes": null, "hexValue": "726566756e6461626c653a20616c72656164792077697468647261776e", - "id": 171, + "id": 170, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2879:31:0", + "src": "2860:31:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_3b5b42a6105acb76ce8eb8957616623bad95a1e8514f0d2809f4b82a9c3b0fce", @@ -8172,21 +8391,21 @@ "typeString": "literal_string \"refundable: already withdrawn\"" } ], - "id": 164, + "id": 163, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "2828:7:0", + "referencedDeclaration": 1640, + "src": "2809:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 172, + "id": 171, "isConstant": false, "isLValue": false, "isPure": false, @@ -8194,15 +8413,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2828:83:0", + "src": "2809:83:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 173, + "id": 172, "nodeType": "ExpressionStatement", - "src": "2828:83:0" + "src": "2809:83:0" }, { "expression": { @@ -8214,7 +8433,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 180, + "id": 179, "isConstant": false, "isLValue": false, "isPure": false, @@ -8225,26 +8444,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 175, + "id": 174, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 190, - "src": "2929:9:0", + "referencedDeclaration": 189, + "src": "2910:9:0", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$41_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$40_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract storage ref)" } }, - "id": 177, + "id": 176, "indexExpression": { "argumentTypes": null, - "id": 176, + "id": 175, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 141, - "src": "2939:11:0", + "referencedDeclaration": 140, + "src": "2920:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -8255,21 +8474,21 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "2929:22:0", + "src": "2910:22:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage", + "typeIdentifier": "t_struct$_LockContract_$40_storage", "typeString": "struct HashedTimelock.LockContract storage ref" } }, - "id": 178, + "id": 177, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "timelock", "nodeType": "MemberAccess", - "referencedDeclaration": 34, - "src": "2929:31:0", + "referencedDeclaration": 33, + "src": "2910:31:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -8279,18 +8498,18 @@ "operator": "<=", "rightExpression": { "argumentTypes": null, - "id": 179, + "id": 178, "name": "now", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1053, - "src": "2964:3:0", + "referencedDeclaration": 1638, + "src": "2945:3:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "2929:38:0", + "src": "2910:38:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -8299,14 +8518,14 @@ { "argumentTypes": null, "hexValue": "726566756e6461626c653a2074696d656c6f636b206e6f742079657420706173736564", - "id": 181, + "id": 180, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2969:37:0", + "src": "2950:37:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_53ffb24e93d3b349bff6339724d28c73880587cacedffccbcdea5da101fc50b9", @@ -8326,21 +8545,21 @@ "typeString": "literal_string \"refundable: timelock not yet passed\"" } ], - "id": 174, + "id": 173, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "2921:7:0", + "referencedDeclaration": 1640, + "src": "2902:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 182, + "id": 181, "isConstant": false, "isLValue": false, "isPure": false, @@ -8348,38 +8567,38 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2921:86:0", + "src": "2902:86:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 183, + "id": 182, "nodeType": "ExpressionStatement", - "src": "2921:86:0" + "src": "2902:86:0" }, { - "id": 184, + "id": 183, "nodeType": "PlaceholderStatement", - "src": "3017:1:0" + "src": "2998:1:0" } ] }, "documentation": null, - "id": 186, + "id": 185, "name": "refundable", "nodeType": "ModifierDefinition", "parameters": { - "id": 142, + "id": 141, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 141, + "id": 140, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 186, - "src": "2618:19:0", + "scope": 185, + "src": "2599:19:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -8387,10 +8606,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 140, + "id": 139, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "2618:7:0", + "src": "2599:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -8400,51 +8619,51 @@ "visibility": "internal" } ], - "src": "2617:21:0" + "src": "2598:21:0" }, - "src": "2598:427:0", + "src": "2579:427:0", "visibility": "internal" }, { "constant": false, - "id": 190, + "id": 189, "name": "contracts", "nodeType": "VariableDeclaration", - "scope": 425, - "src": "3031:43:0", + "scope": 437, + "src": "3012:43:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$41_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$40_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract)" }, "typeName": { - "id": 189, + "id": 188, "keyType": { - "id": 187, + "id": 186, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "3040:7:0", + "src": "3021:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "Mapping", - "src": "3031:33:0", + "src": "3012:33:0", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$41_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$40_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract)" }, "valueType": { "contractScope": null, - "id": 188, + "id": 187, "name": "LockContract", "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 41, - "src": "3051:12:0", + "referencedDeclaration": 40, + "src": "3032:12:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract" } } @@ -8454,26 +8673,26 @@ }, { "body": { - "id": 256, + "id": 255, "nodeType": "Block", - "src": "3773:869:0", + "src": "3762:869:0", "statements": [ { "expression": { "argumentTypes": null, - "id": 219, + "id": 218, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, - "id": 206, + "id": 205, "name": "contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "3783:10:0", + "referencedDeclaration": 203, + "src": "3772:10:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -8491,18 +8710,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 210, + "id": 209, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "3850:3:0", + "referencedDeclaration": 1636, + "src": "3839:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 211, + "id": 210, "isConstant": false, "isLValue": false, "isPure": false, @@ -8510,41 +8729,41 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "3850:10:0", + "src": "3839:10:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, { "argumentTypes": null, - "id": 212, + "id": 211, "name": "_receiver", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 192, - "src": "3878:9:0", + "referencedDeclaration": 191, + "src": "3867:9:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, { "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 213, + "id": 212, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "3905:3:0", + "referencedDeclaration": 1636, + "src": "3894:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 214, + "id": 213, "isConstant": false, "isLValue": false, "isPure": false, @@ -8552,7 +8771,7 @@ "memberName": "value", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "3905:9:0", + "src": "3894:9:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -8560,12 +8779,12 @@ }, { "argumentTypes": null, - "id": 215, + "id": 214, "name": "_hashlock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 194, - "src": "3932:9:0", + "referencedDeclaration": 193, + "src": "3921:9:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -8573,12 +8792,12 @@ }, { "argumentTypes": null, - "id": 216, + "id": 215, "name": "_timelock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 196, - "src": "3959:9:0", + "referencedDeclaration": 195, + "src": "3948:9:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -8588,12 +8807,12 @@ "expression": { "argumentTypes": [ { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, { "typeIdentifier": "t_uint256", @@ -8610,18 +8829,18 @@ ], "expression": { "argumentTypes": null, - "id": 208, + "id": 207, "name": "abi", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1038, - "src": "3816:3:0", + "referencedDeclaration": 1623, + "src": "3805:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_abi", "typeString": "abi" } }, - "id": 209, + "id": 208, "isConstant": false, "isLValue": false, "isPure": true, @@ -8629,13 +8848,13 @@ "memberName": "encodePacked", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "3816:16:0", + "src": "3805:16:0", "typeDescriptions": { "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", "typeString": "function () pure returns (bytes memory)" } }, - "id": 217, + "id": 216, "isConstant": false, "isLValue": false, "isPure": false, @@ -8643,7 +8862,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "3816:166:0", + "src": "3805:166:0", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" @@ -8657,18 +8876,18 @@ "typeString": "bytes memory" } ], - "id": 207, + "id": 206, "name": "sha256", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1060, - "src": "3796:6:0", + "referencedDeclaration": 1645, + "src": "3785:6:0", "typeDescriptions": { - "typeIdentifier": "t_function_sha256_pure$__$returns$_t_bytes32_$", - "typeString": "function () pure returns (bytes32)" + "typeIdentifier": "t_function_sha256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" } }, - "id": 218, + "id": 217, "isConstant": false, "isLValue": false, "isPure": false, @@ -8676,21 +8895,21 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "3796:196:0", + "src": "3785:196:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "src": "3783:209:0", + "src": "3772:209:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "id": 220, + "id": 219, "nodeType": "ExpressionStatement", - "src": "3783:209:0" + "src": "3772:209:0" }, { "condition": { @@ -8698,12 +8917,12 @@ "arguments": [ { "argumentTypes": null, - "id": 222, + "id": 221, "name": "contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "4198:10:0", + "referencedDeclaration": 203, + "src": "4187:10:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -8717,18 +8936,18 @@ "typeString": "bytes32" } ], - "id": 221, + "id": 220, "name": "haveContract", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 424, - "src": "4185:12:0", + "referencedDeclaration": 436, + "src": "4174:12:0", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bool_$", "typeString": "function (bytes32) view returns (bool)" } }, - "id": 223, + "id": 222, "isConstant": false, "isLValue": false, "isPure": false, @@ -8736,37 +8955,37 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "4185:24:0", + "src": "4174:24:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, - "id": 227, + "id": 226, "nodeType": "IfStatement", - "src": "4181:50:0", + "src": "4170:50:0", "trueBody": { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], - "id": 224, + "id": 223, "name": "revert", "nodeType": "Identifier", "overloadedDeclarations": [ - 1056, - 1057 + 1641, + 1642 ], - "referencedDeclaration": 1056, - "src": "4223:6:0", + "referencedDeclaration": 1641, + "src": "4212:6:0", "typeDescriptions": { "typeIdentifier": "t_function_revert_pure$__$returns$__$", "typeString": "function () pure" } }, - "id": 225, + "id": 224, "isConstant": false, "isLValue": false, "isPure": false, @@ -8774,21 +8993,21 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "4223:8:0", + "src": "4212:8:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 226, + "id": 225, "nodeType": "ExpressionStatement", - "src": "4223:8:0" + "src": "4212:8:0" } }, { "expression": { "argumentTypes": null, - "id": 243, + "id": 242, "isConstant": false, "isLValue": false, "isPure": false, @@ -8797,26 +9016,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 228, + "id": 227, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 190, - "src": "4242:9:0", + "referencedDeclaration": 189, + "src": "4231:9:0", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$41_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$40_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract storage ref)" } }, - "id": 230, + "id": 229, "indexExpression": { "argumentTypes": null, - "id": 229, + "id": 228, "name": "contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "4252:10:0", + "referencedDeclaration": 203, + "src": "4241:10:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -8827,9 +9046,9 @@ "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", - "src": "4242:21:0", + "src": "4231:21:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage", + "typeIdentifier": "t_struct$_LockContract_$40_storage", "typeString": "struct HashedTimelock.LockContract storage ref" } }, @@ -8842,18 +9061,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 232, + "id": 231, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "4292:3:0", + "referencedDeclaration": 1636, + "src": "4281:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 233, + "id": 232, "isConstant": false, "isLValue": false, "isPure": false, @@ -8861,41 +9080,41 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "4292:10:0", + "src": "4281:10:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, { "argumentTypes": null, - "id": 234, + "id": 233, "name": "_receiver", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 192, - "src": "4316:9:0", + "referencedDeclaration": 191, + "src": "4305:9:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, { "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 235, + "id": 234, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "4339:3:0", + "referencedDeclaration": 1636, + "src": "4328:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 236, + "id": 235, "isConstant": false, "isLValue": false, "isPure": false, @@ -8903,7 +9122,7 @@ "memberName": "value", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "4339:9:0", + "src": "4328:9:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -8911,12 +9130,12 @@ }, { "argumentTypes": null, - "id": 237, + "id": 236, "name": "_hashlock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 194, - "src": "4362:9:0", + "referencedDeclaration": 193, + "src": "4351:9:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -8924,12 +9143,12 @@ }, { "argumentTypes": null, - "id": 238, + "id": 237, "name": "_timelock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 196, - "src": "4385:9:0", + "referencedDeclaration": 195, + "src": "4374:9:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -8938,14 +9157,14 @@ { "argumentTypes": null, "hexValue": "66616c7365", - "id": 239, + "id": 238, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "4408:5:0", + "src": "4397:5:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -8956,14 +9175,14 @@ { "argumentTypes": null, "hexValue": "66616c7365", - "id": 240, + "id": 239, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "4427:5:0", + "src": "4416:5:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -8974,14 +9193,14 @@ { "argumentTypes": null, "hexValue": "307830", - "id": 241, + "id": 240, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "4446:3:0", + "src": "4435:3:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", @@ -8993,12 +9212,12 @@ "expression": { "argumentTypes": [ { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, { "typeIdentifier": "t_uint256", @@ -9025,18 +9244,18 @@ "typeString": "int_const 0" } ], - "id": 231, + "id": 230, "name": "LockContract", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 41, - "src": "4266:12:0", + "referencedDeclaration": 40, + "src": "4255:12:0", "typeDescriptions": { - "typeIdentifier": "t_type$_t_struct$_LockContract_$41_storage_ptr_$", + "typeIdentifier": "t_type$_t_struct$_LockContract_$40_storage_ptr_$", "typeString": "type(struct HashedTimelock.LockContract storage pointer)" } }, - "id": 242, + "id": 241, "isConstant": false, "isLValue": false, "isPure": false, @@ -9044,21 +9263,21 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "4266:193:0", + "src": "4255:193:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_memory", + "typeIdentifier": "t_struct$_LockContract_$40_memory", "typeString": "struct HashedTimelock.LockContract memory" } }, - "src": "4242:217:0", + "src": "4231:217:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage", + "typeIdentifier": "t_struct$_LockContract_$40_storage", "typeString": "struct HashedTimelock.LockContract storage ref" } }, - "id": 244, + "id": 243, "nodeType": "ExpressionStatement", - "src": "4242:217:0" + "src": "4231:217:0" }, { "eventCall": { @@ -9066,12 +9285,12 @@ "arguments": [ { "argumentTypes": null, - "id": 246, + "id": 245, "name": "contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "4499:10:0", + "referencedDeclaration": 203, + "src": "4488:10:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -9081,18 +9300,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 247, + "id": 246, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "4523:3:0", + "referencedDeclaration": 1636, + "src": "4512:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 248, + "id": 247, "isConstant": false, "isLValue": false, "isPure": false, @@ -9100,41 +9319,41 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "4523:10:0", + "src": "4512:10:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, { "argumentTypes": null, - "id": 249, + "id": 248, "name": "_receiver", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 192, - "src": "4547:9:0", + "referencedDeclaration": 191, + "src": "4536:9:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, { "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 250, + "id": 249, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "4570:3:0", + "referencedDeclaration": 1636, + "src": "4559:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 251, + "id": 250, "isConstant": false, "isLValue": false, "isPure": false, @@ -9142,7 +9361,7 @@ "memberName": "value", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "4570:9:0", + "src": "4559:9:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -9150,12 +9369,12 @@ }, { "argumentTypes": null, - "id": 252, + "id": 251, "name": "_hashlock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 194, - "src": "4593:9:0", + "referencedDeclaration": 193, + "src": "4582:9:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -9163,12 +9382,12 @@ }, { "argumentTypes": null, - "id": 253, + "id": 252, "name": "_timelock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 196, - "src": "4616:9:0", + "referencedDeclaration": 195, + "src": "4605:9:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -9182,12 +9401,12 @@ "typeString": "bytes32" }, { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, { "typeIdentifier": "t_uint256", @@ -9202,18 +9421,18 @@ "typeString": "uint256" } ], - "id": 245, + "id": 244, "name": "LogHTLCNew", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 16, - "src": "4475:10:0", + "referencedDeclaration": 15, + "src": "4464:10:0", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_address_$_t_uint256_$_t_bytes32_$_t_uint256_$returns$__$", "typeString": "function (bytes32,address,address,uint256,bytes32,uint256)" } }, - "id": 254, + "id": 253, "isConstant": false, "isLValue": false, "isPure": false, @@ -9221,104 +9440,104 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "4475:160:0", + "src": "4464:160:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 255, + "id": 254, "nodeType": "EmitStatement", - "src": "4470:165:0" + "src": "4459:165:0" } ] }, "documentation": "@dev Sender sets up a new hash time lock contract depositing the ETH and \nproviding the reciever lock terms.\n * @param _receiver Receiver of the ETH.\n@param _hashlock A sha-2 sha256 hash hashlock.\n@param _timelock UNIX epoch seconds time that the lock expires at. \n Refunds can be made after this time.\n@return contractId Id of the new HTLC. This is needed for subsequent \n calls.", - "id": 257, + "id": 256, "implemented": true, - "isConstructor": false, - "isDeclaredConst": false, + "kind": "function", "modifiers": [ { "arguments": null, - "id": 199, + "id": 198, "modifierName": { "argumentTypes": null, - "id": 198, + "id": 197, "name": "fundsSent", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 53, - "src": "3688:9:0", + "referencedDeclaration": 52, + "src": "3677:9:0", "typeDescriptions": { "typeIdentifier": "t_modifier$__$", "typeString": "modifier ()" } }, "nodeType": "ModifierInvocation", - "src": "3688:9:0" + "src": "3677:9:0" }, { "arguments": [ { "argumentTypes": null, - "id": 201, + "id": 200, "name": "_timelock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 196, - "src": "3721:9:0", + "referencedDeclaration": 195, + "src": "3710:9:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], - "id": 202, + "id": 201, "modifierName": { "argumentTypes": null, - "id": 200, + "id": 199, "name": "futureTimelock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 66, - "src": "3706:14:0", + "referencedDeclaration": 65, + "src": "3695:14:0", "typeDescriptions": { "typeIdentifier": "t_modifier$_t_uint256_$", "typeString": "modifier (uint256)" } }, "nodeType": "ModifierInvocation", - "src": "3706:25:0" + "src": "3695:25:0" } ], "name": "newContract", "nodeType": "FunctionDefinition", "parameters": { - "id": 197, + "id": 196, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 192, + "id": 191, "name": "_receiver", "nodeType": "VariableDeclaration", - "scope": 257, - "src": "3593:17:0", + "scope": 256, + "src": "3574:25:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, "typeName": { - "id": 191, + "id": 190, "name": "address", "nodeType": "ElementaryTypeName", - "src": "3593:7:0", + "src": "3574:15:0", + "stateMutability": "payable", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, "value": null, @@ -9326,11 +9545,11 @@ }, { "constant": false, - "id": 194, + "id": 193, "name": "_hashlock", "nodeType": "VariableDeclaration", - "scope": 257, - "src": "3612:17:0", + "scope": 256, + "src": "3601:17:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -9338,10 +9557,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 193, + "id": 192, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "3612:7:0", + "src": "3601:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -9352,11 +9571,11 @@ }, { "constant": false, - "id": 196, + "id": 195, "name": "_timelock", "nodeType": "VariableDeclaration", - "scope": 257, - "src": "3631:14:0", + "scope": 256, + "src": "3620:14:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -9364,10 +9583,10 @@ "typeString": "uint256" }, "typeName": { - "id": 195, + "id": 194, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "3631:4:0", + "src": "3620:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -9377,20 +9596,19 @@ "visibility": "internal" } ], - "src": "3592:54:0" + "src": "3573:62:0" }, - "payable": true, "returnParameters": { - "id": 205, + "id": 204, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 204, + "id": 203, "name": "contractId", "nodeType": "VariableDeclaration", - "scope": 257, - "src": "3749:18:0", + "scope": 256, + "src": "3738:18:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -9398,10 +9616,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 203, + "id": 202, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "3749:7:0", + "src": "3738:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -9411,47 +9629,47 @@ "visibility": "internal" } ], - "src": "3748:20:0" + "src": "3737:20:0" }, - "scope": 425, - "src": "3572:1070:0", + "scope": 437, + "src": "3553:1078:0", "stateMutability": "payable", "superFunction": null, "visibility": "external" }, { "body": { - "id": 309, + "id": 308, "nodeType": "Block", - "src": "5188:227:0", + "src": "5177:227:0", "statements": [ { "assignments": [ - 277 + 276 ], "declarations": [ { "constant": false, - "id": 277, + "id": 276, "name": "c", "nodeType": "VariableDeclaration", - "scope": 309, - "src": "5198:22:0", + "scope": 308, + "src": "5187:22:0", "stateVariable": false, "storageLocation": "storage", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract" }, "typeName": { "contractScope": null, - "id": 276, + "id": 275, "name": "LockContract", "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 41, - "src": "5198:12:0", + "referencedDeclaration": 40, + "src": "5187:12:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract" } }, @@ -9459,31 +9677,31 @@ "visibility": "internal" } ], - "id": 281, + "id": 280, "initialValue": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 278, + "id": 277, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 190, - "src": "5223:9:0", + "referencedDeclaration": 189, + "src": "5212:9:0", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$41_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$40_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract storage ref)" } }, - "id": 280, + "id": 279, "indexExpression": { "argumentTypes": null, - "id": 279, + "id": 278, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 259, - "src": "5233:11:0", + "referencedDeclaration": 258, + "src": "5222:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -9494,19 +9712,19 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "5223:22:0", + "src": "5212:22:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage", + "typeIdentifier": "t_struct$_LockContract_$40_storage", "typeString": "struct HashedTimelock.LockContract storage ref" } }, "nodeType": "VariableDeclarationStatement", - "src": "5198:47:0" + "src": "5187:47:0" }, { "expression": { "argumentTypes": null, - "id": 286, + "id": 285, "isConstant": false, "isLValue": false, "isPure": false, @@ -9515,26 +9733,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 282, + "id": 281, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 277, - "src": "5255:1:0", + "referencedDeclaration": 276, + "src": "5244:1:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract storage pointer" } }, - "id": 284, + "id": 283, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "memberName": "preimage", "nodeType": "MemberAccess", - "referencedDeclaration": 40, - "src": "5255:10:0", + "referencedDeclaration": 39, + "src": "5244:10:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -9544,31 +9762,31 @@ "operator": "=", "rightHandSide": { "argumentTypes": null, - "id": 285, + "id": 284, "name": "_preimage", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "5268:9:0", + "referencedDeclaration": 260, + "src": "5257:9:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "src": "5255:22:0", + "src": "5244:22:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "id": 287, + "id": 286, "nodeType": "ExpressionStatement", - "src": "5255:22:0" + "src": "5244:22:0" }, { "expression": { "argumentTypes": null, - "id": 292, + "id": 291, "isConstant": false, "isLValue": false, "isPure": false, @@ -9577,26 +9795,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 288, + "id": 287, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 277, - "src": "5287:1:0", + "referencedDeclaration": 276, + "src": "5276:1:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract storage pointer" } }, - "id": 290, + "id": 289, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "memberName": "withdrawn", "nodeType": "MemberAccess", - "referencedDeclaration": 36, - "src": "5287:11:0", + "referencedDeclaration": 35, + "src": "5276:11:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -9607,14 +9825,14 @@ "rightHandSide": { "argumentTypes": null, "hexValue": "74727565", - "id": 291, + "id": 290, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "5301:4:0", + "src": "5290:4:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -9622,15 +9840,15 @@ }, "value": "true" }, - "src": "5287:18:0", + "src": "5276:18:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "id": 293, + "id": 292, "nodeType": "ExpressionStatement", - "src": "5287:18:0" + "src": "5276:18:0" }, { "expression": { @@ -9640,26 +9858,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 299, + "id": 298, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 277, - "src": "5335:1:0", + "referencedDeclaration": 276, + "src": "5324:1:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract storage pointer" } }, - "id": 300, + "id": 299, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "amount", "nodeType": "MemberAccess", - "referencedDeclaration": 30, - "src": "5335:8:0", + "referencedDeclaration": 29, + "src": "5324:8:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -9677,32 +9895,32 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 294, + "id": 293, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 277, - "src": "5315:1:0", + "referencedDeclaration": 276, + "src": "5304:1:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract storage pointer" } }, - "id": 297, + "id": 296, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "receiver", "nodeType": "MemberAccess", - "referencedDeclaration": 28, - "src": "5315:10:0", + "referencedDeclaration": 27, + "src": "5304:10:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, - "id": 298, + "id": 297, "isConstant": false, "isLValue": false, "isPure": false, @@ -9710,13 +9928,13 @@ "memberName": "transfer", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "5315:19:0", + "src": "5304:19:0", "typeDescriptions": { "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", "typeString": "function (uint256)" } }, - "id": 301, + "id": 300, "isConstant": false, "isLValue": false, "isPure": false, @@ -9724,15 +9942,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "5315:29:0", + "src": "5304:29:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 302, + "id": 301, "nodeType": "ExpressionStatement", - "src": "5315:29:0" + "src": "5304:29:0" }, { "eventCall": { @@ -9740,12 +9958,12 @@ "arguments": [ { "argumentTypes": null, - "id": 304, + "id": 303, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 259, - "src": "5375:11:0", + "referencedDeclaration": 258, + "src": "5364:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -9759,18 +9977,18 @@ "typeString": "bytes32" } ], - "id": 303, + "id": 302, "name": "LogHTLCWithdraw", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "5359:15:0", + "referencedDeclaration": 19, + "src": "5348:15:0", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$returns$__$", "typeString": "function (bytes32)" } }, - "id": 305, + "id": 304, "isConstant": false, "isLValue": false, "isPure": false, @@ -9778,28 +9996,28 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "5359:28:0", + "src": "5348:28:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 306, + "id": 305, "nodeType": "EmitStatement", - "src": "5354:33:0" + "src": "5343:33:0" }, { "expression": { "argumentTypes": null, "hexValue": "74727565", - "id": 307, + "id": 306, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "5404:4:0", + "src": "5393:4:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -9807,62 +10025,61 @@ }, "value": "true" }, - "functionReturnParameters": 275, - "id": 308, + "functionReturnParameters": 274, + "id": 307, "nodeType": "Return", - "src": "5397:11:0" + "src": "5386:11:0" } ] }, "documentation": "@dev Called by the receiver once they know the preimage of the hashlock.\nThis will transfer the locked funds to their address.\n * @param _contractId Id of the HTLC.\n@param _preimage sha256(_preimage) should equal the contract hashlock.\n@return bool true on success", - "id": 310, + "id": 309, "implemented": true, - "isConstructor": false, - "isDeclaredConst": false, + "kind": "function", "modifiers": [ { "arguments": [ { "argumentTypes": null, - "id": 264, + "id": 263, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 259, - "src": "5066:11:0", + "referencedDeclaration": 258, + "src": "5055:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], - "id": 265, + "id": 264, "modifierName": { "argumentTypes": null, - "id": 263, + "id": 262, "name": "contractExists", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "5051:14:0", + "referencedDeclaration": 78, + "src": "5040:14:0", "typeDescriptions": { "typeIdentifier": "t_modifier$_t_bytes32_$", "typeString": "modifier (bytes32)" } }, "nodeType": "ModifierInvocation", - "src": "5051:27:0" + "src": "5040:27:0" }, { "arguments": [ { "argumentTypes": null, - "id": 267, + "id": 266, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 259, - "src": "5103:11:0", + "referencedDeclaration": 258, + "src": "5092:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -9870,82 +10087,82 @@ }, { "argumentTypes": null, - "id": 268, + "id": 267, "name": "_preimage", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "5116:9:0", + "referencedDeclaration": 260, + "src": "5105:9:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], - "id": 269, + "id": 268, "modifierName": { "argumentTypes": null, - "id": 266, + "id": 265, "name": "hashlockMatches", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 102, - "src": "5087:15:0", + "referencedDeclaration": 101, + "src": "5076:15:0", "typeDescriptions": { "typeIdentifier": "t_modifier$_t_bytes32_$_t_bytes32_$", "typeString": "modifier (bytes32,bytes32)" } }, "nodeType": "ModifierInvocation", - "src": "5087:39:0" + "src": "5076:39:0" }, { "arguments": [ { "argumentTypes": null, - "id": 271, + "id": 270, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 259, - "src": "5148:11:0", + "referencedDeclaration": 258, + "src": "5137:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], - "id": 272, + "id": 271, "modifierName": { "argumentTypes": null, - "id": 270, + "id": 269, "name": "withdrawable", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 139, - "src": "5135:12:0", + "referencedDeclaration": 138, + "src": "5124:12:0", "typeDescriptions": { "typeIdentifier": "t_modifier$_t_bytes32_$", "typeString": "modifier (bytes32)" } }, "nodeType": "ModifierInvocation", - "src": "5135:25:0" + "src": "5124:25:0" } ], "name": "withdraw", "nodeType": "FunctionDefinition", "parameters": { - "id": 262, + "id": 261, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 259, + "id": 258, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 310, - "src": "4986:19:0", + "scope": 309, + "src": "4975:19:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -9953,10 +10170,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 258, + "id": 257, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "4986:7:0", + "src": "4975:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -9967,11 +10184,11 @@ }, { "constant": false, - "id": 261, + "id": 260, "name": "_preimage", "nodeType": "VariableDeclaration", - "scope": 310, - "src": "5007:17:0", + "scope": 309, + "src": "4996:17:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -9979,10 +10196,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 260, + "id": 259, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "5007:7:0", + "src": "4996:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -9992,20 +10209,19 @@ "visibility": "internal" } ], - "src": "4985:40:0" + "src": "4974:40:0" }, - "payable": false, "returnParameters": { - "id": 275, + "id": 274, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 274, + "id": 273, "name": "", "nodeType": "VariableDeclaration", - "scope": 310, - "src": "5178:4:0", + "scope": 309, + "src": "5167:4:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -10013,10 +10229,10 @@ "typeString": "bool" }, "typeName": { - "id": 273, + "id": 272, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "5178:4:0", + "src": "5167:4:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -10026,47 +10242,47 @@ "visibility": "internal" } ], - "src": "5177:6:0" + "src": "5166:6:0" }, - "scope": 425, - "src": "4968:447:0", + "scope": 437, + "src": "4957:447:0", "stateMutability": "nonpayable", "superFunction": null, "visibility": "external" }, { "body": { - "id": 350, + "id": 349, "nodeType": "Block", - "src": "5816:190:0", + "src": "5805:190:0", "statements": [ { "assignments": [ - 324 + 323 ], "declarations": [ { "constant": false, - "id": 324, + "id": 323, "name": "c", "nodeType": "VariableDeclaration", - "scope": 350, - "src": "5826:22:0", + "scope": 349, + "src": "5815:22:0", "stateVariable": false, "storageLocation": "storage", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract" }, "typeName": { "contractScope": null, - "id": 323, + "id": 322, "name": "LockContract", "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 41, - "src": "5826:12:0", + "referencedDeclaration": 40, + "src": "5815:12:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract" } }, @@ -10074,31 +10290,31 @@ "visibility": "internal" } ], - "id": 328, + "id": 327, "initialValue": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 325, + "id": 324, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 190, - "src": "5851:9:0", + "referencedDeclaration": 189, + "src": "5840:9:0", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$41_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$40_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract storage ref)" } }, - "id": 327, + "id": 326, "indexExpression": { "argumentTypes": null, - "id": 326, + "id": 325, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 312, - "src": "5861:11:0", + "referencedDeclaration": 311, + "src": "5850:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -10109,19 +10325,19 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "5851:22:0", + "src": "5840:22:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage", + "typeIdentifier": "t_struct$_LockContract_$40_storage", "typeString": "struct HashedTimelock.LockContract storage ref" } }, "nodeType": "VariableDeclarationStatement", - "src": "5826:47:0" + "src": "5815:47:0" }, { "expression": { "argumentTypes": null, - "id": 333, + "id": 332, "isConstant": false, "isLValue": false, "isPure": false, @@ -10130,26 +10346,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 329, + "id": 328, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 324, - "src": "5883:1:0", + "referencedDeclaration": 323, + "src": "5872:1:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract storage pointer" } }, - "id": 331, + "id": 330, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "memberName": "refunded", "nodeType": "MemberAccess", - "referencedDeclaration": 38, - "src": "5883:10:0", + "referencedDeclaration": 37, + "src": "5872:10:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -10160,14 +10376,14 @@ "rightHandSide": { "argumentTypes": null, "hexValue": "74727565", - "id": 332, + "id": 331, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "5896:4:0", + "src": "5885:4:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -10175,15 +10391,15 @@ }, "value": "true" }, - "src": "5883:17:0", + "src": "5872:17:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "id": 334, + "id": 333, "nodeType": "ExpressionStatement", - "src": "5883:17:0" + "src": "5872:17:0" }, { "expression": { @@ -10193,26 +10409,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 340, + "id": 339, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 324, - "src": "5928:1:0", + "referencedDeclaration": 323, + "src": "5917:1:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract storage pointer" } }, - "id": 341, + "id": 340, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "amount", "nodeType": "MemberAccess", - "referencedDeclaration": 30, - "src": "5928:8:0", + "referencedDeclaration": 29, + "src": "5917:8:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -10230,32 +10446,32 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 335, + "id": 334, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 324, - "src": "5910:1:0", + "referencedDeclaration": 323, + "src": "5899:1:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract storage pointer" } }, - "id": 338, + "id": 337, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", - "referencedDeclaration": 26, - "src": "5910:8:0", + "referencedDeclaration": 25, + "src": "5899:8:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, - "id": 339, + "id": 338, "isConstant": false, "isLValue": false, "isPure": false, @@ -10263,13 +10479,13 @@ "memberName": "transfer", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "5910:17:0", + "src": "5899:17:0", "typeDescriptions": { "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", "typeString": "function (uint256)" } }, - "id": 342, + "id": 341, "isConstant": false, "isLValue": false, "isPure": false, @@ -10277,15 +10493,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "5910:27:0", + "src": "5899:27:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 343, + "id": 342, "nodeType": "ExpressionStatement", - "src": "5910:27:0" + "src": "5899:27:0" }, { "eventCall": { @@ -10293,12 +10509,12 @@ "arguments": [ { "argumentTypes": null, - "id": 345, + "id": 344, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 312, - "src": "5966:11:0", + "referencedDeclaration": 311, + "src": "5955:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -10312,18 +10528,18 @@ "typeString": "bytes32" } ], - "id": 344, + "id": 343, "name": "LogHTLCRefund", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 24, - "src": "5952:13:0", + "referencedDeclaration": 23, + "src": "5941:13:0", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$returns$__$", "typeString": "function (bytes32)" } }, - "id": 346, + "id": 345, "isConstant": false, "isLValue": false, "isPure": false, @@ -10331,28 +10547,28 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "5952:26:0", + "src": "5941:26:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 347, + "id": 346, "nodeType": "EmitStatement", - "src": "5947:31:0" + "src": "5936:31:0" }, { "expression": { "argumentTypes": null, "hexValue": "74727565", - "id": 348, + "id": 347, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "5995:4:0", + "src": "5984:4:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -10360,99 +10576,98 @@ }, "value": "true" }, - "functionReturnParameters": 322, - "id": 349, + "functionReturnParameters": 321, + "id": 348, "nodeType": "Return", - "src": "5988:11:0" + "src": "5977:11:0" } ] }, "documentation": "@dev Called by the sender if there was no withdraw AND the time lock has\nexpired. This will refund the contract amount.\n * @param _contractId Id of HTLC to refund from.\n@return bool true on success", - "id": 351, + "id": 350, "implemented": true, - "isConstructor": false, - "isDeclaredConst": false, + "kind": "function", "modifiers": [ { "arguments": [ { "argumentTypes": null, - "id": 315, + "id": 314, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 312, - "src": "5744:11:0", + "referencedDeclaration": 311, + "src": "5733:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], - "id": 316, + "id": 315, "modifierName": { "argumentTypes": null, - "id": 314, + "id": 313, "name": "contractExists", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "5729:14:0", + "referencedDeclaration": 78, + "src": "5718:14:0", "typeDescriptions": { "typeIdentifier": "t_modifier$_t_bytes32_$", "typeString": "modifier (bytes32)" } }, "nodeType": "ModifierInvocation", - "src": "5729:27:0" + "src": "5718:27:0" }, { "arguments": [ { "argumentTypes": null, - "id": 318, + "id": 317, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 312, - "src": "5776:11:0", + "referencedDeclaration": 311, + "src": "5765:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], - "id": 319, + "id": 318, "modifierName": { "argumentTypes": null, - "id": 317, + "id": 316, "name": "refundable", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 186, - "src": "5765:10:0", + "referencedDeclaration": 185, + "src": "5754:10:0", "typeDescriptions": { "typeIdentifier": "t_modifier$_t_bytes32_$", "typeString": "modifier (bytes32)" } }, "nodeType": "ModifierInvocation", - "src": "5765:23:0" + "src": "5754:23:0" } ], "name": "refund", "nodeType": "FunctionDefinition", "parameters": { - "id": 313, + "id": 312, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 312, + "id": 311, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 351, - "src": "5683:19:0", + "scope": 350, + "src": "5672:19:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -10460,10 +10675,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 311, + "id": 310, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "5683:7:0", + "src": "5672:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -10473,20 +10688,19 @@ "visibility": "internal" } ], - "src": "5682:21:0" + "src": "5671:21:0" }, - "payable": false, "returnParameters": { - "id": 322, + "id": 321, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 321, + "id": 320, "name": "", "nodeType": "VariableDeclaration", - "scope": 351, - "src": "5806:4:0", + "scope": 350, + "src": "5795:4:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -10494,10 +10708,10 @@ "typeString": "bool" }, "typeName": { - "id": 320, + "id": 319, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "5806:4:0", + "src": "5795:4:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -10507,19 +10721,19 @@ "visibility": "internal" } ], - "src": "5805:6:0" + "src": "5794:6:0" }, - "scope": 425, - "src": "5667:339:0", + "scope": 437, + "src": "5656:339:0", "stateMutability": "nonpayable", "superFunction": null, "visibility": "external" }, { "body": { - "id": 403, + "id": 415, "nodeType": "Block", - "src": "6505:258:0", + "src": "6494:309:0", "statements": [ { "condition": { @@ -10528,7 +10742,7 @@ "typeIdentifier": "t_bool", "typeString": "bool" }, - "id": 376, + "id": 375, "isConstant": false, "isLValue": false, "isPure": false, @@ -10538,12 +10752,12 @@ "arguments": [ { "argumentTypes": null, - "id": 373, + "id": 372, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 353, - "src": "6532:11:0", + "referencedDeclaration": 352, + "src": "6521:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -10557,18 +10771,18 @@ "typeString": "bytes32" } ], - "id": 372, + "id": 371, "name": "haveContract", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 424, - "src": "6519:12:0", + "referencedDeclaration": 436, + "src": "6508:12:0", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bool_$", "typeString": "function (bytes32) view returns (bool)" } }, - "id": 374, + "id": 373, "isConstant": false, "isLValue": false, "isPure": false, @@ -10576,7 +10790,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "6519:25:0", + "src": "6508:25:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -10587,14 +10801,14 @@ "rightExpression": { "argumentTypes": null, "hexValue": "66616c7365", - "id": 375, + "id": 374, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "6548:5:0", + "src": "6537:5:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -10602,51 +10816,287 @@ }, "value": "false" }, - "src": "6519:34:0", + "src": "6508:34:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, - "id": 378, + "id": 390, "nodeType": "IfStatement", - "src": "6515:59:0", + "src": "6504:109:0", "trueBody": { - "expression": null, - "functionReturnParameters": 371, - "id": 377, + "expression": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 377, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6572:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 376, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6564:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 378, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6564:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 380, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6584:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 379, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6576:7:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 381, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6576:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 382, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6588:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 383, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6591:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 384, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6594:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 385, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6597:5:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 386, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6604:5:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 387, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6611:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "id": 388, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "6563:50:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_address_payable_$_t_address_payable_$_t_rational_0_by_1_$_t_rational_0_by_1_$_t_rational_0_by_1_$_t_bool_$_t_bool_$_t_rational_0_by_1_$", + "typeString": "tuple(address payable,address payable,int_const 0,int_const 0,int_const 0,bool,bool,int_const 0)" + } + }, + "functionReturnParameters": 370, + "id": 389, "nodeType": "Return", - "src": "6567:7:0" + "src": "6556:57:0" } }, { "assignments": [ - 380 + 392 ], "declarations": [ { "constant": false, - "id": 380, + "id": 392, "name": "c", "nodeType": "VariableDeclaration", - "scope": 403, - "src": "6583:22:0", + "scope": 415, + "src": "6623:22:0", "stateVariable": false, "storageLocation": "storage", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract" }, "typeName": { "contractScope": null, - "id": 379, + "id": 391, "name": "LockContract", "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 41, - "src": "6583:12:0", + "referencedDeclaration": 40, + "src": "6623:12:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract" } }, @@ -10654,31 +11104,31 @@ "visibility": "internal" } ], - "id": 384, + "id": 396, "initialValue": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 381, + "id": 393, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 190, - "src": "6608:9:0", + "referencedDeclaration": 189, + "src": "6648:9:0", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$41_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$40_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract storage ref)" } }, - "id": 383, + "id": 395, "indexExpression": { "argumentTypes": null, - "id": 382, + "id": 394, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 353, - "src": "6618:11:0", + "referencedDeclaration": 352, + "src": "6658:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -10689,14 +11139,14 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "6608:22:0", + "src": "6648:22:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage", + "typeIdentifier": "t_struct$_LockContract_$40_storage", "typeString": "struct HashedTimelock.LockContract storage ref" } }, "nodeType": "VariableDeclarationStatement", - "src": "6583:47:0" + "src": "6623:47:0" }, { "expression": { @@ -10706,84 +11156,84 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 385, + "id": 397, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 380, - "src": "6648:1:0", + "referencedDeclaration": 392, + "src": "6688:1:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract storage pointer" } }, - "id": 386, + "id": 398, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", - "referencedDeclaration": 26, - "src": "6648:8:0", + "referencedDeclaration": 25, + "src": "6688:8:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, { "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 387, + "id": 399, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 380, - "src": "6658:1:0", + "referencedDeclaration": 392, + "src": "6698:1:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract storage pointer" } }, - "id": 388, + "id": 400, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "receiver", "nodeType": "MemberAccess", - "referencedDeclaration": 28, - "src": "6658:10:0", + "referencedDeclaration": 27, + "src": "6698:10:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, { "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 389, + "id": 401, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 380, - "src": "6670:1:0", + "referencedDeclaration": 392, + "src": "6710:1:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract storage pointer" } }, - "id": 390, + "id": 402, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "amount", "nodeType": "MemberAccess", - "referencedDeclaration": 30, - "src": "6670:8:0", + "referencedDeclaration": 29, + "src": "6710:8:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -10793,26 +11243,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 391, + "id": 403, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 380, - "src": "6680:1:0", + "referencedDeclaration": 392, + "src": "6720:1:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract storage pointer" } }, - "id": 392, + "id": 404, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "hashlock", "nodeType": "MemberAccess", - "referencedDeclaration": 32, - "src": "6680:10:0", + "referencedDeclaration": 31, + "src": "6720:10:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -10822,26 +11272,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 393, + "id": 405, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 380, - "src": "6692:1:0", + "referencedDeclaration": 392, + "src": "6732:1:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract storage pointer" } }, - "id": 394, + "id": 406, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "timelock", "nodeType": "MemberAccess", - "referencedDeclaration": 34, - "src": "6692:10:0", + "referencedDeclaration": 33, + "src": "6732:10:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -10851,26 +11301,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 395, + "id": 407, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 380, - "src": "6720:1:0", + "referencedDeclaration": 392, + "src": "6760:1:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract storage pointer" } }, - "id": 396, + "id": 408, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "withdrawn", "nodeType": "MemberAccess", - "referencedDeclaration": 36, - "src": "6720:11:0", + "referencedDeclaration": 35, + "src": "6760:11:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -10880,26 +11330,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 397, + "id": 409, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 380, - "src": "6733:1:0", + "referencedDeclaration": 392, + "src": "6773:1:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract storage pointer" } }, - "id": 398, + "id": 410, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "refunded", "nodeType": "MemberAccess", - "referencedDeclaration": 38, - "src": "6733:10:0", + "referencedDeclaration": 37, + "src": "6773:10:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -10909,71 +11359,70 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 399, + "id": 411, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 380, - "src": "6745:1:0", + "referencedDeclaration": 392, + "src": "6785:1:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$40_storage_ptr", "typeString": "struct HashedTimelock.LockContract storage pointer" } }, - "id": 400, + "id": 412, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "preimage", "nodeType": "MemberAccess", - "referencedDeclaration": 40, - "src": "6745:10:0", + "referencedDeclaration": 39, + "src": "6785:10:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], - "id": 401, + "id": 413, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", - "src": "6647:109:0", + "src": "6687:109:0", "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_address_$_t_address_$_t_uint256_$_t_bytes32_$_t_uint256_$_t_bool_$_t_bool_$_t_bytes32_$", - "typeString": "tuple(address,address,uint256,bytes32,uint256,bool,bool,bytes32)" + "typeIdentifier": "t_tuple$_t_address_payable_$_t_address_payable_$_t_uint256_$_t_bytes32_$_t_uint256_$_t_bool_$_t_bool_$_t_bytes32_$", + "typeString": "tuple(address payable,address payable,uint256,bytes32,uint256,bool,bool,bytes32)" } }, - "functionReturnParameters": 371, - "id": 402, + "functionReturnParameters": 370, + "id": 414, "nodeType": "Return", - "src": "6640:116:0" + "src": "6680:116:0" } ] }, "documentation": "@dev Get contract details.\n@param _contractId HTLC contract id\n@return All parameters in struct LockContract for _contractId HTLC", - "id": 404, + "id": 416, "implemented": true, - "isConstructor": false, - "isDeclaredConst": true, + "kind": "function", "modifiers": [], "name": "getContract", "nodeType": "FunctionDefinition", "parameters": { - "id": 354, + "id": 353, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 353, + "id": 352, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 404, - "src": "6200:19:0", + "scope": 416, + "src": "6189:19:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -10981,10 +11430,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 352, + "id": 351, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "6200:7:0", + "src": "6189:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -10994,20 +11443,19 @@ "visibility": "internal" } ], - "src": "6199:21:0" + "src": "6188:21:0" }, - "payable": false, "returnParameters": { - "id": 371, + "id": 370, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 356, + "id": 355, "name": "sender", "nodeType": "VariableDeclaration", - "scope": 404, - "src": "6279:14:0", + "scope": 416, + "src": "6268:14:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -11015,10 +11463,11 @@ "typeString": "address" }, "typeName": { - "id": 355, + "id": 354, "name": "address", "nodeType": "ElementaryTypeName", - "src": "6279:7:0", + "src": "6268:7:0", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -11029,11 +11478,11 @@ }, { "constant": false, - "id": 358, + "id": 357, "name": "receiver", "nodeType": "VariableDeclaration", - "scope": 404, - "src": "6307:16:0", + "scope": 416, + "src": "6296:16:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -11041,10 +11490,11 @@ "typeString": "address" }, "typeName": { - "id": 357, + "id": 356, "name": "address", "nodeType": "ElementaryTypeName", - "src": "6307:7:0", + "src": "6296:7:0", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -11055,11 +11505,11 @@ }, { "constant": false, - "id": 360, + "id": 359, "name": "amount", "nodeType": "VariableDeclaration", - "scope": 404, - "src": "6337:11:0", + "scope": 416, + "src": "6326:11:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -11067,10 +11517,10 @@ "typeString": "uint256" }, "typeName": { - "id": 359, + "id": 358, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "6337:4:0", + "src": "6326:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -11081,11 +11531,11 @@ }, { "constant": false, - "id": 362, + "id": 361, "name": "hashlock", "nodeType": "VariableDeclaration", - "scope": 404, - "src": "6362:16:0", + "scope": 416, + "src": "6351:16:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -11093,10 +11543,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 361, + "id": 360, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "6362:7:0", + "src": "6351:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -11107,11 +11557,11 @@ }, { "constant": false, - "id": 364, + "id": 363, "name": "timelock", "nodeType": "VariableDeclaration", - "scope": 404, - "src": "6392:13:0", + "scope": 416, + "src": "6381:13:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -11119,10 +11569,10 @@ "typeString": "uint256" }, "typeName": { - "id": 363, + "id": 362, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "6392:4:0", + "src": "6381:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -11133,11 +11583,11 @@ }, { "constant": false, - "id": 366, + "id": 365, "name": "withdrawn", "nodeType": "VariableDeclaration", - "scope": 404, - "src": "6419:14:0", + "scope": 416, + "src": "6408:14:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -11145,10 +11595,10 @@ "typeString": "bool" }, "typeName": { - "id": 365, + "id": 364, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "6419:4:0", + "src": "6408:4:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -11159,11 +11609,11 @@ }, { "constant": false, - "id": 368, + "id": 367, "name": "refunded", "nodeType": "VariableDeclaration", - "scope": 404, - "src": "6447:13:0", + "scope": 416, + "src": "6436:13:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -11171,10 +11621,10 @@ "typeString": "bool" }, "typeName": { - "id": 367, + "id": 366, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "6447:4:0", + "src": "6436:4:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -11185,11 +11635,11 @@ }, { "constant": false, - "id": 370, + "id": 369, "name": "preimage", "nodeType": "VariableDeclaration", - "scope": 404, - "src": "6474:16:0", + "scope": 416, + "src": "6463:16:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -11197,10 +11647,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 369, + "id": 368, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "6474:7:0", + "src": "6463:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -11210,36 +11660,36 @@ "visibility": "internal" } ], - "src": "6265:235:0" + "src": "6254:235:0" }, - "scope": 425, - "src": "6179:584:0", + "scope": 437, + "src": "6168:635:0", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { - "id": 423, + "id": 435, "nodeType": "Block", - "src": "6998:71:0", + "src": "7038:71:0", "statements": [ { "expression": { "argumentTypes": null, - "id": 421, + "id": 433, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, - "id": 411, + "id": 423, "name": "exists", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 409, - "src": "7008:6:0", + "referencedDeclaration": 421, + "src": "7048:6:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -11253,10 +11703,10 @@ { "argumentTypes": null, "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, - "id": 419, + "id": 431, "isConstant": false, "isLValue": false, "isPure": false, @@ -11267,26 +11717,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 412, + "id": 424, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 190, - "src": "7018:9:0", + "referencedDeclaration": 189, + "src": "7058:9:0", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$41_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$40_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelock.LockContract storage ref)" } }, - "id": 414, + "id": 426, "indexExpression": { "argumentTypes": null, - "id": 413, + "id": 425, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 406, - "src": "7028:11:0", + "referencedDeclaration": 418, + "src": "7068:11:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -11297,24 +11747,24 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "7018:22:0", + "src": "7058:22:0", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$41_storage", + "typeIdentifier": "t_struct$_LockContract_$40_storage", "typeString": "struct HashedTimelock.LockContract storage ref" } }, - "id": 415, + "id": 427, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", - "referencedDeclaration": 26, - "src": "7018:29:0", + "referencedDeclaration": 25, + "src": "7058:29:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, "nodeType": "BinaryOperation", @@ -11325,14 +11775,14 @@ { "argumentTypes": null, "hexValue": "30", - "id": 417, + "id": 429, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "7059:1:0", + "src": "7099:1:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", @@ -11348,20 +11798,20 @@ "typeString": "int_const 0" } ], - "id": 416, + "id": 428, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", - "src": "7051:7:0", + "src": "7091:7:0", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, - "id": 418, + "id": 430, "isConstant": false, "isLValue": false, "isPure": true, @@ -11369,63 +11819,62 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "7051:10:0", + "src": "7091:10:0", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, - "src": "7018:43:0", + "src": "7058:43:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], - "id": 420, + "id": 432, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", - "src": "7017:45:0", + "src": "7057:45:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "src": "7008:54:0", + "src": "7048:54:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "id": 422, + "id": 434, "nodeType": "ExpressionStatement", - "src": "7008:54:0" + "src": "7048:54:0" } ] }, "documentation": "@dev Is there a contract with id _contractId.\n@param _contractId Id into contracts mapping.", - "id": 424, + "id": 436, "implemented": true, - "isConstructor": false, - "isDeclaredConst": true, + "kind": "function", "modifiers": [], "name": "haveContract", "nodeType": "FunctionDefinition", "parameters": { - "id": 407, + "id": 419, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 406, + "id": 418, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 424, - "src": "6913:19:0", + "scope": 436, + "src": "6953:19:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -11433,10 +11882,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 405, + "id": 417, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "6913:7:0", + "src": "6953:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -11446,20 +11895,19 @@ "visibility": "internal" } ], - "src": "6912:21:0" + "src": "6952:21:0" }, - "payable": false, "returnParameters": { - "id": 410, + "id": 422, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 409, + "id": 421, "name": "exists", "nodeType": "VariableDeclaration", - "scope": 424, - "src": "6981:11:0", + "scope": 436, + "src": "7021:11:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -11467,10 +11915,10 @@ "typeString": "bool" }, "typeName": { - "id": 408, + "id": 420, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "6981:4:0", + "src": "7021:4:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -11480,26 +11928,65 @@ "visibility": "internal" } ], - "src": "6980:13:0" + "src": "7020:13:0" }, - "scope": 425, - "src": "6891:178:0", + "scope": 437, + "src": "6931:178:0", "stateMutability": "view", "superFunction": null, "visibility": "internal" } ], - "scope": 426, - "src": "783:6289:0" + "scope": 438, + "src": "752:6360:0" } ], - "src": "0:7073:0" + "src": "0:7113:0" }, "compiler": { "name": "solc", - "version": "0.4.24+commit.e67f0147.Emscripten.clang" + "version": "0.5.0+commit.1d4f565a.Emscripten.clang" }, "networks": {}, - "schemaVersion": "2.0.0", - "updatedAt": "2018-06-06T05:18:47.585Z" + "schemaVersion": "3.0.1", + "updatedAt": "2019-02-09T05:41:13.709Z", + "devdoc": { + "methods": { + "getContract(bytes32)": { + "details": "Get contract details.", + "params": { + "_contractId": "HTLC contract id" + }, + "return": "All parameters in struct LockContract for _contractId HTLC" + }, + "newContract(address,bytes32,uint256)": { + "details": "Sender sets up a new hash time lock contract depositing the ETH and providing the reciever lock terms.", + "params": { + "_hashlock": "A sha-2 sha256 hash hashlock.", + "_receiver": "Receiver of the ETH.", + "_timelock": "UNIX epoch seconds time that the lock expires at. Refunds can be made after this time." + }, + "return": "contractId Id of the new HTLC. This is needed for subsequent calls." + }, + "refund(bytes32)": { + "details": "Called by the sender if there was no withdraw AND the time lock has expired. This will refund the contract amount.", + "params": { + "_contractId": "Id of HTLC to refund from." + }, + "return": "bool true on success" + }, + "withdraw(bytes32,bytes32)": { + "details": "Called by the receiver once they know the preimage of the hashlock. This will transfer the locked funds to their address.", + "params": { + "_contractId": "Id of the HTLC.", + "_preimage": "sha256(_preimage) should equal the contract hashlock." + }, + "return": "bool true on success" + } + }, + "title": "Hashed Timelock Contracts (HTLCs) on Ethereum ETH. * This contract provides a way to create and keep HTLCs for ETH. * See HashedTimelockERC20.sol for a contract that provides the same functions for ERC20 tokens. * Protocol: * 1) newContract(receiver, hashlock, timelock) - a sender calls this to create a new HTLC and gets back a 32 byte contract id 2) withdraw(contractId, preimage) - once the receiver knows the preimage of the hashlock hash they can claim the ETH with this function 3) refund() - after timelock has expired and if the receiver did not withdraw funds the sender / creater of the HTLC can get their ETH back with this function." + }, + "userdoc": { + "methods": {} + } } \ No newline at end of file diff --git a/abi/HashedTimelockERC20.json b/abi/HashedTimelockERC20.json index 0ed916a..df0f7be 100644 --- a/abi/HashedTimelockERC20.json +++ b/abi/HashedTimelockERC20.json @@ -196,50 +196,41 @@ "type": "function" } ], - "bytecode": "0x608060405234801561001057600080fd5b506117a2806100206000396000f300608060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063398a7a981461006757806363615149146101085780637249fbb61461015f578063e16c7d98146101a8575b600080fd5b34801561007357600080fd5b506100ea600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560001916906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506102c1565b60405180826000191660001916815260200191505060405180910390f35b34801561011457600080fd5b5061014560048036038101908080356000191690602001909291908035600019169060200190929190505050610b12565b604051808215151515815260200191505060405180910390f35b34801561016b57600080fd5b5061018e60048036038101908080356000191690602001909291905050506110e9565b604051808215151515815260200191505060405180910390f35b3480156101b457600080fd5b506101d760048036038101908080356000191690602001909291905050506115f3565b604051808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001878152602001866000191660001916815260200185815260200184151515158152602001831515151581526020018260001916600019168152602001995050505050505050505060405180910390f35b600082338360008111151561033e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f746f6b656e20616d6f756e74206d757374206265203e2030000000000000000081525060200191505060405180910390fd5b808373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84306040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561040c57600080fd5b505afa158015610420573d6000803e3d6000fd5b505050506040513d602081101561043657600080fd5b8101908080519060200190929190505050101515156104e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f746f6b656e20616c6c6f77616e6365206d757374206265203e3d20616d6f756e81526020017f740000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b864281111515610581576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f74696d656c6f636b2074696d65206d75737420626520696e207468652066757481526020017f757265000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6002338b89898d8d604051602001808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c01000000000000000000000000028152601401848152602001836000191660001916815260200182815260200196505050505050506040516020818303038152906040526040518082805190602001908083835b6020831015156106b95780518252602082019150602081019050602083039250610694565b6001836020036101000a038019825116818451168082178552505050505050905001915050602060405180830381855afa1580156106fb573d6000803e3d6000fd5b5050506040513d602081101561071057600080fd5b8101908080519060200190929190505050945061072c85611700565b1561073657600080fd5b8673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330896040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561080d57600080fd5b505af1158015610821573d6000803e3d6000fd5b505050506040513d602081101561083757600080fd5b8101908080519060200190929190505050151561085357600080fd5b610120604051908101604052803373ffffffffffffffffffffffffffffffffffffffff1681526020018b73ffffffffffffffffffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff1681526020018781526020018a600019168152602001898152602001600015158152602001600015158152602001600060010260001916815250600080876000191660001916815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550606082015181600301556080820151816004019060001916905560a0820151816005015560c08201518160060160006101000a81548160ff02191690831515021790555060e08201518160060160016101000a81548160ff02191690831515021790555061010082015181600701906000191690559050508973ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1686600019167f4ea4e99f860572a3879af5b9ed9265b3627da34e69374831e62cf9c1a037b5a38a8a8e8e604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001836000191660001916815260200182815260200194505050505060405180910390a45050505095945050505050565b60008083610b1f81611700565b1515610b93576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f636f6e7472616374496420646f6573206e6f742065786973740000000000000081525060200191505060405180910390fd5b84846002816040516020018082600019166000191681526020019150506040516020818303038152906040526040518082805190602001908083835b602083101515610bf45780518252602082019150602081019050602083039250610bcf565b6001836020036101000a038019825116818451168082178552505050505050905001915050602060405180830381855afa158015610c36573d6000803e3d6000fd5b5050506040513d6020811015610c4b57600080fd5b81019080805190602001909291905050506000191660008084600019166000191681526020019081526020016000206004015460001916141515610cf7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f686173686c6f636b206861736820646f6573206e6f74206d617463680000000081525060200191505060405180910390fd5b863373ffffffffffffffffffffffffffffffffffffffff16600080836000191660001916815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610dd8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f776974686472617761626c653a206e6f7420726563656976657200000000000081525060200191505060405180910390fd5b60001515600080836000191660001916815260200190815260200160002060060160009054906101000a900460ff161515141515610e7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f776974686472617761626c653a20616c72656164792077697468647261776e0081525060200191505060405180910390fd5b42600080836000191660001916815260200190815260200160002060050154111515610f38576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260318152602001807f776974686472617761626c653a2074696d656c6f636b2074696d65206d75737481526020017f20626520696e207468652066757475726500000000000000000000000000000081525060400191505060405180910390fd5b600080896000191660001916815260200190815260200160002094508685600701816000191690555060018560060160006101000a81548160ff0219169083151502179055508460020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8660010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1687600301546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561106d57600080fd5b505af1158015611081573d6000803e3d6000fd5b505050506040513d602081101561109757600080fd5b81019080805190602001909291905050505087600019167fb274ecbfbc0eda7b3618d62964d187a407e800a7cde2665de83e90b5acc1384160405160405180910390a260019550505050505092915050565b600080826110f681611700565b151561116a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f636f6e7472616374496420646f6573206e6f742065786973740000000000000081525060200191505060405180910390fd5b833373ffffffffffffffffffffffffffffffffffffffff16600080836000191660001916815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561124b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f726566756e6461626c653a206e6f742073656e6465720000000000000000000081525060200191505060405180910390fd5b60001515600080836000191660001916815260200190815260200160002060060160019054906101000a900460ff1615151415156112f1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f726566756e6461626c653a20616c726561647920726566756e6465640000000081525060200191505060405180910390fd5b60001515600080836000191660001916815260200190815260200160002060060160009054906101000a900460ff161515141515611397576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f726566756e6461626c653a20616c72656164792077697468647261776e00000081525060200191505060405180910390fd5b4260008083600019166000191681526020019081526020016000206005015411151515611452576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f726566756e6461626c653a2074696d656c6f636b206e6f74207965742070617381526020017f736564000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6000808660001916600019168152602001908152602001600020925060018360060160016101000a81548160ff0219169083151502179055508260020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8460000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685600301546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561157a57600080fd5b505af115801561158e573d6000803e3d6000fd5b505050506040513d60208110156115a457600080fd5b81019080805190602001909291905050505084600019167fd2e595f42ef29a918206aacb16643bc6b5217990d79865d467ab625e3174a55d60405160405180910390a260019350505050919050565b6000806000806000806000806000806000151561160f8c611700565b1515141561161c576116f2565b6000808c6000191660001916815260200190815260200160002090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168260020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168360030154846004015485600501548660060160009054906101000a900460ff168760060160019054906101000a900460ff1688600701549950995099509950995099509950995099505b509193959799909294969850565b60008073ffffffffffffffffffffffffffffffffffffffff16600080846000191660001916815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141590509190505600a165627a7a7230582039aca5138e5239b2cab6f8816513c305486643c35c38ac403b9d26c90d43f77d0029", - "deployedBytecode": "0x608060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063398a7a981461006757806363615149146101085780637249fbb61461015f578063e16c7d98146101a8575b600080fd5b34801561007357600080fd5b506100ea600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560001916906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506102c1565b60405180826000191660001916815260200191505060405180910390f35b34801561011457600080fd5b5061014560048036038101908080356000191690602001909291908035600019169060200190929190505050610b12565b604051808215151515815260200191505060405180910390f35b34801561016b57600080fd5b5061018e60048036038101908080356000191690602001909291905050506110e9565b604051808215151515815260200191505060405180910390f35b3480156101b457600080fd5b506101d760048036038101908080356000191690602001909291905050506115f3565b604051808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001878152602001866000191660001916815260200185815260200184151515158152602001831515151581526020018260001916600019168152602001995050505050505050505060405180910390f35b600082338360008111151561033e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f746f6b656e20616d6f756e74206d757374206265203e2030000000000000000081525060200191505060405180910390fd5b808373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84306040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561040c57600080fd5b505afa158015610420573d6000803e3d6000fd5b505050506040513d602081101561043657600080fd5b8101908080519060200190929190505050101515156104e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f746f6b656e20616c6c6f77616e6365206d757374206265203e3d20616d6f756e81526020017f740000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b864281111515610581576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f74696d656c6f636b2074696d65206d75737420626520696e207468652066757481526020017f757265000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6002338b89898d8d604051602001808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c01000000000000000000000000028152601401848152602001836000191660001916815260200182815260200196505050505050506040516020818303038152906040526040518082805190602001908083835b6020831015156106b95780518252602082019150602081019050602083039250610694565b6001836020036101000a038019825116818451168082178552505050505050905001915050602060405180830381855afa1580156106fb573d6000803e3d6000fd5b5050506040513d602081101561071057600080fd5b8101908080519060200190929190505050945061072c85611700565b1561073657600080fd5b8673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330896040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561080d57600080fd5b505af1158015610821573d6000803e3d6000fd5b505050506040513d602081101561083757600080fd5b8101908080519060200190929190505050151561085357600080fd5b610120604051908101604052803373ffffffffffffffffffffffffffffffffffffffff1681526020018b73ffffffffffffffffffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff1681526020018781526020018a600019168152602001898152602001600015158152602001600015158152602001600060010260001916815250600080876000191660001916815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550606082015181600301556080820151816004019060001916905560a0820151816005015560c08201518160060160006101000a81548160ff02191690831515021790555060e08201518160060160016101000a81548160ff02191690831515021790555061010082015181600701906000191690559050508973ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1686600019167f4ea4e99f860572a3879af5b9ed9265b3627da34e69374831e62cf9c1a037b5a38a8a8e8e604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001836000191660001916815260200182815260200194505050505060405180910390a45050505095945050505050565b60008083610b1f81611700565b1515610b93576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f636f6e7472616374496420646f6573206e6f742065786973740000000000000081525060200191505060405180910390fd5b84846002816040516020018082600019166000191681526020019150506040516020818303038152906040526040518082805190602001908083835b602083101515610bf45780518252602082019150602081019050602083039250610bcf565b6001836020036101000a038019825116818451168082178552505050505050905001915050602060405180830381855afa158015610c36573d6000803e3d6000fd5b5050506040513d6020811015610c4b57600080fd5b81019080805190602001909291905050506000191660008084600019166000191681526020019081526020016000206004015460001916141515610cf7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f686173686c6f636b206861736820646f6573206e6f74206d617463680000000081525060200191505060405180910390fd5b863373ffffffffffffffffffffffffffffffffffffffff16600080836000191660001916815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610dd8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f776974686472617761626c653a206e6f7420726563656976657200000000000081525060200191505060405180910390fd5b60001515600080836000191660001916815260200190815260200160002060060160009054906101000a900460ff161515141515610e7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f776974686472617761626c653a20616c72656164792077697468647261776e0081525060200191505060405180910390fd5b42600080836000191660001916815260200190815260200160002060050154111515610f38576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260318152602001807f776974686472617761626c653a2074696d656c6f636b2074696d65206d75737481526020017f20626520696e207468652066757475726500000000000000000000000000000081525060400191505060405180910390fd5b600080896000191660001916815260200190815260200160002094508685600701816000191690555060018560060160006101000a81548160ff0219169083151502179055508460020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8660010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1687600301546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561106d57600080fd5b505af1158015611081573d6000803e3d6000fd5b505050506040513d602081101561109757600080fd5b81019080805190602001909291905050505087600019167fb274ecbfbc0eda7b3618d62964d187a407e800a7cde2665de83e90b5acc1384160405160405180910390a260019550505050505092915050565b600080826110f681611700565b151561116a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f636f6e7472616374496420646f6573206e6f742065786973740000000000000081525060200191505060405180910390fd5b833373ffffffffffffffffffffffffffffffffffffffff16600080836000191660001916815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561124b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f726566756e6461626c653a206e6f742073656e6465720000000000000000000081525060200191505060405180910390fd5b60001515600080836000191660001916815260200190815260200160002060060160019054906101000a900460ff1615151415156112f1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f726566756e6461626c653a20616c726561647920726566756e6465640000000081525060200191505060405180910390fd5b60001515600080836000191660001916815260200190815260200160002060060160009054906101000a900460ff161515141515611397576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f726566756e6461626c653a20616c72656164792077697468647261776e00000081525060200191505060405180910390fd5b4260008083600019166000191681526020019081526020016000206005015411151515611452576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f726566756e6461626c653a2074696d656c6f636b206e6f74207965742070617381526020017f736564000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6000808660001916600019168152602001908152602001600020925060018360060160016101000a81548160ff0219169083151502179055508260020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8460000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685600301546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561157a57600080fd5b505af115801561158e573d6000803e3d6000fd5b505050506040513d60208110156115a457600080fd5b81019080805190602001909291905050505084600019167fd2e595f42ef29a918206aacb16643bc6b5217990d79865d467ab625e3174a55d60405160405180910390a260019350505050919050565b6000806000806000806000806000806000151561160f8c611700565b1515141561161c576116f2565b6000808c6000191660001916815260200190815260200160002090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168260020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168360030154846004015485600501548660060160009054906101000a900460ff168760060160019054906101000a900460ff1688600701549950995099509950995099509950995099505b509193959799909294969850565b60008073ffffffffffffffffffffffffffffffffffffffff16600080846000191660001916815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141590509190505600a165627a7a7230582039aca5138e5239b2cab6f8816513c305486643c35c38ac403b9d26c90d43f77d0029", - "sourceMap": "948:7428:1:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;948:7428:1;;;;;;;", - "deployedSourceMap": "948:7428:1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4251:1456;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4251:1456:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6041:476;;8:9:-1;5:2;;;30:1;27;20:12;5:2;6041:476:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6788:368;;8:9:-1;5:2;;;30:1;27;20:12;5:2;6788:368:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7329:738;;8:9:-1;5:2;;;30:1;27;20:12;5:2;7329:738:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4251:1456;4542:18;4454:14;4470:10;4482:7;1750:1;1740:7;:11;1732:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1853:7;1817:6;1811:23;;;1835:7;1844:4;1811:38;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1811:38:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1811:38:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1811:38:1;;;;;;;;;;;;;;;;:49;;1790:129;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4514:9;2214:3;2206:5;:11;2198:59;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4589:226;4643:10;4671:9;4698:14;4730:7;4755:9;4782;4609:196;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;4609:196:1;;;4589:226;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;4589:226:1;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4589:226:1;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;4589:226:1;;;;;;;;;;;;;;;;4576:239;;5015:24;5028:10;5015:12;:24::i;:::-;5011:50;;;5053:8;;;5011:50;5150:14;5144:34;;;5179:10;5191:4;5197:7;5144:61;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5144:61:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5144:61:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;5144:61:1;;;;;;;;;;;;;;;;5143:62;5139:88;;;5219:8;;;5139:88;5274:219;;;;;;;;;5300:10;5274:219;;;;;;5324:9;5274:219;;;;;;5347:14;5274:219;;;;;;5375:7;5274:219;;;;5396:9;5274:219;;;;;;;5419:9;5274:219;;;;5442:5;5274:219;;;;;;5461:5;5274:219;;;;;;5480:3;5274:219;;;;;;;;5250:9;:21;5260:10;5250:21;;;;;;;;;;;;;;;;;:243;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5586:9;5509:191;;5562:10;5509:191;;5538:10;5509:191;;;;5609:14;5637:7;5658:9;5681;5509:191;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1929:1;4251:1456;;;;;;;;;;:::o;6041:476::-;6251:4;6271:22;6139:11;2343:25;2356:11;2343:12;:25::i;:::-;2335:63;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6176:11;6189:9;2545:28;2569:2;2552:20;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;2552:20:1;;;2545:28;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;2545:28:1;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2545:28:1;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;2545:28:1;;;;;;;;;;;;;;;;2510:63;;;:9;:22;2520:11;2510:22;;;;;;;;;;;;;;;;;:31;;;:63;;;;2489:138;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6221:11;2746:10;2711:45;;:9;:22;2721:11;2711:22;;;;;;;;;;;;;;;;;:31;;;;;;;;;;;;:45;;;2703:84;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2841:5;2805:41;;:9;:22;2815:11;2805:22;;;;;;;;;;;;;;;;;:32;;;;;;;;;;;;:41;;;2797:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2934:3;2900:9;:22;2910:11;2900:22;;;;;;;;;;;;;;;;;:31;;;:37;2892:99;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6296:9;:22;6306:11;6296:22;;;;;;;;;;;;;;;;;6271:47;;6341:9;6328:1;:10;;:22;;;;;;;6374:4;6360:1;:11;;;:18;;;;;;;;;;;;;;;;;;6394:1;:15;;;;;;;;;;;;6388:31;;;6420:1;:10;;;;;;;;;;;;6432:1;:8;;;6388:53;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;6388:53:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;6388:53:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;6388:53:1;;;;;;;;;;;;;;;;;6477:11;6456:33;;;;;;;;;;;;;6506:4;6499:11;;2637:1;2408;;6041:476;;;;;;:::o;6788:368::-;6927:4;6947:22;6865:11;2343:25;2356:11;2343:12;:25::i;:::-;2335:63;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6897:11;3106:10;3073:43;;:9;:22;3083:11;3073:22;;;;;;;;;;;;;;;;;:29;;;;;;;;;;;;:43;;;3065:78;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3196:5;3161:40;;:9;:22;3171:11;3161:22;;;;;;;;;;;;;;;;;:31;;;;;;;;;;;;:40;;;3153:81;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3288:5;3252:41;;:9;:22;3262:11;3252:22;;;;;;;;;;;;;;;;;:32;;;;;;;;;;;;:41;;;3244:83;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3380:3;3345:9;:22;3355:11;3345:22;;;;;;;;;;;;;;;;;:31;;;:38;;3337:86;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6972:9;:22;6982:11;6972:22;;;;;;;;;;;;;;;;;6947:47;;7017:4;7004:1;:10;;;:17;;;;;;;;;;;;;;;;;;7037:1;:15;;;;;;;;;;;;7031:31;;;7063:1;:8;;;;;;;;;;;;7073:1;:8;;;7031:51;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;7031:51:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;7031:51:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;7031:51:1;;;;;;;;;;;;;;;;;7116:11;7097:31;;;;;;;;;;;;;7145:4;7138:11;;2408:1;6788:368;;;;;:::o;7329:738::-;7429:14;7457:16;7487:21;7522:11;7547:16;7577:13;7604:14;7632:13;7659:16;7768:22;7733:5;7704:34;;:25;7717:11;7704:12;:25::i;:::-;:34;;;7700:59;;;7752:7;;7700:59;7793:9;:22;7803:11;7793:22;;;;;;;;;;;;;;;;;7768:47;;7846:1;:8;;;;;;;;;;;;7868:1;:10;;;;;;;;;;;;7892:1;:15;;;;;;;;;;;;7921:1;:8;;;7943:1;:10;;;7967:1;:10;;;7991:1;:11;;;;;;;;;;;;8016:1;:10;;;;;;;;;;;;8040:1;:10;;;7825:235;;;;;;;;;;;;;;;;;;7329:738;;;;;;;;;;;;;:::o;8195:178::-;8285:11;8363:1;8322:43;;:9;:22;8332:11;8322:22;;;;;;;;;;;;;;;;;:29;;;;;;;;;;;;:43;;;;8312:54;;8195:178;;;:::o", - "source": "pragma solidity ^0.4.24;\npragma experimental \"v0.5.0\";\n\nimport \"openzeppelin-solidity/contracts/token/ERC20/ERC20.sol\";\n\n/**\n* @title Hashed Timelock Contracts (HTLCs) on Ethereum ERC20 tokens.\n*\n* This contract provides a way to create and keep HTLCs for ERC20 tokens.\n*\n* See HashedTimelock.sol for a contract that provides the same functions \n* for the native ETH token.\n*\n* Protocol:\n*\n* 1) newContract(receiver, hashlock, timelock, tokenContract, amount) - a \n* sender calls this to create a new HTLC on a given token (tokenContract) \n* for a given amount. A 32 byte contract id is returned\n* 2) withdraw(contractId, preimage) - once the receiver knows the preimage of\n* the hashlock hash they can claim the tokens with this function\n* 3) refund() - after timelock has expired and if the receiver did not \n* withdraw the tokens the sender / creater of the HTLC can get their tokens \n* back with this function.\n */\ncontract HashedTimelockERC20 {\n\n event LogHTLCERC20New(\n bytes32 indexed contractId,\n address indexed sender,\n address indexed receiver,\n address tokenContract,\n uint amount,\n bytes32 hashlock,\n uint timelock\n );\n event LogHTLCERC20Withdraw(bytes32 indexed contractId);\n event LogHTLCERC20Refund(bytes32 indexed contractId);\n\n struct LockContract {\n address sender;\n address receiver;\n address tokenContract;\n uint amount;\n bytes32 hashlock;\n uint timelock; // UNIX timestamp seconds - locked UNTIL this time\n bool withdrawn;\n bool refunded;\n bytes32 preimage;\n }\n\n modifier tokensTransferable(address _token, address _sender, uint _amount) {\n require(_amount > 0, \"token amount must be > 0\");\n require(\n ERC20(_token).allowance(_sender, this) >= _amount,\n \"token allowance must be >= amount\"\n );\n _;\n }\n modifier futureTimelock(uint _time) {\n // only requirement is the timelock time is after the last blocktime (now).\n // probably want something a bit further in the future then this.\n // but this is still a useful sanity check:\n require(_time > now, \"timelock time must be in the future\");\n _;\n }\n modifier contractExists(bytes32 _contractId) {\n require(haveContract(_contractId), \"contractId does not exist\");\n _;\n }\n modifier hashlockMatches(bytes32 _contractId, bytes32 _x) {\n require(\n contracts[_contractId].hashlock == sha256(abi.encodePacked(_x)),\n \"hashlock hash does not match\"\n );\n _;\n }\n modifier withdrawable(bytes32 _contractId) {\n require(contracts[_contractId].receiver == msg.sender, \"withdrawable: not receiver\");\n require(contracts[_contractId].withdrawn == false, \"withdrawable: already withdrawn\");\n require(contracts[_contractId].timelock > now, \"withdrawable: timelock time must be in the future\");\n _;\n }\n modifier refundable(bytes32 _contractId) {\n require(contracts[_contractId].sender == msg.sender, \"refundable: not sender\");\n require(contracts[_contractId].refunded == false, \"refundable: already refunded\");\n require(contracts[_contractId].withdrawn == false, \"refundable: already withdrawn\");\n require(contracts[_contractId].timelock <= now, \"refundable: timelock not yet passed\");\n _;\n }\n\n mapping (bytes32 => LockContract) contracts;\n\n /**\n * @dev Sender / Payer sets up a new hash time lock contract depositing the\n * funds and providing the reciever and terms.\n *\n * NOTE: _receiver must first call approve() on the token contract. \n * See allowance check in tokensTransferable modifier.\n\n * @param _receiver Receiver of the tokens.\n * @param _hashlock A sha-2 sha256 hash hashlock.\n * @param _timelock UNIX epoch seconds time that the lock expires at. \n * Refunds can be made after this time.\n * @param _tokenContract ERC20 Token contract address.\n * @param _amount Amount of the token to lock up.\n * @return contractId Id of the new HTLC. This is needed for subsequent \n * calls.\n */\n function newContract(\n address _receiver,\n bytes32 _hashlock,\n uint _timelock,\n address _tokenContract,\n uint _amount\n )\n external\n tokensTransferable(_tokenContract, msg.sender, _amount)\n futureTimelock(_timelock)\n returns (bytes32 contractId)\n {\n contractId = sha256(\n abi.encodePacked(\n msg.sender,\n _receiver,\n _tokenContract,\n _amount,\n _hashlock,\n _timelock\n )\n );\n\n // Reject if a contract already exists with the same parameters. The\n // sender must change one of these parameters (ideally providing a\n // different _hashlock).\n if (haveContract(contractId))\n revert();\n\n // This contract becomes the temporary owner of the tokens\n if (!ERC20(_tokenContract).transferFrom(msg.sender, this, _amount))\n revert();\n \n contracts[contractId] = LockContract(\n msg.sender,\n _receiver,\n _tokenContract,\n _amount,\n _hashlock,\n _timelock,\n false,\n false,\n 0x0\n );\n\n emit LogHTLCERC20New(\n contractId,\n msg.sender,\n _receiver,\n _tokenContract,\n _amount,\n _hashlock,\n _timelock\n );\n }\n\n /**\n * @dev Called by the receiver once they know the preimage of the hashlock.\n * This will transfer ownership of the locked tokens to their address.\n *\n * @param _contractId Id of the HTLC.\n * @param _preimage sha256(_preimage) should equal the contract hashlock.\n * @return bool true on success\n */\n function withdraw(bytes32 _contractId, bytes32 _preimage)\n external\n contractExists(_contractId)\n hashlockMatches(_contractId, _preimage)\n withdrawable(_contractId)\n returns (bool)\n {\n LockContract storage c = contracts[_contractId];\n c.preimage = _preimage;\n c.withdrawn = true;\n ERC20(c.tokenContract).transfer(c.receiver, c.amount);\n emit LogHTLCERC20Withdraw(_contractId);\n return true;\n }\n\n /**\n * @dev Called by the sender if there was no withdraw AND the time lock has\n * expired. This will restore ownership of the tokens to the sender.\n *\n * @param _contractId Id of HTLC to refund from.\n * @return bool true on success\n */\n function refund(bytes32 _contractId)\n external\n contractExists(_contractId)\n refundable(_contractId)\n returns (bool)\n {\n LockContract storage c = contracts[_contractId];\n c.refunded = true;\n ERC20(c.tokenContract).transfer(c.sender, c.amount);\n emit LogHTLCERC20Refund(_contractId);\n return true;\n }\n\n /**\n * @dev Get contract details.\n * @param _contractId HTLC contract id\n * @return All parameters in struct LockContract for _contractId HTLC\n */\n function getContract(bytes32 _contractId)\n public\n view\n returns (\n address sender,\n address receiver,\n address tokenContract,\n uint amount,\n bytes32 hashlock,\n uint timelock,\n bool withdrawn,\n bool refunded,\n bytes32 preimage\n )\n {\n if (haveContract(_contractId) == false)\n return;\n LockContract storage c = contracts[_contractId];\n return (\n c.sender,\n c.receiver,\n c.tokenContract,\n c.amount,\n c.hashlock,\n c.timelock,\n c.withdrawn,\n c.refunded,\n c.preimage\n );\n }\n\n /**\n * @dev Is there a contract with id _contractId.\n * @param _contractId Id into contracts mapping.\n */\n function haveContract(bytes32 _contractId)\n internal\n view\n returns (bool exists)\n {\n exists = (contracts[_contractId].sender != address(0));\n }\n\n}\n", - "sourcePath": "/home/hatch/eth/hashed-timelock-contract-ethereum/contracts/HashedTimelockERC20.sol", + "bytecode": "0x608060405234801561001057600080fd5b5061173f806100206000396000f3fe608060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063398a7a9814610067578063636151491461010a5780637249fbb614610167578063e16c7d98146101ba575b600080fd5b34801561007357600080fd5b506100f4600480360360a081101561008a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506102cd565b6040518082815260200191505060405180910390f35b34801561011657600080fd5b5061014d6004803603604081101561012d57600080fd5b810190808035906020019092919080359060200190929190505050610aee565b604051808215151515815260200191505060405180910390f35b34801561017357600080fd5b506101a06004803603602081101561018a57600080fd5b8101908080359060200190929190505050611086565b604051808215151515815260200191505060405180910390f35b3480156101c657600080fd5b506101f3600480360360208110156101dd57600080fd5b8101908080359060200190929190505050611565565b604051808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018781526020018681526020018581526020018415151515815260200183151515158152602001828152602001995050505050505050505060405180910390f35b600082338360008111151561034a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f746f6b656e20616d6f756e74206d757374206265203e2030000000000000000081525060200191505060405180910390fd5b808373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84306040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561041857600080fd5b505afa15801561042c573d6000803e3d6000fd5b505050506040513d602081101561044257600080fd5b8101908080519060200190929190505050101515156104ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f746f6b656e20616c6c6f77616e6365206d757374206265203e3d20616d6f756e81526020017f740000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b86428111151561058d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f74696d656c6f636b2074696d65206d75737420626520696e207468652066757481526020017f757265000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6002338b89898d8d604051602001808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140184815260200183815260200182815260200196505050505050506040516020818303038152906040526040518082805190602001908083835b6020831015156106bd5780518252602082019150602081019050602083039250610698565b6001836020036101000a038019825116818451168082178552505050505050905001915050602060405180830381855afa1580156106ff573d6000803e3d6000fd5b5050506040513d602081101561071457600080fd5b81019080805190602001909291905050509450610730856116a5565b1561073a57600080fd5b8673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330896040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561081157600080fd5b505af1158015610825573d6000803e3d6000fd5b505050506040513d602081101561083b57600080fd5b8101908080519060200190929190505050151561085757600080fd5b610120604051908101604052803373ffffffffffffffffffffffffffffffffffffffff1681526020018b73ffffffffffffffffffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff1681526020018781526020018a8152602001898152602001600015158152602001600015158152602001600060010281525060008087815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550606082015181600301556080820151816004015560a0820151816005015560c08201518160060160006101000a81548160ff02191690831515021790555060e08201518160060160016101000a81548160ff02191690831515021790555061010082015181600701559050508973ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16867f4ea4e99f860572a3879af5b9ed9265b3627da34e69374831e62cf9c1a037b5a38a8a8e8e604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200182815260200194505050505060405180910390a45050505095945050505050565b600082610afa816116a5565b1515610b6e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f636f6e7472616374496420646f6573206e6f742065786973740000000000000081525060200191505060405180910390fd5b8383600281604051602001808281526020019150506040516020818303038152906040526040518082805190602001908083835b602083101515610bc75780518252602082019150602081019050602083039250610ba2565b6001836020036101000a038019825116818451168082178552505050505050905001915050602060405180830381855afa158015610c09573d6000803e3d6000fd5b5050506040513d6020811015610c1e57600080fd5b810190808051906020019092919050505060008084815260200190815260200160002060040154141515610cba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f686173686c6f636b206861736820646f6573206e6f74206d617463680000000081525060200191505060405180910390fd5b853373ffffffffffffffffffffffffffffffffffffffff1660008083815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610d93576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f776974686472617761626c653a206e6f7420726563656976657200000000000081525060200191505060405180910390fd5b6000151560008083815260200190815260200160002060060160009054906101000a900460ff161515141515610e31576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f776974686472617761626c653a20616c72656164792077697468647261776e0081525060200191505060405180910390fd5b4260008083815260200190815260200160002060050154111515610ee3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260318152602001807f776974686472617761626c653a2074696d656c6f636b2074696d65206d75737481526020017f20626520696e207468652066757475726500000000000000000000000000000081525060400191505060405180910390fd5b6000806000898152602001908152602001600020905086816007018190555060018160060160006101000a81548160ff0219169083151502179055508060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8260010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683600301546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561100e57600080fd5b505af1158015611022573d6000803e3d6000fd5b505050506040513d602081101561103857600080fd5b810190808051906020019092919050505050877fb274ecbfbc0eda7b3618d62964d187a407e800a7cde2665de83e90b5acc1384160405160405180910390a260019550505050505092915050565b600081611092816116a5565b1515611106576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f636f6e7472616374496420646f6573206e6f742065786973740000000000000081525060200191505060405180910390fd5b823373ffffffffffffffffffffffffffffffffffffffff1660008083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156111df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f726566756e6461626c653a206e6f742073656e6465720000000000000000000081525060200191505060405180910390fd5b6000151560008083815260200190815260200160002060060160019054906101000a900460ff16151514151561127d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f726566756e6461626c653a20616c726561647920726566756e6465640000000081525060200191505060405180910390fd5b6000151560008083815260200190815260200160002060060160009054906101000a900460ff16151514151561131b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f726566756e6461626c653a20616c72656164792077697468647261776e00000081525060200191505060405180910390fd5b4260008083815260200190815260200160002060050154111515156113ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f726566756e6461626c653a2074696d656c6f636b206e6f74207965742070617381526020017f736564000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6000806000868152602001908152602001600020905060018160060160016101000a81548160ff0219169083151502179055508060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8260000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683600301546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156114f057600080fd5b505af1158015611504573d6000803e3d6000fd5b505050506040513d602081101561151a57600080fd5b810190808051906020019092919050505050847fd2e595f42ef29a918206aacb16643bc6b5217990d79865d467ab625e3174a55d60405160405180910390a260019350505050919050565b600080600080600080600080600080151561157f8b6116a5565b151514156115c7576000806000806000806000806000889850879750869650859550846001029450839350806001029050985098509850985098509850985098509850611698565b60008060008c815260200190815260200160002090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168260020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168360030154846004015485600501548660060160009054906101000a900460ff168760060160019054906101000a900460ff168860070154995099509950995099509950995099509950505b9193959799909294969850565b60008073ffffffffffffffffffffffffffffffffffffffff1660008084815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415905091905056fea165627a7a72305820ac024e01298ebb013a11e135270e66f52d0a4058422941f30432c53593744a3f0029", + "deployedBytecode": "0x608060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063398a7a9814610067578063636151491461010a5780637249fbb614610167578063e16c7d98146101ba575b600080fd5b34801561007357600080fd5b506100f4600480360360a081101561008a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506102cd565b6040518082815260200191505060405180910390f35b34801561011657600080fd5b5061014d6004803603604081101561012d57600080fd5b810190808035906020019092919080359060200190929190505050610aee565b604051808215151515815260200191505060405180910390f35b34801561017357600080fd5b506101a06004803603602081101561018a57600080fd5b8101908080359060200190929190505050611086565b604051808215151515815260200191505060405180910390f35b3480156101c657600080fd5b506101f3600480360360208110156101dd57600080fd5b8101908080359060200190929190505050611565565b604051808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018781526020018681526020018581526020018415151515815260200183151515158152602001828152602001995050505050505050505060405180910390f35b600082338360008111151561034a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f746f6b656e20616d6f756e74206d757374206265203e2030000000000000000081525060200191505060405180910390fd5b808373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84306040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561041857600080fd5b505afa15801561042c573d6000803e3d6000fd5b505050506040513d602081101561044257600080fd5b8101908080519060200190929190505050101515156104ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f746f6b656e20616c6c6f77616e6365206d757374206265203e3d20616d6f756e81526020017f740000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b86428111151561058d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f74696d656c6f636b2074696d65206d75737420626520696e207468652066757481526020017f757265000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6002338b89898d8d604051602001808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140184815260200183815260200182815260200196505050505050506040516020818303038152906040526040518082805190602001908083835b6020831015156106bd5780518252602082019150602081019050602083039250610698565b6001836020036101000a038019825116818451168082178552505050505050905001915050602060405180830381855afa1580156106ff573d6000803e3d6000fd5b5050506040513d602081101561071457600080fd5b81019080805190602001909291905050509450610730856116a5565b1561073a57600080fd5b8673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330896040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561081157600080fd5b505af1158015610825573d6000803e3d6000fd5b505050506040513d602081101561083b57600080fd5b8101908080519060200190929190505050151561085757600080fd5b610120604051908101604052803373ffffffffffffffffffffffffffffffffffffffff1681526020018b73ffffffffffffffffffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff1681526020018781526020018a8152602001898152602001600015158152602001600015158152602001600060010281525060008087815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550606082015181600301556080820151816004015560a0820151816005015560c08201518160060160006101000a81548160ff02191690831515021790555060e08201518160060160016101000a81548160ff02191690831515021790555061010082015181600701559050508973ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16867f4ea4e99f860572a3879af5b9ed9265b3627da34e69374831e62cf9c1a037b5a38a8a8e8e604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200182815260200194505050505060405180910390a45050505095945050505050565b600082610afa816116a5565b1515610b6e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f636f6e7472616374496420646f6573206e6f742065786973740000000000000081525060200191505060405180910390fd5b8383600281604051602001808281526020019150506040516020818303038152906040526040518082805190602001908083835b602083101515610bc75780518252602082019150602081019050602083039250610ba2565b6001836020036101000a038019825116818451168082178552505050505050905001915050602060405180830381855afa158015610c09573d6000803e3d6000fd5b5050506040513d6020811015610c1e57600080fd5b810190808051906020019092919050505060008084815260200190815260200160002060040154141515610cba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f686173686c6f636b206861736820646f6573206e6f74206d617463680000000081525060200191505060405180910390fd5b853373ffffffffffffffffffffffffffffffffffffffff1660008083815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610d93576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f776974686472617761626c653a206e6f7420726563656976657200000000000081525060200191505060405180910390fd5b6000151560008083815260200190815260200160002060060160009054906101000a900460ff161515141515610e31576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f776974686472617761626c653a20616c72656164792077697468647261776e0081525060200191505060405180910390fd5b4260008083815260200190815260200160002060050154111515610ee3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260318152602001807f776974686472617761626c653a2074696d656c6f636b2074696d65206d75737481526020017f20626520696e207468652066757475726500000000000000000000000000000081525060400191505060405180910390fd5b6000806000898152602001908152602001600020905086816007018190555060018160060160006101000a81548160ff0219169083151502179055508060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8260010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683600301546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561100e57600080fd5b505af1158015611022573d6000803e3d6000fd5b505050506040513d602081101561103857600080fd5b810190808051906020019092919050505050877fb274ecbfbc0eda7b3618d62964d187a407e800a7cde2665de83e90b5acc1384160405160405180910390a260019550505050505092915050565b600081611092816116a5565b1515611106576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f636f6e7472616374496420646f6573206e6f742065786973740000000000000081525060200191505060405180910390fd5b823373ffffffffffffffffffffffffffffffffffffffff1660008083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156111df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f726566756e6461626c653a206e6f742073656e6465720000000000000000000081525060200191505060405180910390fd5b6000151560008083815260200190815260200160002060060160019054906101000a900460ff16151514151561127d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f726566756e6461626c653a20616c726561647920726566756e6465640000000081525060200191505060405180910390fd5b6000151560008083815260200190815260200160002060060160009054906101000a900460ff16151514151561131b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f726566756e6461626c653a20616c72656164792077697468647261776e00000081525060200191505060405180910390fd5b4260008083815260200190815260200160002060050154111515156113ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f726566756e6461626c653a2074696d656c6f636b206e6f74207965742070617381526020017f736564000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6000806000868152602001908152602001600020905060018160060160016101000a81548160ff0219169083151502179055508060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8260000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683600301546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156114f057600080fd5b505af1158015611504573d6000803e3d6000fd5b505050506040513d602081101561151a57600080fd5b810190808051906020019092919050505050847fd2e595f42ef29a918206aacb16643bc6b5217990d79865d467ab625e3174a55d60405160405180910390a260019350505050919050565b600080600080600080600080600080151561157f8b6116a5565b151514156115c7576000806000806000806000806000889850879750869650859550846001029450839350806001029050985098509850985098509850985098509850611698565b60008060008c815260200190815260200160002090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168260020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168360030154846004015485600501548660060160009054906101000a900460ff168760060160019054906101000a900460ff168860070154995099509950995099509950995099509950505b9193959799909294969850565b60008073ffffffffffffffffffffffffffffffffffffffff1660008084815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415905091905056fea165627a7a72305820ac024e01298ebb013a11e135270e66f52d0a4058422941f30432c53593744a3f0029", + "sourceMap": "917:7497:1:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;917:7497:1;;;;;;;", + "deployedSourceMap": "917:7497:1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4229:1453;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4229:1453:1;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;4229:1453:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6016:476;;8:9:-1;5:2;;;30:1;27;20:12;5:2;6016:476:1;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;6016:476:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6763:368;;8:9:-1;5:2;;;30:1;27;20:12;5:2;6763:368:1;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;6763:368:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7304:801;;8:9:-1;5:2;;;30:1;27;20:12;5:2;7304:801:1;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;7304:801:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4229:1453;4520:18;4432:14;4448:10;4460:7;1719:1;1709:7;:11;1701:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1831:7;1786:6;1780:23;;;1804:7;1821:4;1780:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1780:47:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1780:47:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1780:47:1;;;;;;;;;;;;;;;;:58;;1759:138;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4492:9;2192:3;2184:5;:11;2176:59;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4567:226;4621:10;4649:9;4676:14;4708:7;4733:9;4760;4587:196;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;4587:196:1;;;4567:226;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;4567:226:1;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4567:226:1;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;4567:226:1;;;;;;;;;;;;;;;;4554:239;;4993:24;5006:10;4993:12;:24::i;:::-;4989:50;;;5031:8;;;4989:50;5128:14;5122:34;;;5157:10;5177:4;5184:7;5122:70;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5122:70:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5122:70:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;5122:70:1;;;;;;;;;;;;;;;;5121:71;5117:97;;;5206:8;;;5117:97;5249:219;;;;;;;;;5275:10;5249:219;;;;;;5299:9;5249:219;;;;;;5322:14;5249:219;;;;;;5350:7;5249:219;;;;5371:9;5249:219;;;;5394:9;5249:219;;;;5417:5;5249:219;;;;;;5436:5;5249:219;;;;;;5455:3;5249:219;;;;;5225:9;:21;5235:10;5225:21;;;;;;;;;;;:243;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5561:9;5484:191;;5537:10;5484:191;;5513:10;5484:191;5584:14;5612:7;5633:9;5656;5484:191;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1907:1;4229:1453;;;;;;;;;;:::o;6016:476::-;6226:4;6114:11;2321:25;2334:11;2321:12;:25::i;:::-;2313:63;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6151:11;6164:9;2523:28;2547:2;2530:20;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;2530:20:1;;;2523:28;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;2523:28:1;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2523:28:1;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;2523:28:1;;;;;;;;;;;;;;;;2488:9;:22;2498:11;2488:22;;;;;;;;;;;:31;;;:63;2467:138;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6196:11;2724:10;2689:45;;:9;:22;2699:11;2689:22;;;;;;;;;;;:31;;;;;;;;;;;;:45;;;2681:84;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2819:5;2783:41;;:9;:22;2793:11;2783:22;;;;;;;;;;;:32;;;;;;;;;;;;:41;;;2775:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2912:3;2878:9;:22;2888:11;2878:22;;;;;;;;;;;:31;;;:37;2870:99;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6246:22;6271:9;:22;6281:11;6271:22;;;;;;;;;;;6246:47;;6316:9;6303:1;:10;;:22;;;;6349:4;6335:1;:11;;;:18;;;;;;;;;;;;;;;;;;6369:1;:15;;;;;;;;;;;;6363:31;;;6395:1;:10;;;;;;;;;;;;6407:1;:8;;;6363:53;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;6363:53:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;6363:53:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;6363:53:1;;;;;;;;;;;;;;;;;6452:11;6431:33;;;;;;;;;;6481:4;6474:11;;;2615:1;2386;;6016:476;;;;;:::o;6763:368::-;6902:4;6840:11;2321:25;2334:11;2321:12;:25::i;:::-;2313:63;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6872:11;3084:10;3051:43;;:9;:22;3061:11;3051:22;;;;;;;;;;;:29;;;;;;;;;;;;:43;;;3043:78;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3174:5;3139:40;;:9;:22;3149:11;3139:22;;;;;;;;;;;:31;;;;;;;;;;;;:40;;;3131:81;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3266:5;3230:41;;:9;:22;3240:11;3230:22;;;;;;;;;;;:32;;;;;;;;;;;;:41;;;3222:83;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3358:3;3323:9;:22;3333:11;3323:22;;;;;;;;;;;:31;;;:38;;3315:86;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6922:22;6947:9;:22;6957:11;6947:22;;;;;;;;;;;6922:47;;6992:4;6979:1;:10;;;:17;;;;;;;;;;;;;;;;;;7012:1;:15;;;;;;;;;;;;7006:31;;;7038:1;:8;;;;;;;;;;;;7048:1;:8;;;7006:51;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;7006:51:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;7006:51:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;7006:51:1;;;;;;;;;;;;;;;;;7091:11;7072:31;;;;;;;;;;7120:4;7113:11;;;2386:1;6763:368;;;;:::o;7304:801::-;7404:14;7432:16;7462:21;7497:11;7522:16;7552:13;7579:14;7607:13;7634:16;7708:5;7679:34;;:25;7692:11;7679:12;:25::i;:::-;:34;;;7675:121;;;7743:1;7755;7767;7771;7774;7777;7780:5;7787;7794:1;7727:69;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7675:121;7806:22;7831:9;:22;7841:11;7831:22;;;;;;;;;;;7806:47;;7884:1;:8;;;;;;;;;;;;7906:1;:10;;;;;;;;;;;;7930:1;:15;;;;;;;;;;;;7959:1;:8;;;7981:1;:10;;;8005:1;:10;;;8029:1;:11;;;;;;;;;;;;8054:1;:10;;;;;;;;;;;;8078:1;:10;;;7863:235;;;;;;;;;;;;;;;;;;;7304:801;;;;;;;;;;;;:::o;8233:178::-;8323:11;8401:1;8360:43;;:9;:22;8370:11;8360:22;;;;;;;;;;;:29;;;;;;;;;;;;:43;;;;8350:54;;8233:178;;;:::o", + "source": "pragma solidity ^0.5.0;\n\nimport \"openzeppelin-solidity/contracts/token/ERC20/ERC20.sol\";\n\n/**\n* @title Hashed Timelock Contracts (HTLCs) on Ethereum ERC20 tokens.\n*\n* This contract provides a way to create and keep HTLCs for ERC20 tokens.\n*\n* See HashedTimelock.sol for a contract that provides the same functions \n* for the native ETH token.\n*\n* Protocol:\n*\n* 1) newContract(receiver, hashlock, timelock, tokenContract, amount) - a \n* sender calls this to create a new HTLC on a given token (tokenContract) \n* for a given amount. A 32 byte contract id is returned\n* 2) withdraw(contractId, preimage) - once the receiver knows the preimage of\n* the hashlock hash they can claim the tokens with this function\n* 3) refund() - after timelock has expired and if the receiver did not \n* withdraw the tokens the sender / creater of the HTLC can get their tokens \n* back with this function.\n */\ncontract HashedTimelockERC20 {\n\n event LogHTLCERC20New(\n bytes32 indexed contractId,\n address indexed sender,\n address indexed receiver,\n address tokenContract,\n uint amount,\n bytes32 hashlock,\n uint timelock\n );\n event LogHTLCERC20Withdraw(bytes32 indexed contractId);\n event LogHTLCERC20Refund(bytes32 indexed contractId);\n\n struct LockContract {\n address sender;\n address receiver;\n address tokenContract;\n uint amount;\n bytes32 hashlock;\n uint timelock; // UNIX timestamp seconds - locked UNTIL this time\n bool withdrawn;\n bool refunded;\n bytes32 preimage;\n }\n\n modifier tokensTransferable(address _token, address _sender, uint _amount) {\n require(_amount > 0, \"token amount must be > 0\");\n require(\n ERC20(_token).allowance(_sender, address(this)) >= _amount,\n \"token allowance must be >= amount\"\n );\n _;\n }\n modifier futureTimelock(uint _time) {\n // only requirement is the timelock time is after the last blocktime (now).\n // probably want something a bit further in the future then this.\n // but this is still a useful sanity check:\n require(_time > now, \"timelock time must be in the future\");\n _;\n }\n modifier contractExists(bytes32 _contractId) {\n require(haveContract(_contractId), \"contractId does not exist\");\n _;\n }\n modifier hashlockMatches(bytes32 _contractId, bytes32 _x) {\n require(\n contracts[_contractId].hashlock == sha256(abi.encodePacked(_x)),\n \"hashlock hash does not match\"\n );\n _;\n }\n modifier withdrawable(bytes32 _contractId) {\n require(contracts[_contractId].receiver == msg.sender, \"withdrawable: not receiver\");\n require(contracts[_contractId].withdrawn == false, \"withdrawable: already withdrawn\");\n require(contracts[_contractId].timelock > now, \"withdrawable: timelock time must be in the future\");\n _;\n }\n modifier refundable(bytes32 _contractId) {\n require(contracts[_contractId].sender == msg.sender, \"refundable: not sender\");\n require(contracts[_contractId].refunded == false, \"refundable: already refunded\");\n require(contracts[_contractId].withdrawn == false, \"refundable: already withdrawn\");\n require(contracts[_contractId].timelock <= now, \"refundable: timelock not yet passed\");\n _;\n }\n\n mapping (bytes32 => LockContract) contracts;\n\n /**\n * @dev Sender / Payer sets up a new hash time lock contract depositing the\n * funds and providing the reciever and terms.\n *\n * NOTE: _receiver must first call approve() on the token contract. \n * See allowance check in tokensTransferable modifier.\n\n * @param _receiver Receiver of the tokens.\n * @param _hashlock A sha-2 sha256 hash hashlock.\n * @param _timelock UNIX epoch seconds time that the lock expires at. \n * Refunds can be made after this time.\n * @param _tokenContract ERC20 Token contract address.\n * @param _amount Amount of the token to lock up.\n * @return contractId Id of the new HTLC. This is needed for subsequent \n * calls.\n */\n function newContract(\n address _receiver,\n bytes32 _hashlock,\n uint _timelock,\n address _tokenContract,\n uint _amount\n )\n external\n tokensTransferable(_tokenContract, msg.sender, _amount)\n futureTimelock(_timelock)\n returns (bytes32 contractId)\n {\n contractId = sha256(\n abi.encodePacked(\n msg.sender,\n _receiver,\n _tokenContract,\n _amount,\n _hashlock,\n _timelock\n )\n );\n\n // Reject if a contract already exists with the same parameters. The\n // sender must change one of these parameters (ideally providing a\n // different _hashlock).\n if (haveContract(contractId))\n revert();\n\n // This contract becomes the temporary owner of the tokens\n if (!ERC20(_tokenContract).transferFrom(msg.sender, address(this), _amount))\n revert();\n\n contracts[contractId] = LockContract(\n msg.sender,\n _receiver,\n _tokenContract,\n _amount,\n _hashlock,\n _timelock,\n false,\n false,\n 0x0\n );\n\n emit LogHTLCERC20New(\n contractId,\n msg.sender,\n _receiver,\n _tokenContract,\n _amount,\n _hashlock,\n _timelock\n );\n }\n\n /**\n * @dev Called by the receiver once they know the preimage of the hashlock.\n * This will transfer ownership of the locked tokens to their address.\n *\n * @param _contractId Id of the HTLC.\n * @param _preimage sha256(_preimage) should equal the contract hashlock.\n * @return bool true on success\n */\n function withdraw(bytes32 _contractId, bytes32 _preimage)\n external\n contractExists(_contractId)\n hashlockMatches(_contractId, _preimage)\n withdrawable(_contractId)\n returns (bool)\n {\n LockContract storage c = contracts[_contractId];\n c.preimage = _preimage;\n c.withdrawn = true;\n ERC20(c.tokenContract).transfer(c.receiver, c.amount);\n emit LogHTLCERC20Withdraw(_contractId);\n return true;\n }\n\n /**\n * @dev Called by the sender if there was no withdraw AND the time lock has\n * expired. This will restore ownership of the tokens to the sender.\n *\n * @param _contractId Id of HTLC to refund from.\n * @return bool true on success\n */\n function refund(bytes32 _contractId)\n external\n contractExists(_contractId)\n refundable(_contractId)\n returns (bool)\n {\n LockContract storage c = contracts[_contractId];\n c.refunded = true;\n ERC20(c.tokenContract).transfer(c.sender, c.amount);\n emit LogHTLCERC20Refund(_contractId);\n return true;\n }\n\n /**\n * @dev Get contract details.\n * @param _contractId HTLC contract id\n * @return All parameters in struct LockContract for _contractId HTLC\n */\n function getContract(bytes32 _contractId)\n public\n view\n returns (\n address sender,\n address receiver,\n address tokenContract,\n uint amount,\n bytes32 hashlock,\n uint timelock,\n bool withdrawn,\n bool refunded,\n bytes32 preimage\n )\n {\n if (haveContract(_contractId) == false)\n return (address(0), address(0), address(0), 0, 0, 0, false, false, 0);\n LockContract storage c = contracts[_contractId];\n return (\n c.sender,\n c.receiver,\n c.tokenContract,\n c.amount,\n c.hashlock,\n c.timelock,\n c.withdrawn,\n c.refunded,\n c.preimage\n );\n }\n\n /**\n * @dev Is there a contract with id _contractId.\n * @param _contractId Id into contracts mapping.\n */\n function haveContract(bytes32 _contractId)\n internal\n view\n returns (bool exists)\n {\n exists = (contracts[_contractId].sender != address(0));\n }\n\n}\n", + "sourcePath": "/home/hatch/src/eth/hashed-timelock-contract-ethereum/contracts/HashedTimelockERC20.sol", "ast": { - "absolutePath": "/home/hatch/eth/hashed-timelock-contract-ethereum/contracts/HashedTimelockERC20.sol", + "absolutePath": "/home/hatch/src/eth/hashed-timelock-contract-ethereum/contracts/HashedTimelockERC20.sol", "exportedSymbols": { "HashedTimelockERC20": [ - 904 + 935 ] }, - "id": 905, + "id": 936, "nodeType": "SourceUnit", "nodes": [ { - "id": 427, + "id": 439, "literals": [ "solidity", "^", - "0.4", - ".24" + "0.5", + ".0" ], "nodeType": "PragmaDirective", - "src": "0:24:1" - }, - { - "id": 428, - "literals": [ - "experimental", - "v0.5.0" - ], - "nodeType": "PragmaDirective", - "src": "25:29:1" + "src": "0:23:1" }, { "absolutePath": "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol", "file": "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol", - "id": 429, + "id": 440, "nodeType": "ImportDirective", - "scope": 905, - "sourceUnit": 1005, - "src": "56:63:1", + "scope": 936, + "sourceUnit": 1553, + "src": "25:63:1", "symbolAliases": [], "unitAlias": "" }, @@ -249,9 +240,9 @@ "contractKind": "contract", "documentation": "@title Hashed Timelock Contracts (HTLCs) on Ethereum ERC20 tokens.\n* This contract provides a way to create and keep HTLCs for ERC20 tokens.\n* See HashedTimelock.sol for a contract that provides the same functions \nfor the native ETH token.\n* Protocol:\n* 1) newContract(receiver, hashlock, timelock, tokenContract, amount) - a \n sender calls this to create a new HTLC on a given token (tokenContract) \n for a given amount. A 32 byte contract id is returned\n 2) withdraw(contractId, preimage) - once the receiver knows the preimage of\n the hashlock hash they can claim the tokens with this function\n 3) refund() - after timelock has expired and if the receiver did not \n withdraw the tokens the sender / creater of the HTLC can get their tokens \n back with this function.", "fullyImplemented": true, - "id": 904, + "id": 935, "linearizedBaseContracts": [ - 904 + 935 ], "name": "HashedTimelockERC20", "nodeType": "ContractDefinition", @@ -259,21 +250,21 @@ { "anonymous": false, "documentation": null, - "id": 445, + "id": 456, "name": "LogHTLCERC20New", "nodeType": "EventDefinition", "parameters": { - "id": 444, + "id": 455, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 431, + "id": 442, "indexed": true, "name": "contractId", "nodeType": "VariableDeclaration", - "scope": 445, - "src": "1015:26:1", + "scope": 456, + "src": "984:26:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -281,10 +272,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 430, + "id": 441, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1015:7:1", + "src": "984:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -295,12 +286,12 @@ }, { "constant": false, - "id": 433, + "id": 444, "indexed": true, "name": "sender", "nodeType": "VariableDeclaration", - "scope": 445, - "src": "1051:22:1", + "scope": 456, + "src": "1020:22:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -308,10 +299,11 @@ "typeString": "address" }, "typeName": { - "id": 432, + "id": 443, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1051:7:1", + "src": "1020:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -322,12 +314,12 @@ }, { "constant": false, - "id": 435, + "id": 446, "indexed": true, "name": "receiver", "nodeType": "VariableDeclaration", - "scope": 445, - "src": "1083:24:1", + "scope": 456, + "src": "1052:24:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -335,10 +327,11 @@ "typeString": "address" }, "typeName": { - "id": 434, + "id": 445, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1083:7:1", + "src": "1052:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -349,12 +342,12 @@ }, { "constant": false, - "id": 437, + "id": 448, "indexed": false, "name": "tokenContract", "nodeType": "VariableDeclaration", - "scope": 445, - "src": "1117:21:1", + "scope": 456, + "src": "1086:21:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -362,10 +355,11 @@ "typeString": "address" }, "typeName": { - "id": 436, + "id": 447, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1117:7:1", + "src": "1086:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -376,12 +370,12 @@ }, { "constant": false, - "id": 439, + "id": 450, "indexed": false, "name": "amount", "nodeType": "VariableDeclaration", - "scope": 445, - "src": "1148:11:1", + "scope": 456, + "src": "1117:11:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -389,10 +383,10 @@ "typeString": "uint256" }, "typeName": { - "id": 438, + "id": 449, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "1148:4:1", + "src": "1117:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -403,12 +397,12 @@ }, { "constant": false, - "id": 441, + "id": 452, "indexed": false, "name": "hashlock", "nodeType": "VariableDeclaration", - "scope": 445, - "src": "1169:16:1", + "scope": 456, + "src": "1138:16:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -416,10 +410,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 440, + "id": 451, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1169:7:1", + "src": "1138:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -430,12 +424,12 @@ }, { "constant": false, - "id": 443, + "id": 454, "indexed": false, "name": "timelock", "nodeType": "VariableDeclaration", - "scope": 445, - "src": "1195:13:1", + "scope": 456, + "src": "1164:13:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -443,10 +437,10 @@ "typeString": "uint256" }, "typeName": { - "id": 442, + "id": 453, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "1195:4:1", + "src": "1164:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -456,28 +450,28 @@ "visibility": "internal" } ], - "src": "1005:209:1" + "src": "974:209:1" }, - "src": "984:231:1" + "src": "953:231:1" }, { "anonymous": false, "documentation": null, - "id": 449, + "id": 460, "name": "LogHTLCERC20Withdraw", "nodeType": "EventDefinition", "parameters": { - "id": 448, + "id": 459, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 447, + "id": 458, "indexed": true, "name": "contractId", "nodeType": "VariableDeclaration", - "scope": 449, - "src": "1247:26:1", + "scope": 460, + "src": "1216:26:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -485,10 +479,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 446, + "id": 457, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1247:7:1", + "src": "1216:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -498,28 +492,28 @@ "visibility": "internal" } ], - "src": "1246:28:1" + "src": "1215:28:1" }, - "src": "1220:55:1" + "src": "1189:55:1" }, { "anonymous": false, "documentation": null, - "id": 453, + "id": 464, "name": "LogHTLCERC20Refund", "nodeType": "EventDefinition", "parameters": { - "id": 452, + "id": 463, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 451, + "id": 462, "indexed": true, "name": "contractId", "nodeType": "VariableDeclaration", - "scope": 453, - "src": "1305:26:1", + "scope": 464, + "src": "1274:26:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -527,10 +521,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 450, + "id": 461, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1305:7:1", + "src": "1274:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -540,21 +534,21 @@ "visibility": "internal" } ], - "src": "1304:28:1" + "src": "1273:28:1" }, - "src": "1280:53:1" + "src": "1249:53:1" }, { "canonicalName": "HashedTimelockERC20.LockContract", - "id": 472, + "id": 483, "members": [ { "constant": false, - "id": 455, + "id": 466, "name": "sender", "nodeType": "VariableDeclaration", - "scope": 472, - "src": "1369:14:1", + "scope": 483, + "src": "1338:14:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -562,10 +556,11 @@ "typeString": "address" }, "typeName": { - "id": 454, + "id": 465, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1369:7:1", + "src": "1338:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -576,11 +571,11 @@ }, { "constant": false, - "id": 457, + "id": 468, "name": "receiver", "nodeType": "VariableDeclaration", - "scope": 472, - "src": "1393:16:1", + "scope": 483, + "src": "1362:16:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -588,10 +583,11 @@ "typeString": "address" }, "typeName": { - "id": 456, + "id": 467, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1393:7:1", + "src": "1362:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -602,11 +598,11 @@ }, { "constant": false, - "id": 459, + "id": 470, "name": "tokenContract", "nodeType": "VariableDeclaration", - "scope": 472, - "src": "1419:21:1", + "scope": 483, + "src": "1388:21:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -614,10 +610,11 @@ "typeString": "address" }, "typeName": { - "id": 458, + "id": 469, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1419:7:1", + "src": "1388:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -628,11 +625,11 @@ }, { "constant": false, - "id": 461, + "id": 472, "name": "amount", "nodeType": "VariableDeclaration", - "scope": 472, - "src": "1450:11:1", + "scope": 483, + "src": "1419:11:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -640,10 +637,10 @@ "typeString": "uint256" }, "typeName": { - "id": 460, + "id": 471, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "1450:4:1", + "src": "1419:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -654,11 +651,11 @@ }, { "constant": false, - "id": 463, + "id": 474, "name": "hashlock", "nodeType": "VariableDeclaration", - "scope": 472, - "src": "1471:16:1", + "scope": 483, + "src": "1440:16:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -666,10 +663,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 462, + "id": 473, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1471:7:1", + "src": "1440:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -680,11 +677,11 @@ }, { "constant": false, - "id": 465, + "id": 476, "name": "timelock", "nodeType": "VariableDeclaration", - "scope": 472, - "src": "1497:13:1", + "scope": 483, + "src": "1466:13:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -692,10 +689,10 @@ "typeString": "uint256" }, "typeName": { - "id": 464, + "id": 475, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "1497:4:1", + "src": "1466:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -706,11 +703,11 @@ }, { "constant": false, - "id": 467, + "id": 478, "name": "withdrawn", "nodeType": "VariableDeclaration", - "scope": 472, - "src": "1571:14:1", + "scope": 483, + "src": "1540:14:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -718,10 +715,10 @@ "typeString": "bool" }, "typeName": { - "id": 466, + "id": 477, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "1571:4:1", + "src": "1540:4:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -732,11 +729,11 @@ }, { "constant": false, - "id": 469, + "id": 480, "name": "refunded", "nodeType": "VariableDeclaration", - "scope": 472, - "src": "1595:13:1", + "scope": 483, + "src": "1564:13:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -744,10 +741,10 @@ "typeString": "bool" }, "typeName": { - "id": 468, + "id": 479, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "1595:4:1", + "src": "1564:4:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -758,11 +755,11 @@ }, { "constant": false, - "id": 471, + "id": 482, "name": "preimage", "nodeType": "VariableDeclaration", - "scope": 472, - "src": "1618:16:1", + "scope": 483, + "src": "1587:16:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -770,10 +767,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 470, + "id": 481, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1618:7:1", + "src": "1587:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -785,15 +782,15 @@ ], "name": "LockContract", "nodeType": "StructDefinition", - "scope": 904, - "src": "1339:302:1", + "scope": 935, + "src": "1308:302:1", "visibility": "public" }, { "body": { - "id": 501, + "id": 514, "nodeType": "Block", - "src": "1722:215:1", + "src": "1691:224:1", "statements": [ { "expression": { @@ -805,19 +802,19 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 483, + "id": 494, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, - "id": 481, + "id": 492, "name": "_amount", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 478, - "src": "1740:7:1", + "referencedDeclaration": 489, + "src": "1709:7:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -828,14 +825,14 @@ "rightExpression": { "argumentTypes": null, "hexValue": "30", - "id": 482, + "id": 493, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "1750:1:1", + "src": "1719:1:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", @@ -843,7 +840,7 @@ }, "value": "0" }, - "src": "1740:11:1", + "src": "1709:11:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -852,14 +849,14 @@ { "argumentTypes": null, "hexValue": "746f6b656e20616d6f756e74206d757374206265203e2030", - "id": 484, + "id": 495, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "1753:26:1", + "src": "1722:26:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_ef8462853d6a0c63b24b7e3a8f909d1829994486c1a37cf6bbf9abe6b4e2cab7", @@ -879,21 +876,21 @@ "typeString": "literal_string \"token amount must be > 0\"" } ], - "id": 480, + "id": 491, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "1732:7:1", + "referencedDeclaration": 1640, + "src": "1701:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 485, + "id": 496, "isConstant": false, "isLValue": false, "isPure": false, @@ -901,15 +898,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "1732:48:1", + "src": "1701:48:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 486, + "id": 497, "nodeType": "ExpressionStatement", - "src": "1732:48:1" + "src": "1701:48:1" }, { "expression": { @@ -921,7 +918,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 496, + "id": 509, "isConstant": false, "isLValue": false, "isPure": false, @@ -931,12 +928,12 @@ "arguments": [ { "argumentTypes": null, - "id": 492, + "id": 503, "name": "_sender", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 476, - "src": "1835:7:1", + "referencedDeclaration": 487, + "src": "1804:7:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -944,15 +941,53 @@ }, { "argumentTypes": null, - "id": 493, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1070, - "src": "1844:4:1", + "arguments": [ + { + "argumentTypes": null, + "id": 505, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1657, + "src": "1821:4:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_HashedTimelockERC20_$935", + "typeString": "contract HashedTimelockERC20" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_HashedTimelockERC20_$935", + "typeString": "contract HashedTimelockERC20" + } + ], + "id": 504, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1813:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 506, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1813:13:1", "typeDescriptions": { - "typeIdentifier": "t_contract$_HashedTimelockERC20_$904", - "typeString": "contract HashedTimelockERC20" + "typeIdentifier": "t_address", + "typeString": "address" } } ], @@ -963,8 +998,8 @@ "typeString": "address" }, { - "typeIdentifier": "t_contract$_HashedTimelockERC20_$904", - "typeString": "contract HashedTimelockERC20" + "typeIdentifier": "t_address", + "typeString": "address" } ], "expression": { @@ -972,12 +1007,12 @@ "arguments": [ { "argumentTypes": null, - "id": 489, + "id": 500, "name": "_token", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 474, - "src": "1817:6:1", + "referencedDeclaration": 485, + "src": "1786:6:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -991,18 +1026,18 @@ "typeString": "address" } ], - "id": 488, + "id": 499, "name": "ERC20", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1004, - "src": "1811:5:1", + "referencedDeclaration": 1552, + "src": "1780:5:1", "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_ERC20_$1004_$", + "typeIdentifier": "t_type$_t_contract$_ERC20_$1552_$", "typeString": "type(contract ERC20)" } }, - "id": 490, + "id": 501, "isConstant": false, "isLValue": false, "isPure": false, @@ -1010,27 +1045,27 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "1811:13:1", + "src": "1780:13:1", "typeDescriptions": { - "typeIdentifier": "t_contract$_ERC20_$1004", + "typeIdentifier": "t_contract$_ERC20_$1552", "typeString": "contract ERC20" } }, - "id": 491, + "id": 502, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "allowance", "nodeType": "MemberAccess", - "referencedDeclaration": 975, - "src": "1811:23:1", + "referencedDeclaration": 1177, + "src": "1780:23:1", "typeDescriptions": { "typeIdentifier": "t_function_external_view$_t_address_$_t_address_$returns$_t_uint256_$", "typeString": "function (address,address) view external returns (uint256)" } }, - "id": 494, + "id": 507, "isConstant": false, "isLValue": false, "isPure": false, @@ -1038,7 +1073,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "1811:38:1", + "src": "1780:47:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1048,18 +1083,18 @@ "operator": ">=", "rightExpression": { "argumentTypes": null, - "id": 495, + "id": 508, "name": "_amount", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 478, - "src": "1853:7:1", + "referencedDeclaration": 489, + "src": "1831:7:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "1811:49:1", + "src": "1780:58:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -1068,14 +1103,14 @@ { "argumentTypes": null, "hexValue": "746f6b656e20616c6c6f77616e6365206d757374206265203e3d20616d6f756e74", - "id": 497, + "id": 510, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "1874:35:1", + "src": "1852:35:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_98db95208a4165db2bf846b140f267671bc24ad3503084b9b0a60b8f7c8a0ad2", @@ -1095,21 +1130,21 @@ "typeString": "literal_string \"token allowance must be >= amount\"" } ], - "id": 487, + "id": 498, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "1790:7:1", + "referencedDeclaration": 1640, + "src": "1759:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 498, + "id": 511, "isConstant": false, "isLValue": false, "isPure": false, @@ -1117,38 +1152,38 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "1790:129:1", + "src": "1759:138:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 499, + "id": 512, "nodeType": "ExpressionStatement", - "src": "1790:129:1" + "src": "1759:138:1" }, { - "id": 500, + "id": 513, "nodeType": "PlaceholderStatement", - "src": "1929:1:1" + "src": "1907:1:1" } ] }, "documentation": null, - "id": 502, + "id": 515, "name": "tokensTransferable", "nodeType": "ModifierDefinition", "parameters": { - "id": 479, + "id": 490, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 474, + "id": 485, "name": "_token", "nodeType": "VariableDeclaration", - "scope": 502, - "src": "1675:14:1", + "scope": 515, + "src": "1644:14:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1156,10 +1191,11 @@ "typeString": "address" }, "typeName": { - "id": 473, + "id": 484, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1675:7:1", + "src": "1644:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -1170,11 +1206,11 @@ }, { "constant": false, - "id": 476, + "id": 487, "name": "_sender", "nodeType": "VariableDeclaration", - "scope": 502, - "src": "1691:15:1", + "scope": 515, + "src": "1660:15:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1182,10 +1218,11 @@ "typeString": "address" }, "typeName": { - "id": 475, + "id": 486, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1691:7:1", + "src": "1660:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -1196,11 +1233,11 @@ }, { "constant": false, - "id": 478, + "id": 489, "name": "_amount", "nodeType": "VariableDeclaration", - "scope": 502, - "src": "1708:12:1", + "scope": 515, + "src": "1677:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1208,10 +1245,10 @@ "typeString": "uint256" }, "typeName": { - "id": 477, + "id": 488, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "1708:4:1", + "src": "1677:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1221,16 +1258,16 @@ "visibility": "internal" } ], - "src": "1674:47:1" + "src": "1643:47:1" }, - "src": "1647:290:1", + "src": "1616:299:1", "visibility": "internal" }, { "body": { - "id": 514, + "id": 527, "nodeType": "Block", - "src": "1978:297:1", + "src": "1956:297:1", "statements": [ { "expression": { @@ -1242,19 +1279,19 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 509, + "id": 522, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, - "id": 507, + "id": 520, "name": "_time", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 504, - "src": "2206:5:1", + "referencedDeclaration": 517, + "src": "2184:5:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1264,18 +1301,18 @@ "operator": ">", "rightExpression": { "argumentTypes": null, - "id": 508, + "id": 521, "name": "now", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1053, - "src": "2214:3:1", + "referencedDeclaration": 1638, + "src": "2192:3:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "2206:11:1", + "src": "2184:11:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -1284,14 +1321,14 @@ { "argumentTypes": null, "hexValue": "74696d656c6f636b2074696d65206d75737420626520696e2074686520667574757265", - "id": 510, + "id": 523, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2219:37:1", + "src": "2197:37:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_16dbfee8f738f21cc70987859d9176eb37f9ed0572f04024e006404bb83f7086", @@ -1311,21 +1348,21 @@ "typeString": "literal_string \"timelock time must be in the future\"" } ], - "id": 506, + "id": 519, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "2198:7:1", + "referencedDeclaration": 1640, + "src": "2176:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 511, + "id": 524, "isConstant": false, "isLValue": false, "isPure": false, @@ -1333,38 +1370,38 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2198:59:1", + "src": "2176:59:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 512, + "id": 525, "nodeType": "ExpressionStatement", - "src": "2198:59:1" + "src": "2176:59:1" }, { - "id": 513, + "id": 526, "nodeType": "PlaceholderStatement", - "src": "2267:1:1" + "src": "2245:1:1" } ] }, "documentation": null, - "id": 515, + "id": 528, "name": "futureTimelock", "nodeType": "ModifierDefinition", "parameters": { - "id": 505, + "id": 518, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 504, + "id": 517, "name": "_time", "nodeType": "VariableDeclaration", - "scope": 515, - "src": "1966:10:1", + "scope": 528, + "src": "1944:10:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1372,10 +1409,10 @@ "typeString": "uint256" }, "typeName": { - "id": 503, + "id": 516, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "1966:4:1", + "src": "1944:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1385,16 +1422,16 @@ "visibility": "internal" } ], - "src": "1965:12:1" + "src": "1943:12:1" }, - "src": "1942:333:1", + "src": "1920:333:1", "visibility": "internal" }, { "body": { - "id": 527, + "id": 540, "nodeType": "Block", - "src": "2325:91:1", + "src": "2303:91:1", "statements": [ { "expression": { @@ -1405,12 +1442,12 @@ "arguments": [ { "argumentTypes": null, - "id": 521, + "id": 534, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 517, - "src": "2356:11:1", + "referencedDeclaration": 530, + "src": "2334:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -1424,18 +1461,18 @@ "typeString": "bytes32" } ], - "id": 520, + "id": 533, "name": "haveContract", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 903, - "src": "2343:12:1", + "referencedDeclaration": 934, + "src": "2321:12:1", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bool_$", "typeString": "function (bytes32) view returns (bool)" } }, - "id": 522, + "id": 535, "isConstant": false, "isLValue": false, "isPure": false, @@ -1443,7 +1480,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2343:25:1", + "src": "2321:25:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -1452,14 +1489,14 @@ { "argumentTypes": null, "hexValue": "636f6e7472616374496420646f6573206e6f74206578697374", - "id": 523, + "id": 536, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2370:27:1", + "src": "2348:27:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_2ff20efe697688cf49352f50e84b155aa5e8db31cae40badce7570a4e72a088a", @@ -1479,21 +1516,21 @@ "typeString": "literal_string \"contractId does not exist\"" } ], - "id": 519, + "id": 532, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "2335:7:1", + "referencedDeclaration": 1640, + "src": "2313:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 524, + "id": 537, "isConstant": false, "isLValue": false, "isPure": false, @@ -1501,38 +1538,38 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2335:63:1", + "src": "2313:63:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 525, + "id": 538, "nodeType": "ExpressionStatement", - "src": "2335:63:1" + "src": "2313:63:1" }, { - "id": 526, + "id": 539, "nodeType": "PlaceholderStatement", - "src": "2408:1:1" + "src": "2386:1:1" } ] }, "documentation": null, - "id": 528, + "id": 541, "name": "contractExists", "nodeType": "ModifierDefinition", "parameters": { - "id": 518, + "id": 531, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 517, + "id": 530, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 528, - "src": "2304:19:1", + "scope": 541, + "src": "2282:19:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1540,10 +1577,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 516, + "id": 529, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "2304:7:1", + "src": "2282:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -1553,16 +1590,16 @@ "visibility": "internal" } ], - "src": "2303:21:1" + "src": "2281:21:1" }, - "src": "2280:136:1", + "src": "2258:136:1", "visibility": "internal" }, { "body": { - "id": 550, + "id": 563, "nodeType": "Block", - "src": "2479:166:1", + "src": "2457:166:1", "statements": [ { "expression": { @@ -1574,7 +1611,7 @@ "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, - "id": 545, + "id": 558, "isConstant": false, "isLValue": false, "isPure": false, @@ -1585,26 +1622,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 535, + "id": 548, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 639, - "src": "2510:9:1", + "referencedDeclaration": 652, + "src": "2488:9:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$472_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$483_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelockERC20.LockContract storage ref)" } }, - "id": 537, + "id": 550, "indexExpression": { "argumentTypes": null, - "id": 536, + "id": 549, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 530, - "src": "2520:11:1", + "referencedDeclaration": 543, + "src": "2498:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -1615,21 +1652,21 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "2510:22:1", + "src": "2488:22:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage", + "typeIdentifier": "t_struct$_LockContract_$483_storage", "typeString": "struct HashedTimelockERC20.LockContract storage ref" } }, - "id": 538, + "id": 551, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "hashlock", "nodeType": "MemberAccess", - "referencedDeclaration": 463, - "src": "2510:31:1", + "referencedDeclaration": 474, + "src": "2488:31:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -1645,12 +1682,12 @@ "arguments": [ { "argumentTypes": null, - "id": 542, + "id": 555, "name": "_x", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 532, - "src": "2569:2:1", + "referencedDeclaration": 545, + "src": "2547:2:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -1666,18 +1703,18 @@ ], "expression": { "argumentTypes": null, - "id": 540, + "id": 553, "name": "abi", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1038, - "src": "2552:3:1", + "referencedDeclaration": 1623, + "src": "2530:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_abi", "typeString": "abi" } }, - "id": 541, + "id": 554, "isConstant": false, "isLValue": false, "isPure": true, @@ -1685,13 +1722,13 @@ "memberName": "encodePacked", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "2552:16:1", + "src": "2530:16:1", "typeDescriptions": { "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", "typeString": "function () pure returns (bytes memory)" } }, - "id": 543, + "id": 556, "isConstant": false, "isLValue": false, "isPure": false, @@ -1699,7 +1736,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2552:20:1", + "src": "2530:20:1", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" @@ -1713,18 +1750,18 @@ "typeString": "bytes memory" } ], - "id": 539, + "id": 552, "name": "sha256", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1060, - "src": "2545:6:1", + "referencedDeclaration": 1645, + "src": "2523:6:1", "typeDescriptions": { - "typeIdentifier": "t_function_sha256_pure$__$returns$_t_bytes32_$", - "typeString": "function () pure returns (bytes32)" + "typeIdentifier": "t_function_sha256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" } }, - "id": 544, + "id": 557, "isConstant": false, "isLValue": false, "isPure": false, @@ -1732,13 +1769,13 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2545:28:1", + "src": "2523:28:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "src": "2510:63:1", + "src": "2488:63:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -1747,14 +1784,14 @@ { "argumentTypes": null, "hexValue": "686173686c6f636b206861736820646f6573206e6f74206d61746368", - "id": 546, + "id": 559, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2587:30:1", + "src": "2565:30:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_f69d465af376b0946a94d153fa61e1120954d7550ccad2ede50c179df9b911a9", @@ -1774,21 +1811,21 @@ "typeString": "literal_string \"hashlock hash does not match\"" } ], - "id": 534, + "id": 547, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "2489:7:1", + "referencedDeclaration": 1640, + "src": "2467:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 547, + "id": 560, "isConstant": false, "isLValue": false, "isPure": false, @@ -1796,38 +1833,38 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2489:138:1", + "src": "2467:138:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 548, + "id": 561, "nodeType": "ExpressionStatement", - "src": "2489:138:1" + "src": "2467:138:1" }, { - "id": 549, + "id": 562, "nodeType": "PlaceholderStatement", - "src": "2637:1:1" + "src": "2615:1:1" } ] }, "documentation": null, - "id": 551, + "id": 564, "name": "hashlockMatches", "nodeType": "ModifierDefinition", "parameters": { - "id": 533, + "id": 546, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 530, + "id": 543, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 551, - "src": "2446:19:1", + "scope": 564, + "src": "2424:19:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1835,10 +1872,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 529, + "id": 542, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "2446:7:1", + "src": "2424:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -1849,11 +1886,11 @@ }, { "constant": false, - "id": 532, + "id": 545, "name": "_x", "nodeType": "VariableDeclaration", - "scope": 551, - "src": "2467:10:1", + "scope": 564, + "src": "2445:10:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1861,10 +1898,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 531, + "id": 544, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "2467:7:1", + "src": "2445:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -1874,16 +1911,16 @@ "visibility": "internal" } ], - "src": "2445:33:1" + "src": "2423:33:1" }, - "src": "2421:224:1", + "src": "2399:224:1", "visibility": "internal" }, { "body": { - "id": 587, + "id": 600, "nodeType": "Block", - "src": "2693:316:1", + "src": "2671:316:1", "statements": [ { "expression": { @@ -1895,7 +1932,7 @@ "typeIdentifier": "t_address", "typeString": "address" }, - "id": 562, + "id": 575, "isConstant": false, "isLValue": false, "isPure": false, @@ -1906,26 +1943,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 556, + "id": 569, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 639, - "src": "2711:9:1", + "referencedDeclaration": 652, + "src": "2689:9:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$472_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$483_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelockERC20.LockContract storage ref)" } }, - "id": 558, + "id": 571, "indexExpression": { "argumentTypes": null, - "id": 557, + "id": 570, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 553, - "src": "2721:11:1", + "referencedDeclaration": 566, + "src": "2699:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -1936,21 +1973,21 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "2711:22:1", + "src": "2689:22:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage", + "typeIdentifier": "t_struct$_LockContract_$483_storage", "typeString": "struct HashedTimelockERC20.LockContract storage ref" } }, - "id": 559, + "id": 572, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "receiver", "nodeType": "MemberAccess", - "referencedDeclaration": 457, - "src": "2711:31:1", + "referencedDeclaration": 468, + "src": "2689:31:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -1962,18 +1999,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 560, + "id": 573, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "2746:3:1", + "referencedDeclaration": 1636, + "src": "2724:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 561, + "id": 574, "isConstant": false, "isLValue": false, "isPure": false, @@ -1981,13 +2018,13 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "2746:10:1", + "src": "2724:10:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, - "src": "2711:45:1", + "src": "2689:45:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -1996,14 +2033,14 @@ { "argumentTypes": null, "hexValue": "776974686472617761626c653a206e6f74207265636569766572", - "id": 563, + "id": 576, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2758:28:1", + "src": "2736:28:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_2996fe9bb22eca23c8f30e4ecaf6f5ab8925bbafce446942fa02db59ed0654ee", @@ -2023,21 +2060,21 @@ "typeString": "literal_string \"withdrawable: not receiver\"" } ], - "id": 555, + "id": 568, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "2703:7:1", + "referencedDeclaration": 1640, + "src": "2681:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 564, + "id": 577, "isConstant": false, "isLValue": false, "isPure": false, @@ -2045,15 +2082,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2703:84:1", + "src": "2681:84:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 565, + "id": 578, "nodeType": "ExpressionStatement", - "src": "2703:84:1" + "src": "2681:84:1" }, { "expression": { @@ -2065,7 +2102,7 @@ "typeIdentifier": "t_bool", "typeString": "bool" }, - "id": 572, + "id": 585, "isConstant": false, "isLValue": false, "isPure": false, @@ -2076,26 +2113,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 567, + "id": 580, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 639, - "src": "2805:9:1", + "referencedDeclaration": 652, + "src": "2783:9:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$472_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$483_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelockERC20.LockContract storage ref)" } }, - "id": 569, + "id": 582, "indexExpression": { "argumentTypes": null, - "id": 568, + "id": 581, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 553, - "src": "2815:11:1", + "referencedDeclaration": 566, + "src": "2793:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -2106,21 +2143,21 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "2805:22:1", + "src": "2783:22:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage", + "typeIdentifier": "t_struct$_LockContract_$483_storage", "typeString": "struct HashedTimelockERC20.LockContract storage ref" } }, - "id": 570, + "id": 583, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "withdrawn", "nodeType": "MemberAccess", - "referencedDeclaration": 467, - "src": "2805:32:1", + "referencedDeclaration": 478, + "src": "2783:32:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -2131,14 +2168,14 @@ "rightExpression": { "argumentTypes": null, "hexValue": "66616c7365", - "id": 571, + "id": 584, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "2841:5:1", + "src": "2819:5:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -2146,7 +2183,7 @@ }, "value": "false" }, - "src": "2805:41:1", + "src": "2783:41:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -2155,14 +2192,14 @@ { "argumentTypes": null, "hexValue": "776974686472617761626c653a20616c72656164792077697468647261776e", - "id": 573, + "id": 586, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2848:33:1", + "src": "2826:33:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_a7a1491df76b63b166fa25b3631de654587363606d31ccfadcdf86382f44f0da", @@ -2182,21 +2219,21 @@ "typeString": "literal_string \"withdrawable: already withdrawn\"" } ], - "id": 566, + "id": 579, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "2797:7:1", + "referencedDeclaration": 1640, + "src": "2775:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 574, + "id": 587, "isConstant": false, "isLValue": false, "isPure": false, @@ -2204,15 +2241,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2797:85:1", + "src": "2775:85:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 575, + "id": 588, "nodeType": "ExpressionStatement", - "src": "2797:85:1" + "src": "2775:85:1" }, { "expression": { @@ -2224,7 +2261,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 582, + "id": 595, "isConstant": false, "isLValue": false, "isPure": false, @@ -2235,26 +2272,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 577, + "id": 590, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 639, - "src": "2900:9:1", + "referencedDeclaration": 652, + "src": "2878:9:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$472_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$483_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelockERC20.LockContract storage ref)" } }, - "id": 579, + "id": 592, "indexExpression": { "argumentTypes": null, - "id": 578, + "id": 591, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 553, - "src": "2910:11:1", + "referencedDeclaration": 566, + "src": "2888:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -2265,21 +2302,21 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "2900:22:1", + "src": "2878:22:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage", + "typeIdentifier": "t_struct$_LockContract_$483_storage", "typeString": "struct HashedTimelockERC20.LockContract storage ref" } }, - "id": 580, + "id": 593, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "timelock", "nodeType": "MemberAccess", - "referencedDeclaration": 465, - "src": "2900:31:1", + "referencedDeclaration": 476, + "src": "2878:31:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -2289,18 +2326,18 @@ "operator": ">", "rightExpression": { "argumentTypes": null, - "id": 581, + "id": 594, "name": "now", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1053, - "src": "2934:3:1", + "referencedDeclaration": 1638, + "src": "2912:3:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "2900:37:1", + "src": "2878:37:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -2309,14 +2346,14 @@ { "argumentTypes": null, "hexValue": "776974686472617761626c653a2074696d656c6f636b2074696d65206d75737420626520696e2074686520667574757265", - "id": 583, + "id": 596, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2939:51:1", + "src": "2917:51:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_f90a5049b744d27b4e847d49b0f3d774706fdfcfc2fa7fe6498583db4e9e564f", @@ -2336,21 +2373,21 @@ "typeString": "literal_string \"withdrawable: timelock time must be in the future\"" } ], - "id": 576, + "id": 589, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "2892:7:1", + "referencedDeclaration": 1640, + "src": "2870:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 584, + "id": 597, "isConstant": false, "isLValue": false, "isPure": false, @@ -2358,38 +2395,38 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2892:99:1", + "src": "2870:99:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 585, + "id": 598, "nodeType": "ExpressionStatement", - "src": "2892:99:1" + "src": "2870:99:1" }, { - "id": 586, + "id": 599, "nodeType": "PlaceholderStatement", - "src": "3001:1:1" + "src": "2979:1:1" } ] }, "documentation": null, - "id": 588, + "id": 601, "name": "withdrawable", "nodeType": "ModifierDefinition", "parameters": { - "id": 554, + "id": 567, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 553, + "id": 566, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 588, - "src": "2672:19:1", + "scope": 601, + "src": "2650:19:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -2397,10 +2434,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 552, + "id": 565, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "2672:7:1", + "src": "2650:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -2410,16 +2447,16 @@ "visibility": "internal" } ], - "src": "2671:21:1" + "src": "2649:21:1" }, - "src": "2650:359:1", + "src": "2628:359:1", "visibility": "internal" }, { "body": { - "id": 634, + "id": 647, "nodeType": "Block", - "src": "3055:386:1", + "src": "3033:386:1", "statements": [ { "expression": { @@ -2431,7 +2468,7 @@ "typeIdentifier": "t_address", "typeString": "address" }, - "id": 599, + "id": 612, "isConstant": false, "isLValue": false, "isPure": false, @@ -2442,26 +2479,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 593, + "id": 606, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 639, - "src": "3073:9:1", + "referencedDeclaration": 652, + "src": "3051:9:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$472_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$483_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelockERC20.LockContract storage ref)" } }, - "id": 595, + "id": 608, "indexExpression": { "argumentTypes": null, - "id": 594, + "id": 607, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 590, - "src": "3083:11:1", + "referencedDeclaration": 603, + "src": "3061:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -2472,21 +2509,21 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "3073:22:1", + "src": "3051:22:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage", + "typeIdentifier": "t_struct$_LockContract_$483_storage", "typeString": "struct HashedTimelockERC20.LockContract storage ref" } }, - "id": 596, + "id": 609, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", - "referencedDeclaration": 455, - "src": "3073:29:1", + "referencedDeclaration": 466, + "src": "3051:29:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -2498,18 +2535,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 597, + "id": 610, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "3106:3:1", + "referencedDeclaration": 1636, + "src": "3084:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 598, + "id": 611, "isConstant": false, "isLValue": false, "isPure": false, @@ -2517,13 +2554,13 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "3106:10:1", + "src": "3084:10:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, - "src": "3073:43:1", + "src": "3051:43:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -2532,14 +2569,14 @@ { "argumentTypes": null, "hexValue": "726566756e6461626c653a206e6f742073656e646572", - "id": 600, + "id": 613, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "3118:24:1", + "src": "3096:24:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_edd5bfdacb483bdf26b05ebe186281e97d155ca7c516ffe52d11b5e39d79c23a", @@ -2559,21 +2596,21 @@ "typeString": "literal_string \"refundable: not sender\"" } ], - "id": 592, + "id": 605, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "3065:7:1", + "referencedDeclaration": 1640, + "src": "3043:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 601, + "id": 614, "isConstant": false, "isLValue": false, "isPure": false, @@ -2581,15 +2618,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "3065:78:1", + "src": "3043:78:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 602, + "id": 615, "nodeType": "ExpressionStatement", - "src": "3065:78:1" + "src": "3043:78:1" }, { "expression": { @@ -2601,7 +2638,7 @@ "typeIdentifier": "t_bool", "typeString": "bool" }, - "id": 609, + "id": 622, "isConstant": false, "isLValue": false, "isPure": false, @@ -2612,26 +2649,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 604, + "id": 617, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 639, - "src": "3161:9:1", + "referencedDeclaration": 652, + "src": "3139:9:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$472_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$483_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelockERC20.LockContract storage ref)" } }, - "id": 606, + "id": 619, "indexExpression": { "argumentTypes": null, - "id": 605, + "id": 618, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 590, - "src": "3171:11:1", + "referencedDeclaration": 603, + "src": "3149:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -2642,21 +2679,21 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "3161:22:1", + "src": "3139:22:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage", + "typeIdentifier": "t_struct$_LockContract_$483_storage", "typeString": "struct HashedTimelockERC20.LockContract storage ref" } }, - "id": 607, + "id": 620, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "refunded", "nodeType": "MemberAccess", - "referencedDeclaration": 469, - "src": "3161:31:1", + "referencedDeclaration": 480, + "src": "3139:31:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -2667,14 +2704,14 @@ "rightExpression": { "argumentTypes": null, "hexValue": "66616c7365", - "id": 608, + "id": 621, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "3196:5:1", + "src": "3174:5:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -2682,7 +2719,7 @@ }, "value": "false" }, - "src": "3161:40:1", + "src": "3139:40:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -2691,14 +2728,14 @@ { "argumentTypes": null, "hexValue": "726566756e6461626c653a20616c726561647920726566756e646564", - "id": 610, + "id": 623, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "3203:30:1", + "src": "3181:30:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_7b29f51b209a34fdcf95e658d91750e2d1af4c6890c540f7ec9b6060ebd16007", @@ -2718,21 +2755,21 @@ "typeString": "literal_string \"refundable: already refunded\"" } ], - "id": 603, + "id": 616, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "3153:7:1", + "referencedDeclaration": 1640, + "src": "3131:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 611, + "id": 624, "isConstant": false, "isLValue": false, "isPure": false, @@ -2740,15 +2777,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "3153:81:1", + "src": "3131:81:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 612, + "id": 625, "nodeType": "ExpressionStatement", - "src": "3153:81:1" + "src": "3131:81:1" }, { "expression": { @@ -2760,7 +2797,7 @@ "typeIdentifier": "t_bool", "typeString": "bool" }, - "id": 619, + "id": 632, "isConstant": false, "isLValue": false, "isPure": false, @@ -2771,26 +2808,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 614, + "id": 627, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 639, - "src": "3252:9:1", + "referencedDeclaration": 652, + "src": "3230:9:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$472_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$483_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelockERC20.LockContract storage ref)" } }, - "id": 616, + "id": 629, "indexExpression": { "argumentTypes": null, - "id": 615, + "id": 628, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 590, - "src": "3262:11:1", + "referencedDeclaration": 603, + "src": "3240:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -2801,21 +2838,21 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "3252:22:1", + "src": "3230:22:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage", + "typeIdentifier": "t_struct$_LockContract_$483_storage", "typeString": "struct HashedTimelockERC20.LockContract storage ref" } }, - "id": 617, + "id": 630, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "withdrawn", "nodeType": "MemberAccess", - "referencedDeclaration": 467, - "src": "3252:32:1", + "referencedDeclaration": 478, + "src": "3230:32:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -2826,14 +2863,14 @@ "rightExpression": { "argumentTypes": null, "hexValue": "66616c7365", - "id": 618, + "id": 631, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "3288:5:1", + "src": "3266:5:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -2841,7 +2878,7 @@ }, "value": "false" }, - "src": "3252:41:1", + "src": "3230:41:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -2850,14 +2887,14 @@ { "argumentTypes": null, "hexValue": "726566756e6461626c653a20616c72656164792077697468647261776e", - "id": 620, + "id": 633, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "3295:31:1", + "src": "3273:31:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_3b5b42a6105acb76ce8eb8957616623bad95a1e8514f0d2809f4b82a9c3b0fce", @@ -2877,21 +2914,21 @@ "typeString": "literal_string \"refundable: already withdrawn\"" } ], - "id": 613, + "id": 626, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "3244:7:1", + "referencedDeclaration": 1640, + "src": "3222:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 621, + "id": 634, "isConstant": false, "isLValue": false, "isPure": false, @@ -2899,15 +2936,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "3244:83:1", + "src": "3222:83:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 622, + "id": 635, "nodeType": "ExpressionStatement", - "src": "3244:83:1" + "src": "3222:83:1" }, { "expression": { @@ -2919,7 +2956,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 629, + "id": 642, "isConstant": false, "isLValue": false, "isPure": false, @@ -2930,26 +2967,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 624, + "id": 637, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 639, - "src": "3345:9:1", + "referencedDeclaration": 652, + "src": "3323:9:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$472_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$483_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelockERC20.LockContract storage ref)" } }, - "id": 626, + "id": 639, "indexExpression": { "argumentTypes": null, - "id": 625, + "id": 638, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 590, - "src": "3355:11:1", + "referencedDeclaration": 603, + "src": "3333:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -2960,21 +2997,21 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "3345:22:1", + "src": "3323:22:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage", + "typeIdentifier": "t_struct$_LockContract_$483_storage", "typeString": "struct HashedTimelockERC20.LockContract storage ref" } }, - "id": 627, + "id": 640, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "timelock", "nodeType": "MemberAccess", - "referencedDeclaration": 465, - "src": "3345:31:1", + "referencedDeclaration": 476, + "src": "3323:31:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -2984,18 +3021,18 @@ "operator": "<=", "rightExpression": { "argumentTypes": null, - "id": 628, + "id": 641, "name": "now", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1053, - "src": "3380:3:1", + "referencedDeclaration": 1638, + "src": "3358:3:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "3345:38:1", + "src": "3323:38:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -3004,14 +3041,14 @@ { "argumentTypes": null, "hexValue": "726566756e6461626c653a2074696d656c6f636b206e6f742079657420706173736564", - "id": 630, + "id": 643, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "3385:37:1", + "src": "3363:37:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_53ffb24e93d3b349bff6339724d28c73880587cacedffccbcdea5da101fc50b9", @@ -3031,21 +3068,21 @@ "typeString": "literal_string \"refundable: timelock not yet passed\"" } ], - "id": 623, + "id": 636, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "3337:7:1", + "referencedDeclaration": 1640, + "src": "3315:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 631, + "id": 644, "isConstant": false, "isLValue": false, "isPure": false, @@ -3053,38 +3090,38 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "3337:86:1", + "src": "3315:86:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 632, + "id": 645, "nodeType": "ExpressionStatement", - "src": "3337:86:1" + "src": "3315:86:1" }, { - "id": 633, + "id": 646, "nodeType": "PlaceholderStatement", - "src": "3433:1:1" + "src": "3411:1:1" } ] }, "documentation": null, - "id": 635, + "id": 648, "name": "refundable", "nodeType": "ModifierDefinition", "parameters": { - "id": 591, + "id": 604, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 590, + "id": 603, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 635, - "src": "3034:19:1", + "scope": 648, + "src": "3012:19:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -3092,10 +3129,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 589, + "id": 602, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "3034:7:1", + "src": "3012:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -3105,51 +3142,51 @@ "visibility": "internal" } ], - "src": "3033:21:1" + "src": "3011:21:1" }, - "src": "3014:427:1", + "src": "2992:427:1", "visibility": "internal" }, { "constant": false, - "id": 639, + "id": 652, "name": "contracts", "nodeType": "VariableDeclaration", - "scope": 904, - "src": "3447:43:1", + "scope": 935, + "src": "3425:43:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$472_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$483_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelockERC20.LockContract)" }, "typeName": { - "id": 638, + "id": 651, "keyType": { - "id": 636, + "id": 649, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "3456:7:1", + "src": "3434:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "Mapping", - "src": "3447:33:1", + "src": "3425:33:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$472_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$483_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelockERC20.LockContract)" }, "valueType": { "contractScope": null, - "id": 637, + "id": 650, "name": "LockContract", "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 472, - "src": "3467:12:1", + "referencedDeclaration": 483, + "src": "3445:12:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract" } } @@ -3159,26 +3196,26 @@ }, { "body": { - "id": 727, + "id": 742, "nodeType": "Block", - "src": "4566:1141:1", + "src": "4544:1138:1", "statements": [ { "expression": { "argumentTypes": null, - "id": 676, + "id": 689, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, - "id": 663, + "id": 676, "name": "contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 661, - "src": "4576:10:1", + "referencedDeclaration": 674, + "src": "4554:10:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -3196,18 +3233,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 667, + "id": 680, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "4643:3:1", + "referencedDeclaration": 1636, + "src": "4621:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 668, + "id": 681, "isConstant": false, "isLValue": false, "isPure": false, @@ -3215,20 +3252,20 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "4643:10:1", + "src": "4621:10:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, { "argumentTypes": null, - "id": 669, + "id": 682, "name": "_receiver", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 641, - "src": "4671:9:1", + "referencedDeclaration": 654, + "src": "4649:9:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -3236,12 +3273,12 @@ }, { "argumentTypes": null, - "id": 670, + "id": 683, "name": "_tokenContract", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 647, - "src": "4698:14:1", + "referencedDeclaration": 660, + "src": "4676:14:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -3249,12 +3286,12 @@ }, { "argumentTypes": null, - "id": 671, + "id": 684, "name": "_amount", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 649, - "src": "4730:7:1", + "referencedDeclaration": 662, + "src": "4708:7:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3262,12 +3299,12 @@ }, { "argumentTypes": null, - "id": 672, + "id": 685, "name": "_hashlock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 643, - "src": "4755:9:1", + "referencedDeclaration": 656, + "src": "4733:9:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -3275,12 +3312,12 @@ }, { "argumentTypes": null, - "id": 673, + "id": 686, "name": "_timelock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 645, - "src": "4782:9:1", + "referencedDeclaration": 658, + "src": "4760:9:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3290,8 +3327,8 @@ "expression": { "argumentTypes": [ { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, { "typeIdentifier": "t_address", @@ -3316,18 +3353,18 @@ ], "expression": { "argumentTypes": null, - "id": 665, + "id": 678, "name": "abi", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1038, - "src": "4609:3:1", + "referencedDeclaration": 1623, + "src": "4587:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_abi", "typeString": "abi" } }, - "id": 666, + "id": 679, "isConstant": false, "isLValue": false, "isPure": true, @@ -3335,13 +3372,13 @@ "memberName": "encodePacked", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "4609:16:1", + "src": "4587:16:1", "typeDescriptions": { "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", "typeString": "function () pure returns (bytes memory)" } }, - "id": 674, + "id": 687, "isConstant": false, "isLValue": false, "isPure": false, @@ -3349,7 +3386,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "4609:196:1", + "src": "4587:196:1", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" @@ -3363,18 +3400,18 @@ "typeString": "bytes memory" } ], - "id": 664, + "id": 677, "name": "sha256", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1060, - "src": "4589:6:1", + "referencedDeclaration": 1645, + "src": "4567:6:1", "typeDescriptions": { - "typeIdentifier": "t_function_sha256_pure$__$returns$_t_bytes32_$", - "typeString": "function () pure returns (bytes32)" + "typeIdentifier": "t_function_sha256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" } }, - "id": 675, + "id": 688, "isConstant": false, "isLValue": false, "isPure": false, @@ -3382,21 +3419,21 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "4589:226:1", + "src": "4567:226:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "src": "4576:239:1", + "src": "4554:239:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "id": 677, + "id": 690, "nodeType": "ExpressionStatement", - "src": "4576:239:1" + "src": "4554:239:1" }, { "condition": { @@ -3404,12 +3441,12 @@ "arguments": [ { "argumentTypes": null, - "id": 679, + "id": 692, "name": "contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 661, - "src": "5028:10:1", + "referencedDeclaration": 674, + "src": "5006:10:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -3423,18 +3460,18 @@ "typeString": "bytes32" } ], - "id": 678, + "id": 691, "name": "haveContract", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 903, - "src": "5015:12:1", + "referencedDeclaration": 934, + "src": "4993:12:1", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bool_$", "typeString": "function (bytes32) view returns (bool)" } }, - "id": 680, + "id": 693, "isConstant": false, "isLValue": false, "isPure": false, @@ -3442,37 +3479,37 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "5015:24:1", + "src": "4993:24:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, - "id": 684, + "id": 697, "nodeType": "IfStatement", - "src": "5011:50:1", + "src": "4989:50:1", "trueBody": { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], - "id": 681, + "id": 694, "name": "revert", "nodeType": "Identifier", "overloadedDeclarations": [ - 1056, - 1057 + 1641, + 1642 ], - "referencedDeclaration": 1056, - "src": "5053:6:1", + "referencedDeclaration": 1641, + "src": "5031:6:1", "typeDescriptions": { "typeIdentifier": "t_function_revert_pure$__$returns$__$", "typeString": "function () pure" } }, - "id": 682, + "id": 695, "isConstant": false, "isLValue": false, "isPure": false, @@ -3480,21 +3517,21 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "5053:8:1", + "src": "5031:8:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 683, + "id": 696, "nodeType": "ExpressionStatement", - "src": "5053:8:1" + "src": "5031:8:1" } }, { "condition": { "argumentTypes": null, - "id": 694, + "id": 709, "isConstant": false, "isLValue": false, "isPure": false, @@ -3502,7 +3539,7 @@ "nodeType": "UnaryOperation", "operator": "!", "prefix": true, - "src": "5143:62:1", + "src": "5121:71:1", "subExpression": { "argumentTypes": null, "arguments": [ @@ -3510,18 +3547,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 689, + "id": 702, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "5179:3:1", + "referencedDeclaration": 1636, + "src": "5157:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 690, + "id": 703, "isConstant": false, "isLValue": false, "isPure": false, @@ -3529,33 +3566,71 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "5179:10:1", + "src": "5157:10:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, { "argumentTypes": null, - "id": 691, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1070, - "src": "5191:4:1", + "arguments": [ + { + "argumentTypes": null, + "id": 705, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1657, + "src": "5177:4:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_HashedTimelockERC20_$935", + "typeString": "contract HashedTimelockERC20" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_HashedTimelockERC20_$935", + "typeString": "contract HashedTimelockERC20" + } + ], + "id": 704, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5169:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 706, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5169:13:1", "typeDescriptions": { - "typeIdentifier": "t_contract$_HashedTimelockERC20_$904", - "typeString": "contract HashedTimelockERC20" + "typeIdentifier": "t_address", + "typeString": "address" } }, { "argumentTypes": null, - "id": 692, + "id": 707, "name": "_amount", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 649, - "src": "5197:7:1", + "referencedDeclaration": 662, + "src": "5184:7:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3565,12 +3640,12 @@ "expression": { "argumentTypes": [ { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, { - "typeIdentifier": "t_contract$_HashedTimelockERC20_$904", - "typeString": "contract HashedTimelockERC20" + "typeIdentifier": "t_address", + "typeString": "address" }, { "typeIdentifier": "t_uint256", @@ -3582,12 +3657,12 @@ "arguments": [ { "argumentTypes": null, - "id": 686, + "id": 699, "name": "_tokenContract", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 647, - "src": "5150:14:1", + "referencedDeclaration": 660, + "src": "5128:14:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -3601,18 +3676,18 @@ "typeString": "address" } ], - "id": 685, + "id": 698, "name": "ERC20", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1004, - "src": "5144:5:1", + "referencedDeclaration": 1552, + "src": "5122:5:1", "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_ERC20_$1004_$", + "typeIdentifier": "t_type$_t_contract$_ERC20_$1552_$", "typeString": "type(contract ERC20)" } }, - "id": 687, + "id": 700, "isConstant": false, "isLValue": false, "isPure": false, @@ -3620,27 +3695,27 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "5144:21:1", + "src": "5122:21:1", "typeDescriptions": { - "typeIdentifier": "t_contract$_ERC20_$1004", + "typeIdentifier": "t_contract$_ERC20_$1552", "typeString": "contract ERC20" } }, - "id": 688, + "id": 701, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "transferFrom", "nodeType": "MemberAccess", - "referencedDeclaration": 986, - "src": "5144:34:1", + "referencedDeclaration": 1281, + "src": "5122:34:1", "typeDescriptions": { "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$", "typeString": "function (address,address,uint256) external returns (bool)" } }, - "id": 693, + "id": 708, "isConstant": false, "isLValue": false, "isPure": false, @@ -3648,7 +3723,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "5144:61:1", + "src": "5122:70:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -3660,30 +3735,30 @@ } }, "falseBody": null, - "id": 698, + "id": 713, "nodeType": "IfStatement", - "src": "5139:88:1", + "src": "5117:97:1", "trueBody": { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], - "id": 695, + "id": 710, "name": "revert", "nodeType": "Identifier", "overloadedDeclarations": [ - 1056, - 1057 + 1641, + 1642 ], - "referencedDeclaration": 1056, - "src": "5219:6:1", + "referencedDeclaration": 1641, + "src": "5206:6:1", "typeDescriptions": { "typeIdentifier": "t_function_revert_pure$__$returns$__$", "typeString": "function () pure" } }, - "id": 696, + "id": 711, "isConstant": false, "isLValue": false, "isPure": false, @@ -3691,21 +3766,21 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "5219:8:1", + "src": "5206:8:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 697, + "id": 712, "nodeType": "ExpressionStatement", - "src": "5219:8:1" + "src": "5206:8:1" } }, { "expression": { "argumentTypes": null, - "id": 714, + "id": 729, "isConstant": false, "isLValue": false, "isPure": false, @@ -3714,26 +3789,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 699, + "id": 714, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 639, - "src": "5250:9:1", + "referencedDeclaration": 652, + "src": "5225:9:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$472_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$483_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelockERC20.LockContract storage ref)" } }, - "id": 701, + "id": 716, "indexExpression": { "argumentTypes": null, - "id": 700, + "id": 715, "name": "contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 661, - "src": "5260:10:1", + "referencedDeclaration": 674, + "src": "5235:10:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -3744,9 +3819,9 @@ "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", - "src": "5250:21:1", + "src": "5225:21:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage", + "typeIdentifier": "t_struct$_LockContract_$483_storage", "typeString": "struct HashedTimelockERC20.LockContract storage ref" } }, @@ -3759,18 +3834,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 703, + "id": 718, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "5300:3:1", + "referencedDeclaration": 1636, + "src": "5275:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 704, + "id": 719, "isConstant": false, "isLValue": false, "isPure": false, @@ -3778,20 +3853,20 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "5300:10:1", + "src": "5275:10:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, { "argumentTypes": null, - "id": 705, + "id": 720, "name": "_receiver", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 641, - "src": "5324:9:1", + "referencedDeclaration": 654, + "src": "5299:9:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -3799,12 +3874,12 @@ }, { "argumentTypes": null, - "id": 706, + "id": 721, "name": "_tokenContract", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 647, - "src": "5347:14:1", + "referencedDeclaration": 660, + "src": "5322:14:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -3812,12 +3887,12 @@ }, { "argumentTypes": null, - "id": 707, + "id": 722, "name": "_amount", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 649, - "src": "5375:7:1", + "referencedDeclaration": 662, + "src": "5350:7:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3825,12 +3900,12 @@ }, { "argumentTypes": null, - "id": 708, + "id": 723, "name": "_hashlock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 643, - "src": "5396:9:1", + "referencedDeclaration": 656, + "src": "5371:9:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -3838,12 +3913,12 @@ }, { "argumentTypes": null, - "id": 709, + "id": 724, "name": "_timelock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 645, - "src": "5419:9:1", + "referencedDeclaration": 658, + "src": "5394:9:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3852,14 +3927,14 @@ { "argumentTypes": null, "hexValue": "66616c7365", - "id": 710, + "id": 725, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "5442:5:1", + "src": "5417:5:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -3870,14 +3945,14 @@ { "argumentTypes": null, "hexValue": "66616c7365", - "id": 711, + "id": 726, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "5461:5:1", + "src": "5436:5:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -3888,14 +3963,14 @@ { "argumentTypes": null, "hexValue": "307830", - "id": 712, + "id": 727, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "5480:3:1", + "src": "5455:3:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", @@ -3907,8 +3982,8 @@ "expression": { "argumentTypes": [ { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, { "typeIdentifier": "t_address", @@ -3943,18 +4018,18 @@ "typeString": "int_const 0" } ], - "id": 702, + "id": 717, "name": "LockContract", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 472, - "src": "5274:12:1", + "referencedDeclaration": 483, + "src": "5249:12:1", "typeDescriptions": { - "typeIdentifier": "t_type$_t_struct$_LockContract_$472_storage_ptr_$", + "typeIdentifier": "t_type$_t_struct$_LockContract_$483_storage_ptr_$", "typeString": "type(struct HashedTimelockERC20.LockContract storage pointer)" } }, - "id": 713, + "id": 728, "isConstant": false, "isLValue": false, "isPure": false, @@ -3962,21 +4037,21 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "5274:219:1", + "src": "5249:219:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_memory", + "typeIdentifier": "t_struct$_LockContract_$483_memory", "typeString": "struct HashedTimelockERC20.LockContract memory" } }, - "src": "5250:243:1", + "src": "5225:243:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage", + "typeIdentifier": "t_struct$_LockContract_$483_storage", "typeString": "struct HashedTimelockERC20.LockContract storage ref" } }, - "id": 715, + "id": 730, "nodeType": "ExpressionStatement", - "src": "5250:243:1" + "src": "5225:243:1" }, { "eventCall": { @@ -3984,12 +4059,12 @@ "arguments": [ { "argumentTypes": null, - "id": 717, + "id": 732, "name": "contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 661, - "src": "5538:10:1", + "referencedDeclaration": 674, + "src": "5513:10:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -3999,18 +4074,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 718, + "id": 733, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "5562:3:1", + "referencedDeclaration": 1636, + "src": "5537:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 719, + "id": 734, "isConstant": false, "isLValue": false, "isPure": false, @@ -4018,20 +4093,20 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "5562:10:1", + "src": "5537:10:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, { "argumentTypes": null, - "id": 720, + "id": 735, "name": "_receiver", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 641, - "src": "5586:9:1", + "referencedDeclaration": 654, + "src": "5561:9:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -4039,12 +4114,12 @@ }, { "argumentTypes": null, - "id": 721, + "id": 736, "name": "_tokenContract", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 647, - "src": "5609:14:1", + "referencedDeclaration": 660, + "src": "5584:14:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -4052,12 +4127,12 @@ }, { "argumentTypes": null, - "id": 722, + "id": 737, "name": "_amount", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 649, - "src": "5637:7:1", + "referencedDeclaration": 662, + "src": "5612:7:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -4065,12 +4140,12 @@ }, { "argumentTypes": null, - "id": 723, + "id": 738, "name": "_hashlock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 643, - "src": "5658:9:1", + "referencedDeclaration": 656, + "src": "5633:9:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -4078,12 +4153,12 @@ }, { "argumentTypes": null, - "id": 724, + "id": 739, "name": "_timelock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 645, - "src": "5681:9:1", + "referencedDeclaration": 658, + "src": "5656:9:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -4097,8 +4172,8 @@ "typeString": "bytes32" }, { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, { "typeIdentifier": "t_address", @@ -4121,18 +4196,18 @@ "typeString": "uint256" } ], - "id": 716, + "id": 731, "name": "LogHTLCERC20New", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 445, - "src": "5509:15:1", + "referencedDeclaration": 456, + "src": "5484:15:1", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_bytes32_$_t_uint256_$returns$__$", "typeString": "function (bytes32,address,address,address,uint256,bytes32,uint256)" } }, - "id": 725, + "id": 740, "isConstant": false, "isLValue": false, "isPure": false, @@ -4140,34 +4215,33 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "5509:191:1", + "src": "5484:191:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 726, + "id": 741, "nodeType": "EmitStatement", - "src": "5504:196:1" + "src": "5479:196:1" } ] }, "documentation": "@dev Sender / Payer sets up a new hash time lock contract depositing the\nfunds and providing the reciever and terms.\n * NOTE: _receiver must first call approve() on the token contract. \n See allowance check in tokensTransferable modifier.\n@param _receiver Receiver of the tokens.\n@param _hashlock A sha-2 sha256 hash hashlock.\n@param _timelock UNIX epoch seconds time that the lock expires at. \n Refunds can be made after this time.\n@param _tokenContract ERC20 Token contract address.\n@param _amount Amount of the token to lock up.\n@return contractId Id of the new HTLC. This is needed for subsequent \n calls.", - "id": 728, + "id": 743, "implemented": true, - "isConstructor": false, - "isDeclaredConst": false, + "kind": "function", "modifiers": [ { "arguments": [ { "argumentTypes": null, - "id": 652, + "id": 665, "name": "_tokenContract", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 647, - "src": "4454:14:1", + "referencedDeclaration": 660, + "src": "4432:14:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -4177,18 +4251,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 653, + "id": 666, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "4470:3:1", + "referencedDeclaration": 1636, + "src": "4448:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 654, + "id": 667, "isConstant": false, "isLValue": false, "isPure": false, @@ -4196,90 +4270,90 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "4470:10:1", + "src": "4448:10:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, { "argumentTypes": null, - "id": 655, + "id": 668, "name": "_amount", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 649, - "src": "4482:7:1", + "referencedDeclaration": 662, + "src": "4460:7:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], - "id": 656, + "id": 669, "modifierName": { "argumentTypes": null, - "id": 651, + "id": 664, "name": "tokensTransferable", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 502, - "src": "4435:18:1", + "referencedDeclaration": 515, + "src": "4413:18:1", "typeDescriptions": { "typeIdentifier": "t_modifier$_t_address_$_t_address_$_t_uint256_$", "typeString": "modifier (address,address,uint256)" } }, "nodeType": "ModifierInvocation", - "src": "4435:55:1" + "src": "4413:55:1" }, { "arguments": [ { "argumentTypes": null, - "id": 658, + "id": 671, "name": "_timelock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 645, - "src": "4514:9:1", + "referencedDeclaration": 658, + "src": "4492:9:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], - "id": 659, + "id": 672, "modifierName": { "argumentTypes": null, - "id": 657, + "id": 670, "name": "futureTimelock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 515, - "src": "4499:14:1", + "referencedDeclaration": 528, + "src": "4477:14:1", "typeDescriptions": { "typeIdentifier": "t_modifier$_t_uint256_$", "typeString": "modifier (uint256)" } }, "nodeType": "ModifierInvocation", - "src": "4499:25:1" + "src": "4477:25:1" } ], "name": "newContract", "nodeType": "FunctionDefinition", "parameters": { - "id": 650, + "id": 663, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 641, + "id": 654, "name": "_receiver", "nodeType": "VariableDeclaration", - "scope": 728, - "src": "4281:17:1", + "scope": 743, + "src": "4259:17:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -4287,10 +4361,11 @@ "typeString": "address" }, "typeName": { - "id": 640, + "id": 653, "name": "address", "nodeType": "ElementaryTypeName", - "src": "4281:7:1", + "src": "4259:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -4301,11 +4376,11 @@ }, { "constant": false, - "id": 643, + "id": 656, "name": "_hashlock", "nodeType": "VariableDeclaration", - "scope": 728, - "src": "4308:17:1", + "scope": 743, + "src": "4286:17:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -4313,10 +4388,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 642, + "id": 655, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "4308:7:1", + "src": "4286:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -4327,11 +4402,11 @@ }, { "constant": false, - "id": 645, + "id": 658, "name": "_timelock", "nodeType": "VariableDeclaration", - "scope": 728, - "src": "4335:14:1", + "scope": 743, + "src": "4313:14:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -4339,10 +4414,10 @@ "typeString": "uint256" }, "typeName": { - "id": 644, + "id": 657, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "4335:4:1", + "src": "4313:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -4353,11 +4428,11 @@ }, { "constant": false, - "id": 647, + "id": 660, "name": "_tokenContract", "nodeType": "VariableDeclaration", - "scope": 728, - "src": "4359:22:1", + "scope": 743, + "src": "4337:22:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -4365,10 +4440,11 @@ "typeString": "address" }, "typeName": { - "id": 646, + "id": 659, "name": "address", "nodeType": "ElementaryTypeName", - "src": "4359:7:1", + "src": "4337:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -4379,11 +4455,11 @@ }, { "constant": false, - "id": 649, + "id": 662, "name": "_amount", "nodeType": "VariableDeclaration", - "scope": 728, - "src": "4391:12:1", + "scope": 743, + "src": "4369:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -4391,10 +4467,10 @@ "typeString": "uint256" }, "typeName": { - "id": 648, + "id": 661, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "4391:4:1", + "src": "4369:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -4404,20 +4480,19 @@ "visibility": "internal" } ], - "src": "4271:138:1" + "src": "4249:138:1" }, - "payable": false, "returnParameters": { - "id": 662, + "id": 675, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 661, + "id": 674, "name": "contractId", "nodeType": "VariableDeclaration", - "scope": 728, - "src": "4542:18:1", + "scope": 743, + "src": "4520:18:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -4425,10 +4500,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 660, + "id": 673, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "4542:7:1", + "src": "4520:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -4438,47 +4513,47 @@ "visibility": "internal" } ], - "src": "4541:20:1" + "src": "4519:20:1" }, - "scope": 904, - "src": "4251:1456:1", + "scope": 935, + "src": "4229:1453:1", "stateMutability": "nonpayable", "superFunction": null, "visibility": "external" }, { "body": { - "id": 782, + "id": 797, "nodeType": "Block", - "src": "6261:256:1", + "src": "6236:256:1", "statements": [ { "assignments": [ - 748 + 763 ], "declarations": [ { "constant": false, - "id": 748, + "id": 763, "name": "c", "nodeType": "VariableDeclaration", - "scope": 782, - "src": "6271:22:1", + "scope": 797, + "src": "6246:22:1", "stateVariable": false, "storageLocation": "storage", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract" }, "typeName": { "contractScope": null, - "id": 747, + "id": 762, "name": "LockContract", "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 472, - "src": "6271:12:1", + "referencedDeclaration": 483, + "src": "6246:12:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract" } }, @@ -4486,31 +4561,31 @@ "visibility": "internal" } ], - "id": 752, + "id": 767, "initialValue": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 749, + "id": 764, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 639, - "src": "6296:9:1", + "referencedDeclaration": 652, + "src": "6271:9:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$472_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$483_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelockERC20.LockContract storage ref)" } }, - "id": 751, + "id": 766, "indexExpression": { "argumentTypes": null, - "id": 750, + "id": 765, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 730, - "src": "6306:11:1", + "referencedDeclaration": 745, + "src": "6281:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -4521,19 +4596,19 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "6296:22:1", + "src": "6271:22:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage", + "typeIdentifier": "t_struct$_LockContract_$483_storage", "typeString": "struct HashedTimelockERC20.LockContract storage ref" } }, "nodeType": "VariableDeclarationStatement", - "src": "6271:47:1" + "src": "6246:47:1" }, { "expression": { "argumentTypes": null, - "id": 757, + "id": 772, "isConstant": false, "isLValue": false, "isPure": false, @@ -4542,26 +4617,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 753, + "id": 768, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 748, - "src": "6328:1:1", + "referencedDeclaration": 763, + "src": "6303:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 755, + "id": 770, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "memberName": "preimage", "nodeType": "MemberAccess", - "referencedDeclaration": 471, - "src": "6328:10:1", + "referencedDeclaration": 482, + "src": "6303:10:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -4571,31 +4646,31 @@ "operator": "=", "rightHandSide": { "argumentTypes": null, - "id": 756, + "id": 771, "name": "_preimage", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 732, - "src": "6341:9:1", + "referencedDeclaration": 747, + "src": "6316:9:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "src": "6328:22:1", + "src": "6303:22:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "id": 758, + "id": 773, "nodeType": "ExpressionStatement", - "src": "6328:22:1" + "src": "6303:22:1" }, { "expression": { "argumentTypes": null, - "id": 763, + "id": 778, "isConstant": false, "isLValue": false, "isPure": false, @@ -4604,26 +4679,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 759, + "id": 774, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 748, - "src": "6360:1:1", + "referencedDeclaration": 763, + "src": "6335:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 761, + "id": 776, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "memberName": "withdrawn", "nodeType": "MemberAccess", - "referencedDeclaration": 467, - "src": "6360:11:1", + "referencedDeclaration": 478, + "src": "6335:11:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -4634,14 +4709,14 @@ "rightHandSide": { "argumentTypes": null, "hexValue": "74727565", - "id": 762, + "id": 777, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "6374:4:1", + "src": "6349:4:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -4649,15 +4724,15 @@ }, "value": "true" }, - "src": "6360:18:1", + "src": "6335:18:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "id": 764, + "id": 779, "nodeType": "ExpressionStatement", - "src": "6360:18:1" + "src": "6335:18:1" }, { "expression": { @@ -4667,26 +4742,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 770, + "id": 785, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 748, - "src": "6420:1:1", + "referencedDeclaration": 763, + "src": "6395:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 771, + "id": 786, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "receiver", "nodeType": "MemberAccess", - "referencedDeclaration": 457, - "src": "6420:10:1", + "referencedDeclaration": 468, + "src": "6395:10:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -4696,26 +4771,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 772, + "id": 787, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 748, - "src": "6432:1:1", + "referencedDeclaration": 763, + "src": "6407:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 773, + "id": 788, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "amount", "nodeType": "MemberAccess", - "referencedDeclaration": 461, - "src": "6432:8:1", + "referencedDeclaration": 472, + "src": "6407:8:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -4740,26 +4815,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 766, + "id": 781, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 748, - "src": "6394:1:1", + "referencedDeclaration": 763, + "src": "6369:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 767, + "id": 782, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "tokenContract", "nodeType": "MemberAccess", - "referencedDeclaration": 459, - "src": "6394:15:1", + "referencedDeclaration": 470, + "src": "6369:15:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -4773,18 +4848,18 @@ "typeString": "address" } ], - "id": 765, + "id": 780, "name": "ERC20", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1004, - "src": "6388:5:1", + "referencedDeclaration": 1552, + "src": "6363:5:1", "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_ERC20_$1004_$", + "typeIdentifier": "t_type$_t_contract$_ERC20_$1552_$", "typeString": "type(contract ERC20)" } }, - "id": 768, + "id": 783, "isConstant": false, "isLValue": false, "isPure": false, @@ -4792,27 +4867,27 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "6388:22:1", + "src": "6363:22:1", "typeDescriptions": { - "typeIdentifier": "t_contract$_ERC20_$1004", + "typeIdentifier": "t_contract$_ERC20_$1552", "typeString": "contract ERC20" } }, - "id": 769, + "id": 784, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "transfer", "nodeType": "MemberAccess", - "referencedDeclaration": 1027, - "src": "6388:31:1", + "referencedDeclaration": 1196, + "src": "6363:31:1", "typeDescriptions": { "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", "typeString": "function (address,uint256) external returns (bool)" } }, - "id": 774, + "id": 789, "isConstant": false, "isLValue": false, "isPure": false, @@ -4820,15 +4895,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "6388:53:1", + "src": "6363:53:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "id": 775, + "id": 790, "nodeType": "ExpressionStatement", - "src": "6388:53:1" + "src": "6363:53:1" }, { "eventCall": { @@ -4836,12 +4911,12 @@ "arguments": [ { "argumentTypes": null, - "id": 777, + "id": 792, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 730, - "src": "6477:11:1", + "referencedDeclaration": 745, + "src": "6452:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -4855,18 +4930,18 @@ "typeString": "bytes32" } ], - "id": 776, + "id": 791, "name": "LogHTLCERC20Withdraw", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 449, - "src": "6456:20:1", + "referencedDeclaration": 460, + "src": "6431:20:1", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$returns$__$", "typeString": "function (bytes32)" } }, - "id": 778, + "id": 793, "isConstant": false, "isLValue": false, "isPure": false, @@ -4874,28 +4949,28 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "6456:33:1", + "src": "6431:33:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 779, + "id": 794, "nodeType": "EmitStatement", - "src": "6451:38:1" + "src": "6426:38:1" }, { "expression": { "argumentTypes": null, "hexValue": "74727565", - "id": 780, + "id": 795, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "6506:4:1", + "src": "6481:4:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -4903,62 +4978,61 @@ }, "value": "true" }, - "functionReturnParameters": 746, - "id": 781, + "functionReturnParameters": 761, + "id": 796, "nodeType": "Return", - "src": "6499:11:1" + "src": "6474:11:1" } ] }, "documentation": "@dev Called by the receiver once they know the preimage of the hashlock.\nThis will transfer ownership of the locked tokens to their address.\n * @param _contractId Id of the HTLC.\n@param _preimage sha256(_preimage) should equal the contract hashlock.\n@return bool true on success", - "id": 783, + "id": 798, "implemented": true, - "isConstructor": false, - "isDeclaredConst": false, + "kind": "function", "modifiers": [ { "arguments": [ { "argumentTypes": null, - "id": 735, + "id": 750, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 730, - "src": "6139:11:1", + "referencedDeclaration": 745, + "src": "6114:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], - "id": 736, + "id": 751, "modifierName": { "argumentTypes": null, - "id": 734, + "id": 749, "name": "contractExists", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 528, - "src": "6124:14:1", + "referencedDeclaration": 541, + "src": "6099:14:1", "typeDescriptions": { "typeIdentifier": "t_modifier$_t_bytes32_$", "typeString": "modifier (bytes32)" } }, "nodeType": "ModifierInvocation", - "src": "6124:27:1" + "src": "6099:27:1" }, { "arguments": [ { "argumentTypes": null, - "id": 738, + "id": 753, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 730, - "src": "6176:11:1", + "referencedDeclaration": 745, + "src": "6151:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -4966,82 +5040,82 @@ }, { "argumentTypes": null, - "id": 739, + "id": 754, "name": "_preimage", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 732, - "src": "6189:9:1", + "referencedDeclaration": 747, + "src": "6164:9:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], - "id": 740, + "id": 755, "modifierName": { "argumentTypes": null, - "id": 737, + "id": 752, "name": "hashlockMatches", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 551, - "src": "6160:15:1", + "referencedDeclaration": 564, + "src": "6135:15:1", "typeDescriptions": { "typeIdentifier": "t_modifier$_t_bytes32_$_t_bytes32_$", "typeString": "modifier (bytes32,bytes32)" } }, "nodeType": "ModifierInvocation", - "src": "6160:39:1" + "src": "6135:39:1" }, { "arguments": [ { "argumentTypes": null, - "id": 742, + "id": 757, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 730, - "src": "6221:11:1", + "referencedDeclaration": 745, + "src": "6196:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], - "id": 743, + "id": 758, "modifierName": { "argumentTypes": null, - "id": 741, + "id": 756, "name": "withdrawable", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 588, - "src": "6208:12:1", + "referencedDeclaration": 601, + "src": "6183:12:1", "typeDescriptions": { "typeIdentifier": "t_modifier$_t_bytes32_$", "typeString": "modifier (bytes32)" } }, "nodeType": "ModifierInvocation", - "src": "6208:25:1" + "src": "6183:25:1" } ], "name": "withdraw", "nodeType": "FunctionDefinition", "parameters": { - "id": 733, + "id": 748, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 730, + "id": 745, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 783, - "src": "6059:19:1", + "scope": 798, + "src": "6034:19:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -5049,10 +5123,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 729, + "id": 744, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "6059:7:1", + "src": "6034:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -5063,11 +5137,11 @@ }, { "constant": false, - "id": 732, + "id": 747, "name": "_preimage", "nodeType": "VariableDeclaration", - "scope": 783, - "src": "6080:17:1", + "scope": 798, + "src": "6055:17:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -5075,10 +5149,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 731, + "id": 746, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "6080:7:1", + "src": "6055:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -5088,20 +5162,19 @@ "visibility": "internal" } ], - "src": "6058:40:1" + "src": "6033:40:1" }, - "payable": false, "returnParameters": { - "id": 746, + "id": 761, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 745, + "id": 760, "name": "", "nodeType": "VariableDeclaration", - "scope": 783, - "src": "6251:4:1", + "scope": 798, + "src": "6226:4:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -5109,10 +5182,10 @@ "typeString": "bool" }, "typeName": { - "id": 744, + "id": 759, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "6251:4:1", + "src": "6226:4:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -5122,47 +5195,47 @@ "visibility": "internal" } ], - "src": "6250:6:1" + "src": "6225:6:1" }, - "scope": 904, - "src": "6041:476:1", + "scope": 935, + "src": "6016:476:1", "stateMutability": "nonpayable", "superFunction": null, "visibility": "external" }, { "body": { - "id": 825, + "id": 840, "nodeType": "Block", - "src": "6937:219:1", + "src": "6912:219:1", "statements": [ { "assignments": [ - 797 + 812 ], "declarations": [ { "constant": false, - "id": 797, + "id": 812, "name": "c", "nodeType": "VariableDeclaration", - "scope": 825, - "src": "6947:22:1", + "scope": 840, + "src": "6922:22:1", "stateVariable": false, "storageLocation": "storage", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract" }, "typeName": { "contractScope": null, - "id": 796, + "id": 811, "name": "LockContract", "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 472, - "src": "6947:12:1", + "referencedDeclaration": 483, + "src": "6922:12:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract" } }, @@ -5170,31 +5243,31 @@ "visibility": "internal" } ], - "id": 801, + "id": 816, "initialValue": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 798, + "id": 813, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 639, - "src": "6972:9:1", + "referencedDeclaration": 652, + "src": "6947:9:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$472_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$483_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelockERC20.LockContract storage ref)" } }, - "id": 800, + "id": 815, "indexExpression": { "argumentTypes": null, - "id": 799, + "id": 814, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 785, - "src": "6982:11:1", + "referencedDeclaration": 800, + "src": "6957:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -5205,19 +5278,19 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "6972:22:1", + "src": "6947:22:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage", + "typeIdentifier": "t_struct$_LockContract_$483_storage", "typeString": "struct HashedTimelockERC20.LockContract storage ref" } }, "nodeType": "VariableDeclarationStatement", - "src": "6947:47:1" + "src": "6922:47:1" }, { "expression": { "argumentTypes": null, - "id": 806, + "id": 821, "isConstant": false, "isLValue": false, "isPure": false, @@ -5226,26 +5299,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 802, + "id": 817, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 797, - "src": "7004:1:1", + "referencedDeclaration": 812, + "src": "6979:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 804, + "id": 819, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "memberName": "refunded", "nodeType": "MemberAccess", - "referencedDeclaration": 469, - "src": "7004:10:1", + "referencedDeclaration": 480, + "src": "6979:10:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -5256,14 +5329,14 @@ "rightHandSide": { "argumentTypes": null, "hexValue": "74727565", - "id": 805, + "id": 820, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "7017:4:1", + "src": "6992:4:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -5271,15 +5344,15 @@ }, "value": "true" }, - "src": "7004:17:1", + "src": "6979:17:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "id": 807, + "id": 822, "nodeType": "ExpressionStatement", - "src": "7004:17:1" + "src": "6979:17:1" }, { "expression": { @@ -5289,26 +5362,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 813, + "id": 828, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 797, - "src": "7063:1:1", + "referencedDeclaration": 812, + "src": "7038:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 814, + "id": 829, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", - "referencedDeclaration": 455, - "src": "7063:8:1", + "referencedDeclaration": 466, + "src": "7038:8:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -5318,26 +5391,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 815, + "id": 830, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 797, - "src": "7073:1:1", + "referencedDeclaration": 812, + "src": "7048:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 816, + "id": 831, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "amount", "nodeType": "MemberAccess", - "referencedDeclaration": 461, - "src": "7073:8:1", + "referencedDeclaration": 472, + "src": "7048:8:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -5362,26 +5435,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 809, + "id": 824, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 797, - "src": "7037:1:1", + "referencedDeclaration": 812, + "src": "7012:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 810, + "id": 825, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "tokenContract", "nodeType": "MemberAccess", - "referencedDeclaration": 459, - "src": "7037:15:1", + "referencedDeclaration": 470, + "src": "7012:15:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -5395,18 +5468,18 @@ "typeString": "address" } ], - "id": 808, + "id": 823, "name": "ERC20", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1004, - "src": "7031:5:1", + "referencedDeclaration": 1552, + "src": "7006:5:1", "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_ERC20_$1004_$", + "typeIdentifier": "t_type$_t_contract$_ERC20_$1552_$", "typeString": "type(contract ERC20)" } }, - "id": 811, + "id": 826, "isConstant": false, "isLValue": false, "isPure": false, @@ -5414,27 +5487,27 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "7031:22:1", + "src": "7006:22:1", "typeDescriptions": { - "typeIdentifier": "t_contract$_ERC20_$1004", + "typeIdentifier": "t_contract$_ERC20_$1552", "typeString": "contract ERC20" } }, - "id": 812, + "id": 827, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "transfer", "nodeType": "MemberAccess", - "referencedDeclaration": 1027, - "src": "7031:31:1", + "referencedDeclaration": 1196, + "src": "7006:31:1", "typeDescriptions": { "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", "typeString": "function (address,uint256) external returns (bool)" } }, - "id": 817, + "id": 832, "isConstant": false, "isLValue": false, "isPure": false, @@ -5442,15 +5515,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "7031:51:1", + "src": "7006:51:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "id": 818, + "id": 833, "nodeType": "ExpressionStatement", - "src": "7031:51:1" + "src": "7006:51:1" }, { "eventCall": { @@ -5458,12 +5531,12 @@ "arguments": [ { "argumentTypes": null, - "id": 820, + "id": 835, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 785, - "src": "7116:11:1", + "referencedDeclaration": 800, + "src": "7091:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -5477,18 +5550,18 @@ "typeString": "bytes32" } ], - "id": 819, + "id": 834, "name": "LogHTLCERC20Refund", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 453, - "src": "7097:18:1", + "referencedDeclaration": 464, + "src": "7072:18:1", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$returns$__$", "typeString": "function (bytes32)" } }, - "id": 821, + "id": 836, "isConstant": false, "isLValue": false, "isPure": false, @@ -5496,28 +5569,28 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "7097:31:1", + "src": "7072:31:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 822, + "id": 837, "nodeType": "EmitStatement", - "src": "7092:36:1" + "src": "7067:36:1" }, { "expression": { "argumentTypes": null, "hexValue": "74727565", - "id": 823, + "id": 838, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "7145:4:1", + "src": "7120:4:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -5525,99 +5598,98 @@ }, "value": "true" }, - "functionReturnParameters": 795, - "id": 824, + "functionReturnParameters": 810, + "id": 839, "nodeType": "Return", - "src": "7138:11:1" + "src": "7113:11:1" } ] }, "documentation": "@dev Called by the sender if there was no withdraw AND the time lock has\nexpired. This will restore ownership of the tokens to the sender.\n * @param _contractId Id of HTLC to refund from.\n@return bool true on success", - "id": 826, + "id": 841, "implemented": true, - "isConstructor": false, - "isDeclaredConst": false, + "kind": "function", "modifiers": [ { "arguments": [ { "argumentTypes": null, - "id": 788, + "id": 803, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 785, - "src": "6865:11:1", + "referencedDeclaration": 800, + "src": "6840:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], - "id": 789, + "id": 804, "modifierName": { "argumentTypes": null, - "id": 787, + "id": 802, "name": "contractExists", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 528, - "src": "6850:14:1", + "referencedDeclaration": 541, + "src": "6825:14:1", "typeDescriptions": { "typeIdentifier": "t_modifier$_t_bytes32_$", "typeString": "modifier (bytes32)" } }, "nodeType": "ModifierInvocation", - "src": "6850:27:1" + "src": "6825:27:1" }, { "arguments": [ { "argumentTypes": null, - "id": 791, + "id": 806, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 785, - "src": "6897:11:1", + "referencedDeclaration": 800, + "src": "6872:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], - "id": 792, + "id": 807, "modifierName": { "argumentTypes": null, - "id": 790, + "id": 805, "name": "refundable", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 635, - "src": "6886:10:1", + "referencedDeclaration": 648, + "src": "6861:10:1", "typeDescriptions": { "typeIdentifier": "t_modifier$_t_bytes32_$", "typeString": "modifier (bytes32)" } }, "nodeType": "ModifierInvocation", - "src": "6886:23:1" + "src": "6861:23:1" } ], "name": "refund", "nodeType": "FunctionDefinition", "parameters": { - "id": 786, + "id": 801, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 785, + "id": 800, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 826, - "src": "6804:19:1", + "scope": 841, + "src": "6779:19:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -5625,10 +5697,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 784, + "id": 799, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "6804:7:1", + "src": "6779:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -5638,20 +5710,19 @@ "visibility": "internal" } ], - "src": "6803:21:1" + "src": "6778:21:1" }, - "payable": false, "returnParameters": { - "id": 795, + "id": 810, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 794, + "id": 809, "name": "", "nodeType": "VariableDeclaration", - "scope": 826, - "src": "6927:4:1", + "scope": 841, + "src": "6902:4:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -5659,10 +5730,10 @@ "typeString": "bool" }, "typeName": { - "id": 793, + "id": 808, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "6927:4:1", + "src": "6902:4:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -5672,19 +5743,19 @@ "visibility": "internal" } ], - "src": "6926:6:1" + "src": "6901:6:1" }, - "scope": 904, - "src": "6788:368:1", + "scope": 935, + "src": "6763:368:1", "stateMutability": "nonpayable", "superFunction": null, "visibility": "external" }, { "body": { - "id": 882, + "id": 913, "nodeType": "Block", - "src": "7690:377:1", + "src": "7665:440:1", "statements": [ { "condition": { @@ -5693,7 +5764,7 @@ "typeIdentifier": "t_bool", "typeString": "bool" }, - "id": 853, + "id": 868, "isConstant": false, "isLValue": false, "isPure": false, @@ -5703,12 +5774,12 @@ "arguments": [ { "argumentTypes": null, - "id": 850, + "id": 865, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 828, - "src": "7717:11:1", + "referencedDeclaration": 843, + "src": "7692:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -5722,18 +5793,18 @@ "typeString": "bytes32" } ], - "id": 849, + "id": 864, "name": "haveContract", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 903, - "src": "7704:12:1", + "referencedDeclaration": 934, + "src": "7679:12:1", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bool_$", "typeString": "function (bytes32) view returns (bool)" } }, - "id": 851, + "id": 866, "isConstant": false, "isLValue": false, "isPure": false, @@ -5741,7 +5812,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "7704:25:1", + "src": "7679:25:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -5752,14 +5823,14 @@ "rightExpression": { "argumentTypes": null, "hexValue": "66616c7365", - "id": 852, + "id": 867, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "7733:5:1", + "src": "7708:5:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -5767,51 +5838,343 @@ }, "value": "false" }, - "src": "7704:34:1", + "src": "7679:34:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, - "id": 855, + "id": 886, "nodeType": "IfStatement", - "src": "7700:59:1", + "src": "7675:121:1", "trueBody": { - "expression": null, - "functionReturnParameters": 848, - "id": 854, - "nodeType": "Return", - "src": "7752:7:1" - } - }, - { - "assignments": [ - 857 - ], - "declarations": [ - { - "constant": false, - "id": 857, - "name": "c", - "nodeType": "VariableDeclaration", - "scope": 882, - "src": "7768:22:1", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", - "typeString": "struct HashedTimelockERC20.LockContract" - }, + "expression": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 870, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7743:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 869, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7735:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 871, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7735:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 873, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7755:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 872, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7747:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 874, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7747:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 876, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7767:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 875, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7759:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 877, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7759:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 878, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7771:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 879, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7774:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 880, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7777:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 881, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7780:5:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 882, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7787:5:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 883, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7794:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "id": 884, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "7734:62:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_address_payable_$_t_address_payable_$_t_address_payable_$_t_rational_0_by_1_$_t_rational_0_by_1_$_t_rational_0_by_1_$_t_bool_$_t_bool_$_t_rational_0_by_1_$", + "typeString": "tuple(address payable,address payable,address payable,int_const 0,int_const 0,int_const 0,bool,bool,int_const 0)" + } + }, + "functionReturnParameters": 863, + "id": 885, + "nodeType": "Return", + "src": "7727:69:1" + } + }, + { + "assignments": [ + 888 + ], + "declarations": [ + { + "constant": false, + "id": 888, + "name": "c", + "nodeType": "VariableDeclaration", + "scope": 913, + "src": "7806:22:1", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", + "typeString": "struct HashedTimelockERC20.LockContract" + }, "typeName": { "contractScope": null, - "id": 856, + "id": 887, "name": "LockContract", "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 472, - "src": "7768:12:1", + "referencedDeclaration": 483, + "src": "7806:12:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract" } }, @@ -5819,31 +6182,31 @@ "visibility": "internal" } ], - "id": 861, + "id": 892, "initialValue": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 858, + "id": 889, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 639, - "src": "7793:9:1", + "referencedDeclaration": 652, + "src": "7831:9:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$472_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$483_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelockERC20.LockContract storage ref)" } }, - "id": 860, + "id": 891, "indexExpression": { "argumentTypes": null, - "id": 859, + "id": 890, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 828, - "src": "7803:11:1", + "referencedDeclaration": 843, + "src": "7841:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -5854,14 +6217,14 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "7793:22:1", + "src": "7831:22:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage", + "typeIdentifier": "t_struct$_LockContract_$483_storage", "typeString": "struct HashedTimelockERC20.LockContract storage ref" } }, "nodeType": "VariableDeclarationStatement", - "src": "7768:47:1" + "src": "7806:47:1" }, { "expression": { @@ -5871,26 +6234,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 862, + "id": 893, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 857, - "src": "7846:1:1", + "referencedDeclaration": 888, + "src": "7884:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 863, + "id": 894, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", - "referencedDeclaration": 455, - "src": "7846:8:1", + "referencedDeclaration": 466, + "src": "7884:8:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -5900,26 +6263,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 864, + "id": 895, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 857, - "src": "7868:1:1", + "referencedDeclaration": 888, + "src": "7906:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 865, + "id": 896, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "receiver", "nodeType": "MemberAccess", - "referencedDeclaration": 457, - "src": "7868:10:1", + "referencedDeclaration": 468, + "src": "7906:10:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -5929,26 +6292,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 866, + "id": 897, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 857, - "src": "7892:1:1", + "referencedDeclaration": 888, + "src": "7930:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 867, + "id": 898, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "tokenContract", "nodeType": "MemberAccess", - "referencedDeclaration": 459, - "src": "7892:15:1", + "referencedDeclaration": 470, + "src": "7930:15:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -5958,26 +6321,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 868, + "id": 899, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 857, - "src": "7921:1:1", + "referencedDeclaration": 888, + "src": "7959:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 869, + "id": 900, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "amount", "nodeType": "MemberAccess", - "referencedDeclaration": 461, - "src": "7921:8:1", + "referencedDeclaration": 472, + "src": "7959:8:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -5987,26 +6350,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 870, + "id": 901, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 857, - "src": "7943:1:1", + "referencedDeclaration": 888, + "src": "7981:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 871, + "id": 902, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "hashlock", "nodeType": "MemberAccess", - "referencedDeclaration": 463, - "src": "7943:10:1", + "referencedDeclaration": 474, + "src": "7981:10:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -6016,26 +6379,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 872, + "id": 903, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 857, - "src": "7967:1:1", + "referencedDeclaration": 888, + "src": "8005:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 873, + "id": 904, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "timelock", "nodeType": "MemberAccess", - "referencedDeclaration": 465, - "src": "7967:10:1", + "referencedDeclaration": 476, + "src": "8005:10:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6045,26 +6408,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 874, + "id": 905, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 857, - "src": "7991:1:1", + "referencedDeclaration": 888, + "src": "8029:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 875, + "id": 906, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "withdrawn", "nodeType": "MemberAccess", - "referencedDeclaration": 467, - "src": "7991:11:1", + "referencedDeclaration": 478, + "src": "8029:11:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -6074,26 +6437,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 876, + "id": 907, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 857, - "src": "8016:1:1", + "referencedDeclaration": 888, + "src": "8054:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 877, + "id": 908, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "refunded", "nodeType": "MemberAccess", - "referencedDeclaration": 469, - "src": "8016:10:1", + "referencedDeclaration": 480, + "src": "8054:10:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -6103,71 +6466,70 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 878, + "id": 909, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 857, - "src": "8040:1:1", + "referencedDeclaration": 888, + "src": "8078:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 879, + "id": 910, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "preimage", "nodeType": "MemberAccess", - "referencedDeclaration": 471, - "src": "8040:10:1", + "referencedDeclaration": 482, + "src": "8078:10:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], - "id": 880, + "id": 911, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", - "src": "7832:228:1", + "src": "7870:228:1", "typeDescriptions": { "typeIdentifier": "t_tuple$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_bytes32_$_t_uint256_$_t_bool_$_t_bool_$_t_bytes32_$", "typeString": "tuple(address,address,address,uint256,bytes32,uint256,bool,bool,bytes32)" } }, - "functionReturnParameters": 848, - "id": 881, + "functionReturnParameters": 863, + "id": 912, "nodeType": "Return", - "src": "7825:235:1" + "src": "7863:235:1" } ] }, "documentation": "@dev Get contract details.\n@param _contractId HTLC contract id\n@return All parameters in struct LockContract for _contractId HTLC", - "id": 883, + "id": 914, "implemented": true, - "isConstructor": false, - "isDeclaredConst": true, + "kind": "function", "modifiers": [], "name": "getContract", "nodeType": "FunctionDefinition", "parameters": { - "id": 829, + "id": 844, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 828, + "id": 843, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 883, - "src": "7350:19:1", + "scope": 914, + "src": "7325:19:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6175,10 +6537,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 827, + "id": 842, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "7350:7:1", + "src": "7325:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -6188,20 +6550,19 @@ "visibility": "internal" } ], - "src": "7349:21:1" + "src": "7324:21:1" }, - "payable": false, "returnParameters": { - "id": 848, + "id": 863, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 831, + "id": 846, "name": "sender", "nodeType": "VariableDeclaration", - "scope": 883, - "src": "7429:14:1", + "scope": 914, + "src": "7404:14:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6209,10 +6570,11 @@ "typeString": "address" }, "typeName": { - "id": 830, + "id": 845, "name": "address", "nodeType": "ElementaryTypeName", - "src": "7429:7:1", + "src": "7404:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -6223,11 +6585,11 @@ }, { "constant": false, - "id": 833, + "id": 848, "name": "receiver", "nodeType": "VariableDeclaration", - "scope": 883, - "src": "7457:16:1", + "scope": 914, + "src": "7432:16:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6235,10 +6597,11 @@ "typeString": "address" }, "typeName": { - "id": 832, + "id": 847, "name": "address", "nodeType": "ElementaryTypeName", - "src": "7457:7:1", + "src": "7432:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -6249,11 +6612,11 @@ }, { "constant": false, - "id": 835, + "id": 850, "name": "tokenContract", "nodeType": "VariableDeclaration", - "scope": 883, - "src": "7487:21:1", + "scope": 914, + "src": "7462:21:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6261,10 +6624,11 @@ "typeString": "address" }, "typeName": { - "id": 834, + "id": 849, "name": "address", "nodeType": "ElementaryTypeName", - "src": "7487:7:1", + "src": "7462:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -6275,11 +6639,11 @@ }, { "constant": false, - "id": 837, + "id": 852, "name": "amount", "nodeType": "VariableDeclaration", - "scope": 883, - "src": "7522:11:1", + "scope": 914, + "src": "7497:11:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6287,10 +6651,10 @@ "typeString": "uint256" }, "typeName": { - "id": 836, + "id": 851, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "7522:4:1", + "src": "7497:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6301,11 +6665,11 @@ }, { "constant": false, - "id": 839, + "id": 854, "name": "hashlock", "nodeType": "VariableDeclaration", - "scope": 883, - "src": "7547:16:1", + "scope": 914, + "src": "7522:16:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6313,10 +6677,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 838, + "id": 853, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "7547:7:1", + "src": "7522:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -6327,11 +6691,11 @@ }, { "constant": false, - "id": 841, + "id": 856, "name": "timelock", "nodeType": "VariableDeclaration", - "scope": 883, - "src": "7577:13:1", + "scope": 914, + "src": "7552:13:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6339,10 +6703,10 @@ "typeString": "uint256" }, "typeName": { - "id": 840, + "id": 855, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "7577:4:1", + "src": "7552:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6353,11 +6717,11 @@ }, { "constant": false, - "id": 843, + "id": 858, "name": "withdrawn", "nodeType": "VariableDeclaration", - "scope": 883, - "src": "7604:14:1", + "scope": 914, + "src": "7579:14:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6365,10 +6729,10 @@ "typeString": "bool" }, "typeName": { - "id": 842, + "id": 857, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "7604:4:1", + "src": "7579:4:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -6379,11 +6743,11 @@ }, { "constant": false, - "id": 845, + "id": 860, "name": "refunded", "nodeType": "VariableDeclaration", - "scope": 883, - "src": "7632:13:1", + "scope": 914, + "src": "7607:13:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6391,10 +6755,10 @@ "typeString": "bool" }, "typeName": { - "id": 844, + "id": 859, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "7632:4:1", + "src": "7607:4:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -6405,11 +6769,11 @@ }, { "constant": false, - "id": 847, + "id": 862, "name": "preimage", "nodeType": "VariableDeclaration", - "scope": 883, - "src": "7659:16:1", + "scope": 914, + "src": "7634:16:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6417,10 +6781,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 846, + "id": 861, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "7659:7:1", + "src": "7634:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -6430,36 +6794,36 @@ "visibility": "internal" } ], - "src": "7415:270:1" + "src": "7390:270:1" }, - "scope": 904, - "src": "7329:738:1", + "scope": 935, + "src": "7304:801:1", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { - "id": 902, + "id": 933, "nodeType": "Block", - "src": "8302:71:1", + "src": "8340:71:1", "statements": [ { "expression": { "argumentTypes": null, - "id": 900, + "id": 931, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, - "id": 890, + "id": 921, "name": "exists", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 888, - "src": "8312:6:1", + "referencedDeclaration": 919, + "src": "8350:6:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -6476,7 +6840,7 @@ "typeIdentifier": "t_address", "typeString": "address" }, - "id": 898, + "id": 929, "isConstant": false, "isLValue": false, "isPure": false, @@ -6487,26 +6851,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 891, + "id": 922, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 639, - "src": "8322:9:1", + "referencedDeclaration": 652, + "src": "8360:9:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$472_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$483_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelockERC20.LockContract storage ref)" } }, - "id": 893, + "id": 924, "indexExpression": { "argumentTypes": null, - "id": 892, + "id": 923, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 885, - "src": "8332:11:1", + "referencedDeclaration": 916, + "src": "8370:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -6517,21 +6881,21 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "8322:22:1", + "src": "8360:22:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage", + "typeIdentifier": "t_struct$_LockContract_$483_storage", "typeString": "struct HashedTimelockERC20.LockContract storage ref" } }, - "id": 894, + "id": 925, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", - "referencedDeclaration": 455, - "src": "8322:29:1", + "referencedDeclaration": 466, + "src": "8360:29:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -6545,14 +6909,14 @@ { "argumentTypes": null, "hexValue": "30", - "id": 896, + "id": 927, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "8363:1:1", + "src": "8401:1:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", @@ -6568,20 +6932,20 @@ "typeString": "int_const 0" } ], - "id": 895, + "id": 926, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", - "src": "8355:7:1", + "src": "8393:7:1", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, - "id": 897, + "id": 928, "isConstant": false, "isLValue": false, "isPure": true, @@ -6589,63 +6953,62 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "8355:10:1", + "src": "8393:10:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, - "src": "8322:43:1", + "src": "8360:43:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], - "id": 899, + "id": 930, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", - "src": "8321:45:1", + "src": "8359:45:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "src": "8312:54:1", + "src": "8350:54:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "id": 901, + "id": 932, "nodeType": "ExpressionStatement", - "src": "8312:54:1" + "src": "8350:54:1" } ] }, "documentation": "@dev Is there a contract with id _contractId.\n@param _contractId Id into contracts mapping.", - "id": 903, + "id": 934, "implemented": true, - "isConstructor": false, - "isDeclaredConst": true, + "kind": "function", "modifiers": [], "name": "haveContract", "nodeType": "FunctionDefinition", "parameters": { - "id": 886, + "id": 917, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 885, + "id": 916, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 903, - "src": "8217:19:1", + "scope": 934, + "src": "8255:19:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6653,10 +7016,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 884, + "id": 915, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "8217:7:1", + "src": "8255:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -6666,20 +7029,19 @@ "visibility": "internal" } ], - "src": "8216:21:1" + "src": "8254:21:1" }, - "payable": false, "returnParameters": { - "id": 889, + "id": 920, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 888, + "id": 919, "name": "exists", "nodeType": "VariableDeclaration", - "scope": 903, - "src": "8285:11:1", + "scope": 934, + "src": "8323:11:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6687,10 +7049,10 @@ "typeString": "bool" }, "typeName": { - "id": 887, + "id": 918, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "8285:4:1", + "src": "8323:4:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -6700,59 +7062,50 @@ "visibility": "internal" } ], - "src": "8284:13:1" + "src": "8322:13:1" }, - "scope": 904, - "src": "8195:178:1", + "scope": 935, + "src": "8233:178:1", "stateMutability": "view", "superFunction": null, "visibility": "internal" } ], - "scope": 905, - "src": "948:7428:1" + "scope": 936, + "src": "917:7497:1" } ], - "src": "0:8377:1" + "src": "0:8415:1" }, "legacyAST": { - "absolutePath": "/home/hatch/eth/hashed-timelock-contract-ethereum/contracts/HashedTimelockERC20.sol", + "absolutePath": "/home/hatch/src/eth/hashed-timelock-contract-ethereum/contracts/HashedTimelockERC20.sol", "exportedSymbols": { "HashedTimelockERC20": [ - 904 + 935 ] }, - "id": 905, + "id": 936, "nodeType": "SourceUnit", "nodes": [ { - "id": 427, + "id": 439, "literals": [ "solidity", "^", - "0.4", - ".24" - ], - "nodeType": "PragmaDirective", - "src": "0:24:1" - }, - { - "id": 428, - "literals": [ - "experimental", - "v0.5.0" + "0.5", + ".0" ], "nodeType": "PragmaDirective", - "src": "25:29:1" + "src": "0:23:1" }, { "absolutePath": "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol", "file": "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol", - "id": 429, + "id": 440, "nodeType": "ImportDirective", - "scope": 905, - "sourceUnit": 1005, - "src": "56:63:1", + "scope": 936, + "sourceUnit": 1553, + "src": "25:63:1", "symbolAliases": [], "unitAlias": "" }, @@ -6762,9 +7115,9 @@ "contractKind": "contract", "documentation": "@title Hashed Timelock Contracts (HTLCs) on Ethereum ERC20 tokens.\n* This contract provides a way to create and keep HTLCs for ERC20 tokens.\n* See HashedTimelock.sol for a contract that provides the same functions \nfor the native ETH token.\n* Protocol:\n* 1) newContract(receiver, hashlock, timelock, tokenContract, amount) - a \n sender calls this to create a new HTLC on a given token (tokenContract) \n for a given amount. A 32 byte contract id is returned\n 2) withdraw(contractId, preimage) - once the receiver knows the preimage of\n the hashlock hash they can claim the tokens with this function\n 3) refund() - after timelock has expired and if the receiver did not \n withdraw the tokens the sender / creater of the HTLC can get their tokens \n back with this function.", "fullyImplemented": true, - "id": 904, + "id": 935, "linearizedBaseContracts": [ - 904 + 935 ], "name": "HashedTimelockERC20", "nodeType": "ContractDefinition", @@ -6772,21 +7125,21 @@ { "anonymous": false, "documentation": null, - "id": 445, + "id": 456, "name": "LogHTLCERC20New", "nodeType": "EventDefinition", "parameters": { - "id": 444, + "id": 455, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 431, + "id": 442, "indexed": true, "name": "contractId", "nodeType": "VariableDeclaration", - "scope": 445, - "src": "1015:26:1", + "scope": 456, + "src": "984:26:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6794,10 +7147,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 430, + "id": 441, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1015:7:1", + "src": "984:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -6808,12 +7161,12 @@ }, { "constant": false, - "id": 433, + "id": 444, "indexed": true, "name": "sender", "nodeType": "VariableDeclaration", - "scope": 445, - "src": "1051:22:1", + "scope": 456, + "src": "1020:22:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6821,10 +7174,11 @@ "typeString": "address" }, "typeName": { - "id": 432, + "id": 443, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1051:7:1", + "src": "1020:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -6835,12 +7189,12 @@ }, { "constant": false, - "id": 435, + "id": 446, "indexed": true, "name": "receiver", "nodeType": "VariableDeclaration", - "scope": 445, - "src": "1083:24:1", + "scope": 456, + "src": "1052:24:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6848,10 +7202,11 @@ "typeString": "address" }, "typeName": { - "id": 434, + "id": 445, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1083:7:1", + "src": "1052:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -6862,12 +7217,12 @@ }, { "constant": false, - "id": 437, + "id": 448, "indexed": false, "name": "tokenContract", "nodeType": "VariableDeclaration", - "scope": 445, - "src": "1117:21:1", + "scope": 456, + "src": "1086:21:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6875,10 +7230,11 @@ "typeString": "address" }, "typeName": { - "id": 436, + "id": 447, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1117:7:1", + "src": "1086:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -6889,12 +7245,12 @@ }, { "constant": false, - "id": 439, + "id": 450, "indexed": false, "name": "amount", "nodeType": "VariableDeclaration", - "scope": 445, - "src": "1148:11:1", + "scope": 456, + "src": "1117:11:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6902,10 +7258,10 @@ "typeString": "uint256" }, "typeName": { - "id": 438, + "id": 449, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "1148:4:1", + "src": "1117:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6916,12 +7272,12 @@ }, { "constant": false, - "id": 441, + "id": 452, "indexed": false, "name": "hashlock", "nodeType": "VariableDeclaration", - "scope": 445, - "src": "1169:16:1", + "scope": 456, + "src": "1138:16:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6929,10 +7285,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 440, + "id": 451, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1169:7:1", + "src": "1138:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -6943,12 +7299,12 @@ }, { "constant": false, - "id": 443, + "id": 454, "indexed": false, "name": "timelock", "nodeType": "VariableDeclaration", - "scope": 445, - "src": "1195:13:1", + "scope": 456, + "src": "1164:13:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6956,10 +7312,10 @@ "typeString": "uint256" }, "typeName": { - "id": 442, + "id": 453, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "1195:4:1", + "src": "1164:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6969,28 +7325,28 @@ "visibility": "internal" } ], - "src": "1005:209:1" + "src": "974:209:1" }, - "src": "984:231:1" + "src": "953:231:1" }, { "anonymous": false, "documentation": null, - "id": 449, + "id": 460, "name": "LogHTLCERC20Withdraw", "nodeType": "EventDefinition", "parameters": { - "id": 448, + "id": 459, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 447, + "id": 458, "indexed": true, "name": "contractId", "nodeType": "VariableDeclaration", - "scope": 449, - "src": "1247:26:1", + "scope": 460, + "src": "1216:26:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6998,10 +7354,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 446, + "id": 457, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1247:7:1", + "src": "1216:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -7011,28 +7367,28 @@ "visibility": "internal" } ], - "src": "1246:28:1" + "src": "1215:28:1" }, - "src": "1220:55:1" + "src": "1189:55:1" }, { "anonymous": false, "documentation": null, - "id": 453, + "id": 464, "name": "LogHTLCERC20Refund", "nodeType": "EventDefinition", "parameters": { - "id": 452, + "id": 463, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 451, + "id": 462, "indexed": true, "name": "contractId", "nodeType": "VariableDeclaration", - "scope": 453, - "src": "1305:26:1", + "scope": 464, + "src": "1274:26:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -7040,10 +7396,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 450, + "id": 461, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1305:7:1", + "src": "1274:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -7053,21 +7409,21 @@ "visibility": "internal" } ], - "src": "1304:28:1" + "src": "1273:28:1" }, - "src": "1280:53:1" + "src": "1249:53:1" }, { "canonicalName": "HashedTimelockERC20.LockContract", - "id": 472, + "id": 483, "members": [ { "constant": false, - "id": 455, + "id": 466, "name": "sender", "nodeType": "VariableDeclaration", - "scope": 472, - "src": "1369:14:1", + "scope": 483, + "src": "1338:14:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -7075,10 +7431,11 @@ "typeString": "address" }, "typeName": { - "id": 454, + "id": 465, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1369:7:1", + "src": "1338:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -7089,11 +7446,11 @@ }, { "constant": false, - "id": 457, + "id": 468, "name": "receiver", "nodeType": "VariableDeclaration", - "scope": 472, - "src": "1393:16:1", + "scope": 483, + "src": "1362:16:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -7101,10 +7458,11 @@ "typeString": "address" }, "typeName": { - "id": 456, + "id": 467, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1393:7:1", + "src": "1362:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -7115,11 +7473,11 @@ }, { "constant": false, - "id": 459, + "id": 470, "name": "tokenContract", "nodeType": "VariableDeclaration", - "scope": 472, - "src": "1419:21:1", + "scope": 483, + "src": "1388:21:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -7127,10 +7485,11 @@ "typeString": "address" }, "typeName": { - "id": 458, + "id": 469, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1419:7:1", + "src": "1388:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -7141,11 +7500,11 @@ }, { "constant": false, - "id": 461, + "id": 472, "name": "amount", "nodeType": "VariableDeclaration", - "scope": 472, - "src": "1450:11:1", + "scope": 483, + "src": "1419:11:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -7153,10 +7512,10 @@ "typeString": "uint256" }, "typeName": { - "id": 460, + "id": 471, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "1450:4:1", + "src": "1419:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -7167,11 +7526,11 @@ }, { "constant": false, - "id": 463, + "id": 474, "name": "hashlock", "nodeType": "VariableDeclaration", - "scope": 472, - "src": "1471:16:1", + "scope": 483, + "src": "1440:16:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -7179,10 +7538,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 462, + "id": 473, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1471:7:1", + "src": "1440:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -7193,11 +7552,11 @@ }, { "constant": false, - "id": 465, + "id": 476, "name": "timelock", "nodeType": "VariableDeclaration", - "scope": 472, - "src": "1497:13:1", + "scope": 483, + "src": "1466:13:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -7205,10 +7564,10 @@ "typeString": "uint256" }, "typeName": { - "id": 464, + "id": 475, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "1497:4:1", + "src": "1466:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -7219,11 +7578,11 @@ }, { "constant": false, - "id": 467, + "id": 478, "name": "withdrawn", "nodeType": "VariableDeclaration", - "scope": 472, - "src": "1571:14:1", + "scope": 483, + "src": "1540:14:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -7231,10 +7590,10 @@ "typeString": "bool" }, "typeName": { - "id": 466, + "id": 477, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "1571:4:1", + "src": "1540:4:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -7245,11 +7604,11 @@ }, { "constant": false, - "id": 469, + "id": 480, "name": "refunded", "nodeType": "VariableDeclaration", - "scope": 472, - "src": "1595:13:1", + "scope": 483, + "src": "1564:13:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -7257,10 +7616,10 @@ "typeString": "bool" }, "typeName": { - "id": 468, + "id": 479, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "1595:4:1", + "src": "1564:4:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -7271,11 +7630,11 @@ }, { "constant": false, - "id": 471, + "id": 482, "name": "preimage", "nodeType": "VariableDeclaration", - "scope": 472, - "src": "1618:16:1", + "scope": 483, + "src": "1587:16:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -7283,10 +7642,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 470, + "id": 481, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1618:7:1", + "src": "1587:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -7298,15 +7657,15 @@ ], "name": "LockContract", "nodeType": "StructDefinition", - "scope": 904, - "src": "1339:302:1", + "scope": 935, + "src": "1308:302:1", "visibility": "public" }, { "body": { - "id": 501, + "id": 514, "nodeType": "Block", - "src": "1722:215:1", + "src": "1691:224:1", "statements": [ { "expression": { @@ -7318,19 +7677,19 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 483, + "id": 494, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, - "id": 481, + "id": 492, "name": "_amount", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 478, - "src": "1740:7:1", + "referencedDeclaration": 489, + "src": "1709:7:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -7341,14 +7700,14 @@ "rightExpression": { "argumentTypes": null, "hexValue": "30", - "id": 482, + "id": 493, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "1750:1:1", + "src": "1719:1:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", @@ -7356,7 +7715,7 @@ }, "value": "0" }, - "src": "1740:11:1", + "src": "1709:11:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -7365,14 +7724,14 @@ { "argumentTypes": null, "hexValue": "746f6b656e20616d6f756e74206d757374206265203e2030", - "id": 484, + "id": 495, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "1753:26:1", + "src": "1722:26:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_ef8462853d6a0c63b24b7e3a8f909d1829994486c1a37cf6bbf9abe6b4e2cab7", @@ -7392,21 +7751,21 @@ "typeString": "literal_string \"token amount must be > 0\"" } ], - "id": 480, + "id": 491, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "1732:7:1", + "referencedDeclaration": 1640, + "src": "1701:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 485, + "id": 496, "isConstant": false, "isLValue": false, "isPure": false, @@ -7414,15 +7773,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "1732:48:1", + "src": "1701:48:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 486, + "id": 497, "nodeType": "ExpressionStatement", - "src": "1732:48:1" + "src": "1701:48:1" }, { "expression": { @@ -7434,7 +7793,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 496, + "id": 509, "isConstant": false, "isLValue": false, "isPure": false, @@ -7444,12 +7803,12 @@ "arguments": [ { "argumentTypes": null, - "id": 492, + "id": 503, "name": "_sender", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 476, - "src": "1835:7:1", + "referencedDeclaration": 487, + "src": "1804:7:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -7457,15 +7816,53 @@ }, { "argumentTypes": null, - "id": 493, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1070, - "src": "1844:4:1", + "arguments": [ + { + "argumentTypes": null, + "id": 505, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1657, + "src": "1821:4:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_HashedTimelockERC20_$935", + "typeString": "contract HashedTimelockERC20" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_HashedTimelockERC20_$935", + "typeString": "contract HashedTimelockERC20" + } + ], + "id": 504, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1813:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 506, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1813:13:1", "typeDescriptions": { - "typeIdentifier": "t_contract$_HashedTimelockERC20_$904", - "typeString": "contract HashedTimelockERC20" + "typeIdentifier": "t_address", + "typeString": "address" } } ], @@ -7476,8 +7873,8 @@ "typeString": "address" }, { - "typeIdentifier": "t_contract$_HashedTimelockERC20_$904", - "typeString": "contract HashedTimelockERC20" + "typeIdentifier": "t_address", + "typeString": "address" } ], "expression": { @@ -7485,12 +7882,12 @@ "arguments": [ { "argumentTypes": null, - "id": 489, + "id": 500, "name": "_token", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 474, - "src": "1817:6:1", + "referencedDeclaration": 485, + "src": "1786:6:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -7504,18 +7901,18 @@ "typeString": "address" } ], - "id": 488, + "id": 499, "name": "ERC20", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1004, - "src": "1811:5:1", + "referencedDeclaration": 1552, + "src": "1780:5:1", "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_ERC20_$1004_$", + "typeIdentifier": "t_type$_t_contract$_ERC20_$1552_$", "typeString": "type(contract ERC20)" } }, - "id": 490, + "id": 501, "isConstant": false, "isLValue": false, "isPure": false, @@ -7523,27 +7920,27 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "1811:13:1", + "src": "1780:13:1", "typeDescriptions": { - "typeIdentifier": "t_contract$_ERC20_$1004", + "typeIdentifier": "t_contract$_ERC20_$1552", "typeString": "contract ERC20" } }, - "id": 491, + "id": 502, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "allowance", "nodeType": "MemberAccess", - "referencedDeclaration": 975, - "src": "1811:23:1", + "referencedDeclaration": 1177, + "src": "1780:23:1", "typeDescriptions": { "typeIdentifier": "t_function_external_view$_t_address_$_t_address_$returns$_t_uint256_$", "typeString": "function (address,address) view external returns (uint256)" } }, - "id": 494, + "id": 507, "isConstant": false, "isLValue": false, "isPure": false, @@ -7551,7 +7948,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "1811:38:1", + "src": "1780:47:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -7561,18 +7958,18 @@ "operator": ">=", "rightExpression": { "argumentTypes": null, - "id": 495, + "id": 508, "name": "_amount", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 478, - "src": "1853:7:1", + "referencedDeclaration": 489, + "src": "1831:7:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "1811:49:1", + "src": "1780:58:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -7581,14 +7978,14 @@ { "argumentTypes": null, "hexValue": "746f6b656e20616c6c6f77616e6365206d757374206265203e3d20616d6f756e74", - "id": 497, + "id": 510, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "1874:35:1", + "src": "1852:35:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_98db95208a4165db2bf846b140f267671bc24ad3503084b9b0a60b8f7c8a0ad2", @@ -7608,21 +8005,21 @@ "typeString": "literal_string \"token allowance must be >= amount\"" } ], - "id": 487, + "id": 498, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "1790:7:1", + "referencedDeclaration": 1640, + "src": "1759:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 498, + "id": 511, "isConstant": false, "isLValue": false, "isPure": false, @@ -7630,38 +8027,38 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "1790:129:1", + "src": "1759:138:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 499, + "id": 512, "nodeType": "ExpressionStatement", - "src": "1790:129:1" + "src": "1759:138:1" }, { - "id": 500, + "id": 513, "nodeType": "PlaceholderStatement", - "src": "1929:1:1" + "src": "1907:1:1" } ] }, "documentation": null, - "id": 502, + "id": 515, "name": "tokensTransferable", "nodeType": "ModifierDefinition", "parameters": { - "id": 479, + "id": 490, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 474, + "id": 485, "name": "_token", "nodeType": "VariableDeclaration", - "scope": 502, - "src": "1675:14:1", + "scope": 515, + "src": "1644:14:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -7669,10 +8066,11 @@ "typeString": "address" }, "typeName": { - "id": 473, + "id": 484, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1675:7:1", + "src": "1644:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -7683,11 +8081,11 @@ }, { "constant": false, - "id": 476, + "id": 487, "name": "_sender", "nodeType": "VariableDeclaration", - "scope": 502, - "src": "1691:15:1", + "scope": 515, + "src": "1660:15:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -7695,10 +8093,11 @@ "typeString": "address" }, "typeName": { - "id": 475, + "id": 486, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1691:7:1", + "src": "1660:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -7709,11 +8108,11 @@ }, { "constant": false, - "id": 478, + "id": 489, "name": "_amount", "nodeType": "VariableDeclaration", - "scope": 502, - "src": "1708:12:1", + "scope": 515, + "src": "1677:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -7721,10 +8120,10 @@ "typeString": "uint256" }, "typeName": { - "id": 477, + "id": 488, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "1708:4:1", + "src": "1677:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -7734,16 +8133,16 @@ "visibility": "internal" } ], - "src": "1674:47:1" + "src": "1643:47:1" }, - "src": "1647:290:1", + "src": "1616:299:1", "visibility": "internal" }, { "body": { - "id": 514, + "id": 527, "nodeType": "Block", - "src": "1978:297:1", + "src": "1956:297:1", "statements": [ { "expression": { @@ -7755,19 +8154,19 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 509, + "id": 522, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, - "id": 507, + "id": 520, "name": "_time", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 504, - "src": "2206:5:1", + "referencedDeclaration": 517, + "src": "2184:5:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -7777,18 +8176,18 @@ "operator": ">", "rightExpression": { "argumentTypes": null, - "id": 508, + "id": 521, "name": "now", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1053, - "src": "2214:3:1", + "referencedDeclaration": 1638, + "src": "2192:3:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "2206:11:1", + "src": "2184:11:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -7797,14 +8196,14 @@ { "argumentTypes": null, "hexValue": "74696d656c6f636b2074696d65206d75737420626520696e2074686520667574757265", - "id": 510, + "id": 523, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2219:37:1", + "src": "2197:37:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_16dbfee8f738f21cc70987859d9176eb37f9ed0572f04024e006404bb83f7086", @@ -7824,21 +8223,21 @@ "typeString": "literal_string \"timelock time must be in the future\"" } ], - "id": 506, + "id": 519, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "2198:7:1", + "referencedDeclaration": 1640, + "src": "2176:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 511, + "id": 524, "isConstant": false, "isLValue": false, "isPure": false, @@ -7846,38 +8245,38 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2198:59:1", + "src": "2176:59:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 512, + "id": 525, "nodeType": "ExpressionStatement", - "src": "2198:59:1" + "src": "2176:59:1" }, { - "id": 513, + "id": 526, "nodeType": "PlaceholderStatement", - "src": "2267:1:1" + "src": "2245:1:1" } ] }, "documentation": null, - "id": 515, + "id": 528, "name": "futureTimelock", "nodeType": "ModifierDefinition", "parameters": { - "id": 505, + "id": 518, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 504, + "id": 517, "name": "_time", "nodeType": "VariableDeclaration", - "scope": 515, - "src": "1966:10:1", + "scope": 528, + "src": "1944:10:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -7885,10 +8284,10 @@ "typeString": "uint256" }, "typeName": { - "id": 503, + "id": 516, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "1966:4:1", + "src": "1944:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -7898,16 +8297,16 @@ "visibility": "internal" } ], - "src": "1965:12:1" + "src": "1943:12:1" }, - "src": "1942:333:1", + "src": "1920:333:1", "visibility": "internal" }, { "body": { - "id": 527, + "id": 540, "nodeType": "Block", - "src": "2325:91:1", + "src": "2303:91:1", "statements": [ { "expression": { @@ -7918,12 +8317,12 @@ "arguments": [ { "argumentTypes": null, - "id": 521, + "id": 534, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 517, - "src": "2356:11:1", + "referencedDeclaration": 530, + "src": "2334:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -7937,18 +8336,18 @@ "typeString": "bytes32" } ], - "id": 520, + "id": 533, "name": "haveContract", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 903, - "src": "2343:12:1", + "referencedDeclaration": 934, + "src": "2321:12:1", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bool_$", "typeString": "function (bytes32) view returns (bool)" } }, - "id": 522, + "id": 535, "isConstant": false, "isLValue": false, "isPure": false, @@ -7956,7 +8355,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2343:25:1", + "src": "2321:25:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -7965,14 +8364,14 @@ { "argumentTypes": null, "hexValue": "636f6e7472616374496420646f6573206e6f74206578697374", - "id": 523, + "id": 536, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2370:27:1", + "src": "2348:27:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_2ff20efe697688cf49352f50e84b155aa5e8db31cae40badce7570a4e72a088a", @@ -7992,21 +8391,21 @@ "typeString": "literal_string \"contractId does not exist\"" } ], - "id": 519, + "id": 532, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "2335:7:1", + "referencedDeclaration": 1640, + "src": "2313:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 524, + "id": 537, "isConstant": false, "isLValue": false, "isPure": false, @@ -8014,38 +8413,38 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2335:63:1", + "src": "2313:63:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 525, + "id": 538, "nodeType": "ExpressionStatement", - "src": "2335:63:1" + "src": "2313:63:1" }, { - "id": 526, + "id": 539, "nodeType": "PlaceholderStatement", - "src": "2408:1:1" + "src": "2386:1:1" } ] }, "documentation": null, - "id": 528, + "id": 541, "name": "contractExists", "nodeType": "ModifierDefinition", "parameters": { - "id": 518, + "id": 531, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 517, + "id": 530, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 528, - "src": "2304:19:1", + "scope": 541, + "src": "2282:19:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -8053,10 +8452,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 516, + "id": 529, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "2304:7:1", + "src": "2282:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -8066,16 +8465,16 @@ "visibility": "internal" } ], - "src": "2303:21:1" + "src": "2281:21:1" }, - "src": "2280:136:1", + "src": "2258:136:1", "visibility": "internal" }, { "body": { - "id": 550, + "id": 563, "nodeType": "Block", - "src": "2479:166:1", + "src": "2457:166:1", "statements": [ { "expression": { @@ -8087,7 +8486,7 @@ "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, - "id": 545, + "id": 558, "isConstant": false, "isLValue": false, "isPure": false, @@ -8098,26 +8497,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 535, + "id": 548, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 639, - "src": "2510:9:1", + "referencedDeclaration": 652, + "src": "2488:9:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$472_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$483_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelockERC20.LockContract storage ref)" } }, - "id": 537, + "id": 550, "indexExpression": { "argumentTypes": null, - "id": 536, + "id": 549, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 530, - "src": "2520:11:1", + "referencedDeclaration": 543, + "src": "2498:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -8128,21 +8527,21 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "2510:22:1", + "src": "2488:22:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage", + "typeIdentifier": "t_struct$_LockContract_$483_storage", "typeString": "struct HashedTimelockERC20.LockContract storage ref" } }, - "id": 538, + "id": 551, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "hashlock", "nodeType": "MemberAccess", - "referencedDeclaration": 463, - "src": "2510:31:1", + "referencedDeclaration": 474, + "src": "2488:31:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -8158,12 +8557,12 @@ "arguments": [ { "argumentTypes": null, - "id": 542, + "id": 555, "name": "_x", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 532, - "src": "2569:2:1", + "referencedDeclaration": 545, + "src": "2547:2:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -8179,18 +8578,18 @@ ], "expression": { "argumentTypes": null, - "id": 540, + "id": 553, "name": "abi", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1038, - "src": "2552:3:1", + "referencedDeclaration": 1623, + "src": "2530:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_abi", "typeString": "abi" } }, - "id": 541, + "id": 554, "isConstant": false, "isLValue": false, "isPure": true, @@ -8198,13 +8597,13 @@ "memberName": "encodePacked", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "2552:16:1", + "src": "2530:16:1", "typeDescriptions": { "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", "typeString": "function () pure returns (bytes memory)" } }, - "id": 543, + "id": 556, "isConstant": false, "isLValue": false, "isPure": false, @@ -8212,7 +8611,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2552:20:1", + "src": "2530:20:1", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" @@ -8226,18 +8625,18 @@ "typeString": "bytes memory" } ], - "id": 539, + "id": 552, "name": "sha256", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1060, - "src": "2545:6:1", + "referencedDeclaration": 1645, + "src": "2523:6:1", "typeDescriptions": { - "typeIdentifier": "t_function_sha256_pure$__$returns$_t_bytes32_$", - "typeString": "function () pure returns (bytes32)" + "typeIdentifier": "t_function_sha256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" } }, - "id": 544, + "id": 557, "isConstant": false, "isLValue": false, "isPure": false, @@ -8245,13 +8644,13 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2545:28:1", + "src": "2523:28:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "src": "2510:63:1", + "src": "2488:63:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -8260,14 +8659,14 @@ { "argumentTypes": null, "hexValue": "686173686c6f636b206861736820646f6573206e6f74206d61746368", - "id": 546, + "id": 559, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2587:30:1", + "src": "2565:30:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_f69d465af376b0946a94d153fa61e1120954d7550ccad2ede50c179df9b911a9", @@ -8287,21 +8686,21 @@ "typeString": "literal_string \"hashlock hash does not match\"" } ], - "id": 534, + "id": 547, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "2489:7:1", + "referencedDeclaration": 1640, + "src": "2467:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 547, + "id": 560, "isConstant": false, "isLValue": false, "isPure": false, @@ -8309,38 +8708,38 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2489:138:1", + "src": "2467:138:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 548, + "id": 561, "nodeType": "ExpressionStatement", - "src": "2489:138:1" + "src": "2467:138:1" }, { - "id": 549, + "id": 562, "nodeType": "PlaceholderStatement", - "src": "2637:1:1" + "src": "2615:1:1" } ] }, "documentation": null, - "id": 551, + "id": 564, "name": "hashlockMatches", "nodeType": "ModifierDefinition", "parameters": { - "id": 533, + "id": 546, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 530, + "id": 543, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 551, - "src": "2446:19:1", + "scope": 564, + "src": "2424:19:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -8348,10 +8747,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 529, + "id": 542, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "2446:7:1", + "src": "2424:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -8362,11 +8761,11 @@ }, { "constant": false, - "id": 532, + "id": 545, "name": "_x", "nodeType": "VariableDeclaration", - "scope": 551, - "src": "2467:10:1", + "scope": 564, + "src": "2445:10:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -8374,10 +8773,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 531, + "id": 544, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "2467:7:1", + "src": "2445:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -8387,16 +8786,16 @@ "visibility": "internal" } ], - "src": "2445:33:1" + "src": "2423:33:1" }, - "src": "2421:224:1", + "src": "2399:224:1", "visibility": "internal" }, { "body": { - "id": 587, + "id": 600, "nodeType": "Block", - "src": "2693:316:1", + "src": "2671:316:1", "statements": [ { "expression": { @@ -8408,7 +8807,7 @@ "typeIdentifier": "t_address", "typeString": "address" }, - "id": 562, + "id": 575, "isConstant": false, "isLValue": false, "isPure": false, @@ -8419,26 +8818,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 556, + "id": 569, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 639, - "src": "2711:9:1", + "referencedDeclaration": 652, + "src": "2689:9:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$472_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$483_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelockERC20.LockContract storage ref)" } }, - "id": 558, + "id": 571, "indexExpression": { "argumentTypes": null, - "id": 557, + "id": 570, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 553, - "src": "2721:11:1", + "referencedDeclaration": 566, + "src": "2699:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -8449,21 +8848,21 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "2711:22:1", + "src": "2689:22:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage", + "typeIdentifier": "t_struct$_LockContract_$483_storage", "typeString": "struct HashedTimelockERC20.LockContract storage ref" } }, - "id": 559, + "id": 572, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "receiver", "nodeType": "MemberAccess", - "referencedDeclaration": 457, - "src": "2711:31:1", + "referencedDeclaration": 468, + "src": "2689:31:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -8475,18 +8874,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 560, + "id": 573, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "2746:3:1", + "referencedDeclaration": 1636, + "src": "2724:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 561, + "id": 574, "isConstant": false, "isLValue": false, "isPure": false, @@ -8494,13 +8893,13 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "2746:10:1", + "src": "2724:10:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, - "src": "2711:45:1", + "src": "2689:45:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -8509,14 +8908,14 @@ { "argumentTypes": null, "hexValue": "776974686472617761626c653a206e6f74207265636569766572", - "id": 563, + "id": 576, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2758:28:1", + "src": "2736:28:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_2996fe9bb22eca23c8f30e4ecaf6f5ab8925bbafce446942fa02db59ed0654ee", @@ -8536,21 +8935,21 @@ "typeString": "literal_string \"withdrawable: not receiver\"" } ], - "id": 555, + "id": 568, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "2703:7:1", + "referencedDeclaration": 1640, + "src": "2681:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 564, + "id": 577, "isConstant": false, "isLValue": false, "isPure": false, @@ -8558,15 +8957,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2703:84:1", + "src": "2681:84:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 565, + "id": 578, "nodeType": "ExpressionStatement", - "src": "2703:84:1" + "src": "2681:84:1" }, { "expression": { @@ -8578,7 +8977,7 @@ "typeIdentifier": "t_bool", "typeString": "bool" }, - "id": 572, + "id": 585, "isConstant": false, "isLValue": false, "isPure": false, @@ -8589,26 +8988,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 567, + "id": 580, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 639, - "src": "2805:9:1", + "referencedDeclaration": 652, + "src": "2783:9:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$472_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$483_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelockERC20.LockContract storage ref)" } }, - "id": 569, + "id": 582, "indexExpression": { "argumentTypes": null, - "id": 568, + "id": 581, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 553, - "src": "2815:11:1", + "referencedDeclaration": 566, + "src": "2793:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -8619,21 +9018,21 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "2805:22:1", + "src": "2783:22:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage", + "typeIdentifier": "t_struct$_LockContract_$483_storage", "typeString": "struct HashedTimelockERC20.LockContract storage ref" } }, - "id": 570, + "id": 583, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "withdrawn", "nodeType": "MemberAccess", - "referencedDeclaration": 467, - "src": "2805:32:1", + "referencedDeclaration": 478, + "src": "2783:32:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -8644,14 +9043,14 @@ "rightExpression": { "argumentTypes": null, "hexValue": "66616c7365", - "id": 571, + "id": 584, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "2841:5:1", + "src": "2819:5:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -8659,7 +9058,7 @@ }, "value": "false" }, - "src": "2805:41:1", + "src": "2783:41:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -8668,14 +9067,14 @@ { "argumentTypes": null, "hexValue": "776974686472617761626c653a20616c72656164792077697468647261776e", - "id": 573, + "id": 586, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2848:33:1", + "src": "2826:33:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_a7a1491df76b63b166fa25b3631de654587363606d31ccfadcdf86382f44f0da", @@ -8695,21 +9094,21 @@ "typeString": "literal_string \"withdrawable: already withdrawn\"" } ], - "id": 566, + "id": 579, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "2797:7:1", + "referencedDeclaration": 1640, + "src": "2775:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 574, + "id": 587, "isConstant": false, "isLValue": false, "isPure": false, @@ -8717,15 +9116,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2797:85:1", + "src": "2775:85:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 575, + "id": 588, "nodeType": "ExpressionStatement", - "src": "2797:85:1" + "src": "2775:85:1" }, { "expression": { @@ -8737,7 +9136,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 582, + "id": 595, "isConstant": false, "isLValue": false, "isPure": false, @@ -8748,26 +9147,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 577, + "id": 590, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 639, - "src": "2900:9:1", + "referencedDeclaration": 652, + "src": "2878:9:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$472_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$483_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelockERC20.LockContract storage ref)" } }, - "id": 579, + "id": 592, "indexExpression": { "argumentTypes": null, - "id": 578, + "id": 591, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 553, - "src": "2910:11:1", + "referencedDeclaration": 566, + "src": "2888:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -8778,21 +9177,21 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "2900:22:1", + "src": "2878:22:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage", + "typeIdentifier": "t_struct$_LockContract_$483_storage", "typeString": "struct HashedTimelockERC20.LockContract storage ref" } }, - "id": 580, + "id": 593, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "timelock", "nodeType": "MemberAccess", - "referencedDeclaration": 465, - "src": "2900:31:1", + "referencedDeclaration": 476, + "src": "2878:31:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -8802,18 +9201,18 @@ "operator": ">", "rightExpression": { "argumentTypes": null, - "id": 581, + "id": 594, "name": "now", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1053, - "src": "2934:3:1", + "referencedDeclaration": 1638, + "src": "2912:3:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "2900:37:1", + "src": "2878:37:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -8822,14 +9221,14 @@ { "argumentTypes": null, "hexValue": "776974686472617761626c653a2074696d656c6f636b2074696d65206d75737420626520696e2074686520667574757265", - "id": 583, + "id": 596, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2939:51:1", + "src": "2917:51:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_f90a5049b744d27b4e847d49b0f3d774706fdfcfc2fa7fe6498583db4e9e564f", @@ -8849,21 +9248,21 @@ "typeString": "literal_string \"withdrawable: timelock time must be in the future\"" } ], - "id": 576, + "id": 589, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "2892:7:1", + "referencedDeclaration": 1640, + "src": "2870:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 584, + "id": 597, "isConstant": false, "isLValue": false, "isPure": false, @@ -8871,38 +9270,38 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2892:99:1", + "src": "2870:99:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 585, + "id": 598, "nodeType": "ExpressionStatement", - "src": "2892:99:1" + "src": "2870:99:1" }, { - "id": 586, + "id": 599, "nodeType": "PlaceholderStatement", - "src": "3001:1:1" + "src": "2979:1:1" } ] }, "documentation": null, - "id": 588, + "id": 601, "name": "withdrawable", "nodeType": "ModifierDefinition", "parameters": { - "id": 554, + "id": 567, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 553, + "id": 566, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 588, - "src": "2672:19:1", + "scope": 601, + "src": "2650:19:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -8910,10 +9309,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 552, + "id": 565, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "2672:7:1", + "src": "2650:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -8923,16 +9322,16 @@ "visibility": "internal" } ], - "src": "2671:21:1" + "src": "2649:21:1" }, - "src": "2650:359:1", + "src": "2628:359:1", "visibility": "internal" }, { "body": { - "id": 634, + "id": 647, "nodeType": "Block", - "src": "3055:386:1", + "src": "3033:386:1", "statements": [ { "expression": { @@ -8944,7 +9343,7 @@ "typeIdentifier": "t_address", "typeString": "address" }, - "id": 599, + "id": 612, "isConstant": false, "isLValue": false, "isPure": false, @@ -8955,26 +9354,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 593, + "id": 606, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 639, - "src": "3073:9:1", + "referencedDeclaration": 652, + "src": "3051:9:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$472_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$483_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelockERC20.LockContract storage ref)" } }, - "id": 595, + "id": 608, "indexExpression": { "argumentTypes": null, - "id": 594, + "id": 607, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 590, - "src": "3083:11:1", + "referencedDeclaration": 603, + "src": "3061:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -8985,21 +9384,21 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "3073:22:1", + "src": "3051:22:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage", + "typeIdentifier": "t_struct$_LockContract_$483_storage", "typeString": "struct HashedTimelockERC20.LockContract storage ref" } }, - "id": 596, + "id": 609, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", - "referencedDeclaration": 455, - "src": "3073:29:1", + "referencedDeclaration": 466, + "src": "3051:29:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -9011,18 +9410,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 597, + "id": 610, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "3106:3:1", + "referencedDeclaration": 1636, + "src": "3084:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 598, + "id": 611, "isConstant": false, "isLValue": false, "isPure": false, @@ -9030,13 +9429,13 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "3106:10:1", + "src": "3084:10:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, - "src": "3073:43:1", + "src": "3051:43:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -9045,14 +9444,14 @@ { "argumentTypes": null, "hexValue": "726566756e6461626c653a206e6f742073656e646572", - "id": 600, + "id": 613, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "3118:24:1", + "src": "3096:24:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_edd5bfdacb483bdf26b05ebe186281e97d155ca7c516ffe52d11b5e39d79c23a", @@ -9072,21 +9471,21 @@ "typeString": "literal_string \"refundable: not sender\"" } ], - "id": 592, + "id": 605, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "3065:7:1", + "referencedDeclaration": 1640, + "src": "3043:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 601, + "id": 614, "isConstant": false, "isLValue": false, "isPure": false, @@ -9094,15 +9493,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "3065:78:1", + "src": "3043:78:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 602, + "id": 615, "nodeType": "ExpressionStatement", - "src": "3065:78:1" + "src": "3043:78:1" }, { "expression": { @@ -9114,7 +9513,7 @@ "typeIdentifier": "t_bool", "typeString": "bool" }, - "id": 609, + "id": 622, "isConstant": false, "isLValue": false, "isPure": false, @@ -9125,26 +9524,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 604, + "id": 617, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 639, - "src": "3161:9:1", + "referencedDeclaration": 652, + "src": "3139:9:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$472_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$483_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelockERC20.LockContract storage ref)" } }, - "id": 606, + "id": 619, "indexExpression": { "argumentTypes": null, - "id": 605, + "id": 618, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 590, - "src": "3171:11:1", + "referencedDeclaration": 603, + "src": "3149:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -9155,21 +9554,21 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "3161:22:1", + "src": "3139:22:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage", + "typeIdentifier": "t_struct$_LockContract_$483_storage", "typeString": "struct HashedTimelockERC20.LockContract storage ref" } }, - "id": 607, + "id": 620, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "refunded", "nodeType": "MemberAccess", - "referencedDeclaration": 469, - "src": "3161:31:1", + "referencedDeclaration": 480, + "src": "3139:31:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -9180,14 +9579,14 @@ "rightExpression": { "argumentTypes": null, "hexValue": "66616c7365", - "id": 608, + "id": 621, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "3196:5:1", + "src": "3174:5:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -9195,7 +9594,7 @@ }, "value": "false" }, - "src": "3161:40:1", + "src": "3139:40:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -9204,14 +9603,14 @@ { "argumentTypes": null, "hexValue": "726566756e6461626c653a20616c726561647920726566756e646564", - "id": 610, + "id": 623, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "3203:30:1", + "src": "3181:30:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_7b29f51b209a34fdcf95e658d91750e2d1af4c6890c540f7ec9b6060ebd16007", @@ -9231,21 +9630,21 @@ "typeString": "literal_string \"refundable: already refunded\"" } ], - "id": 603, + "id": 616, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "3153:7:1", + "referencedDeclaration": 1640, + "src": "3131:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 611, + "id": 624, "isConstant": false, "isLValue": false, "isPure": false, @@ -9253,15 +9652,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "3153:81:1", + "src": "3131:81:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 612, + "id": 625, "nodeType": "ExpressionStatement", - "src": "3153:81:1" + "src": "3131:81:1" }, { "expression": { @@ -9273,7 +9672,7 @@ "typeIdentifier": "t_bool", "typeString": "bool" }, - "id": 619, + "id": 632, "isConstant": false, "isLValue": false, "isPure": false, @@ -9284,26 +9683,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 614, + "id": 627, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 639, - "src": "3252:9:1", + "referencedDeclaration": 652, + "src": "3230:9:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$472_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$483_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelockERC20.LockContract storage ref)" } }, - "id": 616, + "id": 629, "indexExpression": { "argumentTypes": null, - "id": 615, + "id": 628, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 590, - "src": "3262:11:1", + "referencedDeclaration": 603, + "src": "3240:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -9314,21 +9713,21 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "3252:22:1", + "src": "3230:22:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage", + "typeIdentifier": "t_struct$_LockContract_$483_storage", "typeString": "struct HashedTimelockERC20.LockContract storage ref" } }, - "id": 617, + "id": 630, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "withdrawn", "nodeType": "MemberAccess", - "referencedDeclaration": 467, - "src": "3252:32:1", + "referencedDeclaration": 478, + "src": "3230:32:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -9339,14 +9738,14 @@ "rightExpression": { "argumentTypes": null, "hexValue": "66616c7365", - "id": 618, + "id": 631, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "3288:5:1", + "src": "3266:5:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -9354,7 +9753,7 @@ }, "value": "false" }, - "src": "3252:41:1", + "src": "3230:41:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -9363,14 +9762,14 @@ { "argumentTypes": null, "hexValue": "726566756e6461626c653a20616c72656164792077697468647261776e", - "id": 620, + "id": 633, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "3295:31:1", + "src": "3273:31:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_3b5b42a6105acb76ce8eb8957616623bad95a1e8514f0d2809f4b82a9c3b0fce", @@ -9390,21 +9789,21 @@ "typeString": "literal_string \"refundable: already withdrawn\"" } ], - "id": 613, + "id": 626, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "3244:7:1", + "referencedDeclaration": 1640, + "src": "3222:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 621, + "id": 634, "isConstant": false, "isLValue": false, "isPure": false, @@ -9412,15 +9811,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "3244:83:1", + "src": "3222:83:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 622, + "id": 635, "nodeType": "ExpressionStatement", - "src": "3244:83:1" + "src": "3222:83:1" }, { "expression": { @@ -9432,7 +9831,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 629, + "id": 642, "isConstant": false, "isLValue": false, "isPure": false, @@ -9443,26 +9842,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 624, + "id": 637, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 639, - "src": "3345:9:1", + "referencedDeclaration": 652, + "src": "3323:9:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$472_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$483_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelockERC20.LockContract storage ref)" } }, - "id": 626, + "id": 639, "indexExpression": { "argumentTypes": null, - "id": 625, + "id": 638, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 590, - "src": "3355:11:1", + "referencedDeclaration": 603, + "src": "3333:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -9473,21 +9872,21 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "3345:22:1", + "src": "3323:22:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage", + "typeIdentifier": "t_struct$_LockContract_$483_storage", "typeString": "struct HashedTimelockERC20.LockContract storage ref" } }, - "id": 627, + "id": 640, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "timelock", "nodeType": "MemberAccess", - "referencedDeclaration": 465, - "src": "3345:31:1", + "referencedDeclaration": 476, + "src": "3323:31:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -9497,18 +9896,18 @@ "operator": "<=", "rightExpression": { "argumentTypes": null, - "id": 628, + "id": 641, "name": "now", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1053, - "src": "3380:3:1", + "referencedDeclaration": 1638, + "src": "3358:3:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "3345:38:1", + "src": "3323:38:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -9517,14 +9916,14 @@ { "argumentTypes": null, "hexValue": "726566756e6461626c653a2074696d656c6f636b206e6f742079657420706173736564", - "id": 630, + "id": 643, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "3385:37:1", + "src": "3363:37:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_53ffb24e93d3b349bff6339724d28c73880587cacedffccbcdea5da101fc50b9", @@ -9544,21 +9943,21 @@ "typeString": "literal_string \"refundable: timelock not yet passed\"" } ], - "id": 623, + "id": 636, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1054, - 1055 + 1639, + 1640 ], - "referencedDeclaration": 1055, - "src": "3337:7:1", + "referencedDeclaration": 1640, + "src": "3315:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 631, + "id": 644, "isConstant": false, "isLValue": false, "isPure": false, @@ -9566,38 +9965,38 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "3337:86:1", + "src": "3315:86:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 632, + "id": 645, "nodeType": "ExpressionStatement", - "src": "3337:86:1" + "src": "3315:86:1" }, { - "id": 633, + "id": 646, "nodeType": "PlaceholderStatement", - "src": "3433:1:1" + "src": "3411:1:1" } ] }, "documentation": null, - "id": 635, + "id": 648, "name": "refundable", "nodeType": "ModifierDefinition", "parameters": { - "id": 591, + "id": 604, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 590, + "id": 603, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 635, - "src": "3034:19:1", + "scope": 648, + "src": "3012:19:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -9605,10 +10004,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 589, + "id": 602, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "3034:7:1", + "src": "3012:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -9618,51 +10017,51 @@ "visibility": "internal" } ], - "src": "3033:21:1" + "src": "3011:21:1" }, - "src": "3014:427:1", + "src": "2992:427:1", "visibility": "internal" }, { "constant": false, - "id": 639, + "id": 652, "name": "contracts", "nodeType": "VariableDeclaration", - "scope": 904, - "src": "3447:43:1", + "scope": 935, + "src": "3425:43:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$472_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$483_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelockERC20.LockContract)" }, "typeName": { - "id": 638, + "id": 651, "keyType": { - "id": 636, + "id": 649, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "3456:7:1", + "src": "3434:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "Mapping", - "src": "3447:33:1", + "src": "3425:33:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$472_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$483_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelockERC20.LockContract)" }, "valueType": { "contractScope": null, - "id": 637, + "id": 650, "name": "LockContract", "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 472, - "src": "3467:12:1", + "referencedDeclaration": 483, + "src": "3445:12:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract" } } @@ -9672,26 +10071,26 @@ }, { "body": { - "id": 727, + "id": 742, "nodeType": "Block", - "src": "4566:1141:1", + "src": "4544:1138:1", "statements": [ { "expression": { "argumentTypes": null, - "id": 676, + "id": 689, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, - "id": 663, + "id": 676, "name": "contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 661, - "src": "4576:10:1", + "referencedDeclaration": 674, + "src": "4554:10:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -9709,18 +10108,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 667, + "id": 680, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "4643:3:1", + "referencedDeclaration": 1636, + "src": "4621:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 668, + "id": 681, "isConstant": false, "isLValue": false, "isPure": false, @@ -9728,20 +10127,20 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "4643:10:1", + "src": "4621:10:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, { "argumentTypes": null, - "id": 669, + "id": 682, "name": "_receiver", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 641, - "src": "4671:9:1", + "referencedDeclaration": 654, + "src": "4649:9:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -9749,12 +10148,12 @@ }, { "argumentTypes": null, - "id": 670, + "id": 683, "name": "_tokenContract", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 647, - "src": "4698:14:1", + "referencedDeclaration": 660, + "src": "4676:14:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -9762,12 +10161,12 @@ }, { "argumentTypes": null, - "id": 671, + "id": 684, "name": "_amount", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 649, - "src": "4730:7:1", + "referencedDeclaration": 662, + "src": "4708:7:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -9775,12 +10174,12 @@ }, { "argumentTypes": null, - "id": 672, + "id": 685, "name": "_hashlock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 643, - "src": "4755:9:1", + "referencedDeclaration": 656, + "src": "4733:9:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -9788,12 +10187,12 @@ }, { "argumentTypes": null, - "id": 673, + "id": 686, "name": "_timelock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 645, - "src": "4782:9:1", + "referencedDeclaration": 658, + "src": "4760:9:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -9803,8 +10202,8 @@ "expression": { "argumentTypes": [ { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, { "typeIdentifier": "t_address", @@ -9829,18 +10228,18 @@ ], "expression": { "argumentTypes": null, - "id": 665, + "id": 678, "name": "abi", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1038, - "src": "4609:3:1", + "referencedDeclaration": 1623, + "src": "4587:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_abi", "typeString": "abi" } }, - "id": 666, + "id": 679, "isConstant": false, "isLValue": false, "isPure": true, @@ -9848,13 +10247,13 @@ "memberName": "encodePacked", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "4609:16:1", + "src": "4587:16:1", "typeDescriptions": { "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", "typeString": "function () pure returns (bytes memory)" } }, - "id": 674, + "id": 687, "isConstant": false, "isLValue": false, "isPure": false, @@ -9862,7 +10261,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "4609:196:1", + "src": "4587:196:1", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" @@ -9876,18 +10275,18 @@ "typeString": "bytes memory" } ], - "id": 664, + "id": 677, "name": "sha256", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1060, - "src": "4589:6:1", + "referencedDeclaration": 1645, + "src": "4567:6:1", "typeDescriptions": { - "typeIdentifier": "t_function_sha256_pure$__$returns$_t_bytes32_$", - "typeString": "function () pure returns (bytes32)" + "typeIdentifier": "t_function_sha256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" } }, - "id": 675, + "id": 688, "isConstant": false, "isLValue": false, "isPure": false, @@ -9895,21 +10294,21 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "4589:226:1", + "src": "4567:226:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "src": "4576:239:1", + "src": "4554:239:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "id": 677, + "id": 690, "nodeType": "ExpressionStatement", - "src": "4576:239:1" + "src": "4554:239:1" }, { "condition": { @@ -9917,12 +10316,12 @@ "arguments": [ { "argumentTypes": null, - "id": 679, + "id": 692, "name": "contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 661, - "src": "5028:10:1", + "referencedDeclaration": 674, + "src": "5006:10:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -9936,18 +10335,18 @@ "typeString": "bytes32" } ], - "id": 678, + "id": 691, "name": "haveContract", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 903, - "src": "5015:12:1", + "referencedDeclaration": 934, + "src": "4993:12:1", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bool_$", "typeString": "function (bytes32) view returns (bool)" } }, - "id": 680, + "id": 693, "isConstant": false, "isLValue": false, "isPure": false, @@ -9955,37 +10354,37 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "5015:24:1", + "src": "4993:24:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, - "id": 684, + "id": 697, "nodeType": "IfStatement", - "src": "5011:50:1", + "src": "4989:50:1", "trueBody": { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], - "id": 681, + "id": 694, "name": "revert", "nodeType": "Identifier", "overloadedDeclarations": [ - 1056, - 1057 + 1641, + 1642 ], - "referencedDeclaration": 1056, - "src": "5053:6:1", + "referencedDeclaration": 1641, + "src": "5031:6:1", "typeDescriptions": { "typeIdentifier": "t_function_revert_pure$__$returns$__$", "typeString": "function () pure" } }, - "id": 682, + "id": 695, "isConstant": false, "isLValue": false, "isPure": false, @@ -9993,21 +10392,21 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "5053:8:1", + "src": "5031:8:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 683, + "id": 696, "nodeType": "ExpressionStatement", - "src": "5053:8:1" + "src": "5031:8:1" } }, { "condition": { "argumentTypes": null, - "id": 694, + "id": 709, "isConstant": false, "isLValue": false, "isPure": false, @@ -10015,7 +10414,7 @@ "nodeType": "UnaryOperation", "operator": "!", "prefix": true, - "src": "5143:62:1", + "src": "5121:71:1", "subExpression": { "argumentTypes": null, "arguments": [ @@ -10023,18 +10422,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 689, + "id": 702, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "5179:3:1", + "referencedDeclaration": 1636, + "src": "5157:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 690, + "id": 703, "isConstant": false, "isLValue": false, "isPure": false, @@ -10042,33 +10441,71 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "5179:10:1", + "src": "5157:10:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, { "argumentTypes": null, - "id": 691, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1070, - "src": "5191:4:1", + "arguments": [ + { + "argumentTypes": null, + "id": 705, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1657, + "src": "5177:4:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_HashedTimelockERC20_$935", + "typeString": "contract HashedTimelockERC20" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_HashedTimelockERC20_$935", + "typeString": "contract HashedTimelockERC20" + } + ], + "id": 704, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5169:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 706, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5169:13:1", "typeDescriptions": { - "typeIdentifier": "t_contract$_HashedTimelockERC20_$904", - "typeString": "contract HashedTimelockERC20" + "typeIdentifier": "t_address", + "typeString": "address" } }, { "argumentTypes": null, - "id": 692, + "id": 707, "name": "_amount", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 649, - "src": "5197:7:1", + "referencedDeclaration": 662, + "src": "5184:7:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -10078,12 +10515,12 @@ "expression": { "argumentTypes": [ { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, { - "typeIdentifier": "t_contract$_HashedTimelockERC20_$904", - "typeString": "contract HashedTimelockERC20" + "typeIdentifier": "t_address", + "typeString": "address" }, { "typeIdentifier": "t_uint256", @@ -10095,12 +10532,12 @@ "arguments": [ { "argumentTypes": null, - "id": 686, + "id": 699, "name": "_tokenContract", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 647, - "src": "5150:14:1", + "referencedDeclaration": 660, + "src": "5128:14:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -10114,18 +10551,18 @@ "typeString": "address" } ], - "id": 685, + "id": 698, "name": "ERC20", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1004, - "src": "5144:5:1", + "referencedDeclaration": 1552, + "src": "5122:5:1", "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_ERC20_$1004_$", + "typeIdentifier": "t_type$_t_contract$_ERC20_$1552_$", "typeString": "type(contract ERC20)" } }, - "id": 687, + "id": 700, "isConstant": false, "isLValue": false, "isPure": false, @@ -10133,27 +10570,27 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "5144:21:1", + "src": "5122:21:1", "typeDescriptions": { - "typeIdentifier": "t_contract$_ERC20_$1004", + "typeIdentifier": "t_contract$_ERC20_$1552", "typeString": "contract ERC20" } }, - "id": 688, + "id": 701, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "transferFrom", "nodeType": "MemberAccess", - "referencedDeclaration": 986, - "src": "5144:34:1", + "referencedDeclaration": 1281, + "src": "5122:34:1", "typeDescriptions": { "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$", "typeString": "function (address,address,uint256) external returns (bool)" } }, - "id": 693, + "id": 708, "isConstant": false, "isLValue": false, "isPure": false, @@ -10161,7 +10598,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "5144:61:1", + "src": "5122:70:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -10173,30 +10610,30 @@ } }, "falseBody": null, - "id": 698, + "id": 713, "nodeType": "IfStatement", - "src": "5139:88:1", + "src": "5117:97:1", "trueBody": { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], - "id": 695, + "id": 710, "name": "revert", "nodeType": "Identifier", "overloadedDeclarations": [ - 1056, - 1057 + 1641, + 1642 ], - "referencedDeclaration": 1056, - "src": "5219:6:1", + "referencedDeclaration": 1641, + "src": "5206:6:1", "typeDescriptions": { "typeIdentifier": "t_function_revert_pure$__$returns$__$", "typeString": "function () pure" } }, - "id": 696, + "id": 711, "isConstant": false, "isLValue": false, "isPure": false, @@ -10204,21 +10641,21 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "5219:8:1", + "src": "5206:8:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 697, + "id": 712, "nodeType": "ExpressionStatement", - "src": "5219:8:1" + "src": "5206:8:1" } }, { "expression": { "argumentTypes": null, - "id": 714, + "id": 729, "isConstant": false, "isLValue": false, "isPure": false, @@ -10227,26 +10664,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 699, + "id": 714, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 639, - "src": "5250:9:1", + "referencedDeclaration": 652, + "src": "5225:9:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$472_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$483_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelockERC20.LockContract storage ref)" } }, - "id": 701, + "id": 716, "indexExpression": { "argumentTypes": null, - "id": 700, + "id": 715, "name": "contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 661, - "src": "5260:10:1", + "referencedDeclaration": 674, + "src": "5235:10:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -10257,9 +10694,9 @@ "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", - "src": "5250:21:1", + "src": "5225:21:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage", + "typeIdentifier": "t_struct$_LockContract_$483_storage", "typeString": "struct HashedTimelockERC20.LockContract storage ref" } }, @@ -10272,18 +10709,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 703, + "id": 718, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "5300:3:1", + "referencedDeclaration": 1636, + "src": "5275:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 704, + "id": 719, "isConstant": false, "isLValue": false, "isPure": false, @@ -10291,20 +10728,20 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "5300:10:1", + "src": "5275:10:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, { "argumentTypes": null, - "id": 705, + "id": 720, "name": "_receiver", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 641, - "src": "5324:9:1", + "referencedDeclaration": 654, + "src": "5299:9:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -10312,12 +10749,12 @@ }, { "argumentTypes": null, - "id": 706, + "id": 721, "name": "_tokenContract", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 647, - "src": "5347:14:1", + "referencedDeclaration": 660, + "src": "5322:14:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -10325,12 +10762,12 @@ }, { "argumentTypes": null, - "id": 707, + "id": 722, "name": "_amount", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 649, - "src": "5375:7:1", + "referencedDeclaration": 662, + "src": "5350:7:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -10338,12 +10775,12 @@ }, { "argumentTypes": null, - "id": 708, + "id": 723, "name": "_hashlock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 643, - "src": "5396:9:1", + "referencedDeclaration": 656, + "src": "5371:9:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -10351,12 +10788,12 @@ }, { "argumentTypes": null, - "id": 709, + "id": 724, "name": "_timelock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 645, - "src": "5419:9:1", + "referencedDeclaration": 658, + "src": "5394:9:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -10365,14 +10802,14 @@ { "argumentTypes": null, "hexValue": "66616c7365", - "id": 710, + "id": 725, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "5442:5:1", + "src": "5417:5:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -10383,14 +10820,14 @@ { "argumentTypes": null, "hexValue": "66616c7365", - "id": 711, + "id": 726, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "5461:5:1", + "src": "5436:5:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -10401,14 +10838,14 @@ { "argumentTypes": null, "hexValue": "307830", - "id": 712, + "id": 727, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "5480:3:1", + "src": "5455:3:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", @@ -10420,8 +10857,8 @@ "expression": { "argumentTypes": [ { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, { "typeIdentifier": "t_address", @@ -10456,18 +10893,18 @@ "typeString": "int_const 0" } ], - "id": 702, + "id": 717, "name": "LockContract", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 472, - "src": "5274:12:1", + "referencedDeclaration": 483, + "src": "5249:12:1", "typeDescriptions": { - "typeIdentifier": "t_type$_t_struct$_LockContract_$472_storage_ptr_$", + "typeIdentifier": "t_type$_t_struct$_LockContract_$483_storage_ptr_$", "typeString": "type(struct HashedTimelockERC20.LockContract storage pointer)" } }, - "id": 713, + "id": 728, "isConstant": false, "isLValue": false, "isPure": false, @@ -10475,21 +10912,21 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "5274:219:1", + "src": "5249:219:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_memory", + "typeIdentifier": "t_struct$_LockContract_$483_memory", "typeString": "struct HashedTimelockERC20.LockContract memory" } }, - "src": "5250:243:1", + "src": "5225:243:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage", + "typeIdentifier": "t_struct$_LockContract_$483_storage", "typeString": "struct HashedTimelockERC20.LockContract storage ref" } }, - "id": 715, + "id": 730, "nodeType": "ExpressionStatement", - "src": "5250:243:1" + "src": "5225:243:1" }, { "eventCall": { @@ -10497,12 +10934,12 @@ "arguments": [ { "argumentTypes": null, - "id": 717, + "id": 732, "name": "contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 661, - "src": "5538:10:1", + "referencedDeclaration": 674, + "src": "5513:10:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -10512,18 +10949,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 718, + "id": 733, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "5562:3:1", + "referencedDeclaration": 1636, + "src": "5537:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 719, + "id": 734, "isConstant": false, "isLValue": false, "isPure": false, @@ -10531,20 +10968,20 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "5562:10:1", + "src": "5537:10:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, { "argumentTypes": null, - "id": 720, + "id": 735, "name": "_receiver", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 641, - "src": "5586:9:1", + "referencedDeclaration": 654, + "src": "5561:9:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -10552,12 +10989,12 @@ }, { "argumentTypes": null, - "id": 721, + "id": 736, "name": "_tokenContract", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 647, - "src": "5609:14:1", + "referencedDeclaration": 660, + "src": "5584:14:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -10565,12 +11002,12 @@ }, { "argumentTypes": null, - "id": 722, + "id": 737, "name": "_amount", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 649, - "src": "5637:7:1", + "referencedDeclaration": 662, + "src": "5612:7:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -10578,12 +11015,12 @@ }, { "argumentTypes": null, - "id": 723, + "id": 738, "name": "_hashlock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 643, - "src": "5658:9:1", + "referencedDeclaration": 656, + "src": "5633:9:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -10591,12 +11028,12 @@ }, { "argumentTypes": null, - "id": 724, + "id": 739, "name": "_timelock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 645, - "src": "5681:9:1", + "referencedDeclaration": 658, + "src": "5656:9:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -10610,8 +11047,8 @@ "typeString": "bytes32" }, { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" }, { "typeIdentifier": "t_address", @@ -10634,18 +11071,18 @@ "typeString": "uint256" } ], - "id": 716, + "id": 731, "name": "LogHTLCERC20New", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 445, - "src": "5509:15:1", + "referencedDeclaration": 456, + "src": "5484:15:1", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_bytes32_$_t_uint256_$returns$__$", "typeString": "function (bytes32,address,address,address,uint256,bytes32,uint256)" } }, - "id": 725, + "id": 740, "isConstant": false, "isLValue": false, "isPure": false, @@ -10653,34 +11090,33 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "5509:191:1", + "src": "5484:191:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 726, + "id": 741, "nodeType": "EmitStatement", - "src": "5504:196:1" + "src": "5479:196:1" } ] }, "documentation": "@dev Sender / Payer sets up a new hash time lock contract depositing the\nfunds and providing the reciever and terms.\n * NOTE: _receiver must first call approve() on the token contract. \n See allowance check in tokensTransferable modifier.\n@param _receiver Receiver of the tokens.\n@param _hashlock A sha-2 sha256 hash hashlock.\n@param _timelock UNIX epoch seconds time that the lock expires at. \n Refunds can be made after this time.\n@param _tokenContract ERC20 Token contract address.\n@param _amount Amount of the token to lock up.\n@return contractId Id of the new HTLC. This is needed for subsequent \n calls.", - "id": 728, + "id": 743, "implemented": true, - "isConstructor": false, - "isDeclaredConst": false, + "kind": "function", "modifiers": [ { "arguments": [ { "argumentTypes": null, - "id": 652, + "id": 665, "name": "_tokenContract", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 647, - "src": "4454:14:1", + "referencedDeclaration": 660, + "src": "4432:14:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -10690,18 +11126,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 653, + "id": 666, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1051, - "src": "4470:3:1", + "referencedDeclaration": 1636, + "src": "4448:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 654, + "id": 667, "isConstant": false, "isLValue": false, "isPure": false, @@ -10709,90 +11145,90 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "4470:10:1", + "src": "4448:10:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, { "argumentTypes": null, - "id": 655, + "id": 668, "name": "_amount", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 649, - "src": "4482:7:1", + "referencedDeclaration": 662, + "src": "4460:7:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], - "id": 656, + "id": 669, "modifierName": { "argumentTypes": null, - "id": 651, + "id": 664, "name": "tokensTransferable", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 502, - "src": "4435:18:1", + "referencedDeclaration": 515, + "src": "4413:18:1", "typeDescriptions": { "typeIdentifier": "t_modifier$_t_address_$_t_address_$_t_uint256_$", "typeString": "modifier (address,address,uint256)" } }, "nodeType": "ModifierInvocation", - "src": "4435:55:1" + "src": "4413:55:1" }, { "arguments": [ { "argumentTypes": null, - "id": 658, + "id": 671, "name": "_timelock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 645, - "src": "4514:9:1", + "referencedDeclaration": 658, + "src": "4492:9:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], - "id": 659, + "id": 672, "modifierName": { "argumentTypes": null, - "id": 657, + "id": 670, "name": "futureTimelock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 515, - "src": "4499:14:1", + "referencedDeclaration": 528, + "src": "4477:14:1", "typeDescriptions": { "typeIdentifier": "t_modifier$_t_uint256_$", "typeString": "modifier (uint256)" } }, "nodeType": "ModifierInvocation", - "src": "4499:25:1" + "src": "4477:25:1" } ], "name": "newContract", "nodeType": "FunctionDefinition", "parameters": { - "id": 650, + "id": 663, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 641, + "id": 654, "name": "_receiver", "nodeType": "VariableDeclaration", - "scope": 728, - "src": "4281:17:1", + "scope": 743, + "src": "4259:17:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -10800,10 +11236,11 @@ "typeString": "address" }, "typeName": { - "id": 640, + "id": 653, "name": "address", "nodeType": "ElementaryTypeName", - "src": "4281:7:1", + "src": "4259:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -10814,11 +11251,11 @@ }, { "constant": false, - "id": 643, + "id": 656, "name": "_hashlock", "nodeType": "VariableDeclaration", - "scope": 728, - "src": "4308:17:1", + "scope": 743, + "src": "4286:17:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -10826,10 +11263,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 642, + "id": 655, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "4308:7:1", + "src": "4286:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -10840,11 +11277,11 @@ }, { "constant": false, - "id": 645, + "id": 658, "name": "_timelock", "nodeType": "VariableDeclaration", - "scope": 728, - "src": "4335:14:1", + "scope": 743, + "src": "4313:14:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -10852,10 +11289,10 @@ "typeString": "uint256" }, "typeName": { - "id": 644, + "id": 657, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "4335:4:1", + "src": "4313:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -10866,11 +11303,11 @@ }, { "constant": false, - "id": 647, + "id": 660, "name": "_tokenContract", "nodeType": "VariableDeclaration", - "scope": 728, - "src": "4359:22:1", + "scope": 743, + "src": "4337:22:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -10878,10 +11315,11 @@ "typeString": "address" }, "typeName": { - "id": 646, + "id": 659, "name": "address", "nodeType": "ElementaryTypeName", - "src": "4359:7:1", + "src": "4337:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -10892,11 +11330,11 @@ }, { "constant": false, - "id": 649, + "id": 662, "name": "_amount", "nodeType": "VariableDeclaration", - "scope": 728, - "src": "4391:12:1", + "scope": 743, + "src": "4369:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -10904,10 +11342,10 @@ "typeString": "uint256" }, "typeName": { - "id": 648, + "id": 661, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "4391:4:1", + "src": "4369:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -10917,20 +11355,19 @@ "visibility": "internal" } ], - "src": "4271:138:1" + "src": "4249:138:1" }, - "payable": false, "returnParameters": { - "id": 662, + "id": 675, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 661, + "id": 674, "name": "contractId", "nodeType": "VariableDeclaration", - "scope": 728, - "src": "4542:18:1", + "scope": 743, + "src": "4520:18:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -10938,10 +11375,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 660, + "id": 673, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "4542:7:1", + "src": "4520:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -10951,47 +11388,47 @@ "visibility": "internal" } ], - "src": "4541:20:1" + "src": "4519:20:1" }, - "scope": 904, - "src": "4251:1456:1", + "scope": 935, + "src": "4229:1453:1", "stateMutability": "nonpayable", "superFunction": null, "visibility": "external" }, { "body": { - "id": 782, + "id": 797, "nodeType": "Block", - "src": "6261:256:1", + "src": "6236:256:1", "statements": [ { "assignments": [ - 748 + 763 ], "declarations": [ { "constant": false, - "id": 748, + "id": 763, "name": "c", "nodeType": "VariableDeclaration", - "scope": 782, - "src": "6271:22:1", + "scope": 797, + "src": "6246:22:1", "stateVariable": false, "storageLocation": "storage", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract" }, "typeName": { "contractScope": null, - "id": 747, + "id": 762, "name": "LockContract", "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 472, - "src": "6271:12:1", + "referencedDeclaration": 483, + "src": "6246:12:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract" } }, @@ -10999,31 +11436,31 @@ "visibility": "internal" } ], - "id": 752, + "id": 767, "initialValue": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 749, + "id": 764, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 639, - "src": "6296:9:1", + "referencedDeclaration": 652, + "src": "6271:9:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$472_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$483_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelockERC20.LockContract storage ref)" } }, - "id": 751, + "id": 766, "indexExpression": { "argumentTypes": null, - "id": 750, + "id": 765, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 730, - "src": "6306:11:1", + "referencedDeclaration": 745, + "src": "6281:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -11034,19 +11471,19 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "6296:22:1", + "src": "6271:22:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage", + "typeIdentifier": "t_struct$_LockContract_$483_storage", "typeString": "struct HashedTimelockERC20.LockContract storage ref" } }, "nodeType": "VariableDeclarationStatement", - "src": "6271:47:1" + "src": "6246:47:1" }, { "expression": { "argumentTypes": null, - "id": 757, + "id": 772, "isConstant": false, "isLValue": false, "isPure": false, @@ -11055,26 +11492,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 753, + "id": 768, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 748, - "src": "6328:1:1", + "referencedDeclaration": 763, + "src": "6303:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 755, + "id": 770, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "memberName": "preimage", "nodeType": "MemberAccess", - "referencedDeclaration": 471, - "src": "6328:10:1", + "referencedDeclaration": 482, + "src": "6303:10:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -11084,31 +11521,31 @@ "operator": "=", "rightHandSide": { "argumentTypes": null, - "id": 756, + "id": 771, "name": "_preimage", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 732, - "src": "6341:9:1", + "referencedDeclaration": 747, + "src": "6316:9:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "src": "6328:22:1", + "src": "6303:22:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "id": 758, + "id": 773, "nodeType": "ExpressionStatement", - "src": "6328:22:1" + "src": "6303:22:1" }, { "expression": { "argumentTypes": null, - "id": 763, + "id": 778, "isConstant": false, "isLValue": false, "isPure": false, @@ -11117,26 +11554,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 759, + "id": 774, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 748, - "src": "6360:1:1", + "referencedDeclaration": 763, + "src": "6335:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 761, + "id": 776, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "memberName": "withdrawn", "nodeType": "MemberAccess", - "referencedDeclaration": 467, - "src": "6360:11:1", + "referencedDeclaration": 478, + "src": "6335:11:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -11147,14 +11584,14 @@ "rightHandSide": { "argumentTypes": null, "hexValue": "74727565", - "id": 762, + "id": 777, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "6374:4:1", + "src": "6349:4:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -11162,15 +11599,15 @@ }, "value": "true" }, - "src": "6360:18:1", + "src": "6335:18:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "id": 764, + "id": 779, "nodeType": "ExpressionStatement", - "src": "6360:18:1" + "src": "6335:18:1" }, { "expression": { @@ -11180,26 +11617,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 770, + "id": 785, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 748, - "src": "6420:1:1", + "referencedDeclaration": 763, + "src": "6395:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 771, + "id": 786, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "receiver", "nodeType": "MemberAccess", - "referencedDeclaration": 457, - "src": "6420:10:1", + "referencedDeclaration": 468, + "src": "6395:10:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -11209,26 +11646,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 772, + "id": 787, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 748, - "src": "6432:1:1", + "referencedDeclaration": 763, + "src": "6407:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 773, + "id": 788, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "amount", "nodeType": "MemberAccess", - "referencedDeclaration": 461, - "src": "6432:8:1", + "referencedDeclaration": 472, + "src": "6407:8:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -11253,26 +11690,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 766, + "id": 781, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 748, - "src": "6394:1:1", + "referencedDeclaration": 763, + "src": "6369:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 767, + "id": 782, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "tokenContract", "nodeType": "MemberAccess", - "referencedDeclaration": 459, - "src": "6394:15:1", + "referencedDeclaration": 470, + "src": "6369:15:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -11286,18 +11723,18 @@ "typeString": "address" } ], - "id": 765, + "id": 780, "name": "ERC20", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1004, - "src": "6388:5:1", + "referencedDeclaration": 1552, + "src": "6363:5:1", "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_ERC20_$1004_$", + "typeIdentifier": "t_type$_t_contract$_ERC20_$1552_$", "typeString": "type(contract ERC20)" } }, - "id": 768, + "id": 783, "isConstant": false, "isLValue": false, "isPure": false, @@ -11305,27 +11742,27 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "6388:22:1", + "src": "6363:22:1", "typeDescriptions": { - "typeIdentifier": "t_contract$_ERC20_$1004", + "typeIdentifier": "t_contract$_ERC20_$1552", "typeString": "contract ERC20" } }, - "id": 769, + "id": 784, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "transfer", "nodeType": "MemberAccess", - "referencedDeclaration": 1027, - "src": "6388:31:1", + "referencedDeclaration": 1196, + "src": "6363:31:1", "typeDescriptions": { "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", "typeString": "function (address,uint256) external returns (bool)" } }, - "id": 774, + "id": 789, "isConstant": false, "isLValue": false, "isPure": false, @@ -11333,15 +11770,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "6388:53:1", + "src": "6363:53:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "id": 775, + "id": 790, "nodeType": "ExpressionStatement", - "src": "6388:53:1" + "src": "6363:53:1" }, { "eventCall": { @@ -11349,12 +11786,12 @@ "arguments": [ { "argumentTypes": null, - "id": 777, + "id": 792, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 730, - "src": "6477:11:1", + "referencedDeclaration": 745, + "src": "6452:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -11368,18 +11805,18 @@ "typeString": "bytes32" } ], - "id": 776, + "id": 791, "name": "LogHTLCERC20Withdraw", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 449, - "src": "6456:20:1", + "referencedDeclaration": 460, + "src": "6431:20:1", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$returns$__$", "typeString": "function (bytes32)" } }, - "id": 778, + "id": 793, "isConstant": false, "isLValue": false, "isPure": false, @@ -11387,28 +11824,28 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "6456:33:1", + "src": "6431:33:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 779, + "id": 794, "nodeType": "EmitStatement", - "src": "6451:38:1" + "src": "6426:38:1" }, { "expression": { "argumentTypes": null, "hexValue": "74727565", - "id": 780, + "id": 795, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "6506:4:1", + "src": "6481:4:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -11416,62 +11853,61 @@ }, "value": "true" }, - "functionReturnParameters": 746, - "id": 781, + "functionReturnParameters": 761, + "id": 796, "nodeType": "Return", - "src": "6499:11:1" + "src": "6474:11:1" } ] }, "documentation": "@dev Called by the receiver once they know the preimage of the hashlock.\nThis will transfer ownership of the locked tokens to their address.\n * @param _contractId Id of the HTLC.\n@param _preimage sha256(_preimage) should equal the contract hashlock.\n@return bool true on success", - "id": 783, + "id": 798, "implemented": true, - "isConstructor": false, - "isDeclaredConst": false, + "kind": "function", "modifiers": [ { "arguments": [ { "argumentTypes": null, - "id": 735, + "id": 750, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 730, - "src": "6139:11:1", + "referencedDeclaration": 745, + "src": "6114:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], - "id": 736, + "id": 751, "modifierName": { "argumentTypes": null, - "id": 734, + "id": 749, "name": "contractExists", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 528, - "src": "6124:14:1", + "referencedDeclaration": 541, + "src": "6099:14:1", "typeDescriptions": { "typeIdentifier": "t_modifier$_t_bytes32_$", "typeString": "modifier (bytes32)" } }, "nodeType": "ModifierInvocation", - "src": "6124:27:1" + "src": "6099:27:1" }, { "arguments": [ { "argumentTypes": null, - "id": 738, + "id": 753, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 730, - "src": "6176:11:1", + "referencedDeclaration": 745, + "src": "6151:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -11479,82 +11915,82 @@ }, { "argumentTypes": null, - "id": 739, + "id": 754, "name": "_preimage", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 732, - "src": "6189:9:1", + "referencedDeclaration": 747, + "src": "6164:9:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], - "id": 740, + "id": 755, "modifierName": { "argumentTypes": null, - "id": 737, + "id": 752, "name": "hashlockMatches", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 551, - "src": "6160:15:1", + "referencedDeclaration": 564, + "src": "6135:15:1", "typeDescriptions": { "typeIdentifier": "t_modifier$_t_bytes32_$_t_bytes32_$", "typeString": "modifier (bytes32,bytes32)" } }, "nodeType": "ModifierInvocation", - "src": "6160:39:1" + "src": "6135:39:1" }, { "arguments": [ { "argumentTypes": null, - "id": 742, + "id": 757, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 730, - "src": "6221:11:1", + "referencedDeclaration": 745, + "src": "6196:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], - "id": 743, + "id": 758, "modifierName": { "argumentTypes": null, - "id": 741, + "id": 756, "name": "withdrawable", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 588, - "src": "6208:12:1", + "referencedDeclaration": 601, + "src": "6183:12:1", "typeDescriptions": { "typeIdentifier": "t_modifier$_t_bytes32_$", "typeString": "modifier (bytes32)" } }, "nodeType": "ModifierInvocation", - "src": "6208:25:1" + "src": "6183:25:1" } ], "name": "withdraw", "nodeType": "FunctionDefinition", "parameters": { - "id": 733, + "id": 748, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 730, + "id": 745, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 783, - "src": "6059:19:1", + "scope": 798, + "src": "6034:19:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -11562,10 +11998,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 729, + "id": 744, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "6059:7:1", + "src": "6034:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -11576,11 +12012,11 @@ }, { "constant": false, - "id": 732, + "id": 747, "name": "_preimage", "nodeType": "VariableDeclaration", - "scope": 783, - "src": "6080:17:1", + "scope": 798, + "src": "6055:17:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -11588,10 +12024,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 731, + "id": 746, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "6080:7:1", + "src": "6055:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -11601,20 +12037,19 @@ "visibility": "internal" } ], - "src": "6058:40:1" + "src": "6033:40:1" }, - "payable": false, "returnParameters": { - "id": 746, + "id": 761, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 745, + "id": 760, "name": "", "nodeType": "VariableDeclaration", - "scope": 783, - "src": "6251:4:1", + "scope": 798, + "src": "6226:4:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -11622,10 +12057,10 @@ "typeString": "bool" }, "typeName": { - "id": 744, + "id": 759, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "6251:4:1", + "src": "6226:4:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -11635,47 +12070,47 @@ "visibility": "internal" } ], - "src": "6250:6:1" + "src": "6225:6:1" }, - "scope": 904, - "src": "6041:476:1", + "scope": 935, + "src": "6016:476:1", "stateMutability": "nonpayable", "superFunction": null, "visibility": "external" }, { "body": { - "id": 825, + "id": 840, "nodeType": "Block", - "src": "6937:219:1", + "src": "6912:219:1", "statements": [ { "assignments": [ - 797 + 812 ], "declarations": [ { "constant": false, - "id": 797, + "id": 812, "name": "c", "nodeType": "VariableDeclaration", - "scope": 825, - "src": "6947:22:1", + "scope": 840, + "src": "6922:22:1", "stateVariable": false, "storageLocation": "storage", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract" }, "typeName": { "contractScope": null, - "id": 796, + "id": 811, "name": "LockContract", "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 472, - "src": "6947:12:1", + "referencedDeclaration": 483, + "src": "6922:12:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract" } }, @@ -11683,31 +12118,31 @@ "visibility": "internal" } ], - "id": 801, + "id": 816, "initialValue": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 798, + "id": 813, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 639, - "src": "6972:9:1", + "referencedDeclaration": 652, + "src": "6947:9:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$472_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$483_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelockERC20.LockContract storage ref)" } }, - "id": 800, + "id": 815, "indexExpression": { "argumentTypes": null, - "id": 799, + "id": 814, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 785, - "src": "6982:11:1", + "referencedDeclaration": 800, + "src": "6957:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -11718,19 +12153,19 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "6972:22:1", + "src": "6947:22:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage", + "typeIdentifier": "t_struct$_LockContract_$483_storage", "typeString": "struct HashedTimelockERC20.LockContract storage ref" } }, "nodeType": "VariableDeclarationStatement", - "src": "6947:47:1" + "src": "6922:47:1" }, { "expression": { "argumentTypes": null, - "id": 806, + "id": 821, "isConstant": false, "isLValue": false, "isPure": false, @@ -11739,26 +12174,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 802, + "id": 817, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 797, - "src": "7004:1:1", + "referencedDeclaration": 812, + "src": "6979:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 804, + "id": 819, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "memberName": "refunded", "nodeType": "MemberAccess", - "referencedDeclaration": 469, - "src": "7004:10:1", + "referencedDeclaration": 480, + "src": "6979:10:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -11769,14 +12204,14 @@ "rightHandSide": { "argumentTypes": null, "hexValue": "74727565", - "id": 805, + "id": 820, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "7017:4:1", + "src": "6992:4:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -11784,15 +12219,15 @@ }, "value": "true" }, - "src": "7004:17:1", + "src": "6979:17:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "id": 807, + "id": 822, "nodeType": "ExpressionStatement", - "src": "7004:17:1" + "src": "6979:17:1" }, { "expression": { @@ -11802,26 +12237,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 813, + "id": 828, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 797, - "src": "7063:1:1", + "referencedDeclaration": 812, + "src": "7038:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 814, + "id": 829, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", - "referencedDeclaration": 455, - "src": "7063:8:1", + "referencedDeclaration": 466, + "src": "7038:8:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -11831,26 +12266,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 815, + "id": 830, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 797, - "src": "7073:1:1", + "referencedDeclaration": 812, + "src": "7048:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 816, + "id": 831, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "amount", "nodeType": "MemberAccess", - "referencedDeclaration": 461, - "src": "7073:8:1", + "referencedDeclaration": 472, + "src": "7048:8:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -11875,26 +12310,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 809, + "id": 824, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 797, - "src": "7037:1:1", + "referencedDeclaration": 812, + "src": "7012:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 810, + "id": 825, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "tokenContract", "nodeType": "MemberAccess", - "referencedDeclaration": 459, - "src": "7037:15:1", + "referencedDeclaration": 470, + "src": "7012:15:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -11908,18 +12343,18 @@ "typeString": "address" } ], - "id": 808, + "id": 823, "name": "ERC20", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1004, - "src": "7031:5:1", + "referencedDeclaration": 1552, + "src": "7006:5:1", "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_ERC20_$1004_$", + "typeIdentifier": "t_type$_t_contract$_ERC20_$1552_$", "typeString": "type(contract ERC20)" } }, - "id": 811, + "id": 826, "isConstant": false, "isLValue": false, "isPure": false, @@ -11927,27 +12362,27 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "7031:22:1", + "src": "7006:22:1", "typeDescriptions": { - "typeIdentifier": "t_contract$_ERC20_$1004", + "typeIdentifier": "t_contract$_ERC20_$1552", "typeString": "contract ERC20" } }, - "id": 812, + "id": 827, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "transfer", "nodeType": "MemberAccess", - "referencedDeclaration": 1027, - "src": "7031:31:1", + "referencedDeclaration": 1196, + "src": "7006:31:1", "typeDescriptions": { "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", "typeString": "function (address,uint256) external returns (bool)" } }, - "id": 817, + "id": 832, "isConstant": false, "isLValue": false, "isPure": false, @@ -11955,15 +12390,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "7031:51:1", + "src": "7006:51:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "id": 818, + "id": 833, "nodeType": "ExpressionStatement", - "src": "7031:51:1" + "src": "7006:51:1" }, { "eventCall": { @@ -11971,12 +12406,12 @@ "arguments": [ { "argumentTypes": null, - "id": 820, + "id": 835, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 785, - "src": "7116:11:1", + "referencedDeclaration": 800, + "src": "7091:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -11990,18 +12425,18 @@ "typeString": "bytes32" } ], - "id": 819, + "id": 834, "name": "LogHTLCERC20Refund", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 453, - "src": "7097:18:1", + "referencedDeclaration": 464, + "src": "7072:18:1", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$returns$__$", "typeString": "function (bytes32)" } }, - "id": 821, + "id": 836, "isConstant": false, "isLValue": false, "isPure": false, @@ -12009,28 +12444,28 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "7097:31:1", + "src": "7072:31:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 822, + "id": 837, "nodeType": "EmitStatement", - "src": "7092:36:1" + "src": "7067:36:1" }, { "expression": { "argumentTypes": null, "hexValue": "74727565", - "id": 823, + "id": 838, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "7145:4:1", + "src": "7120:4:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -12038,99 +12473,98 @@ }, "value": "true" }, - "functionReturnParameters": 795, - "id": 824, + "functionReturnParameters": 810, + "id": 839, "nodeType": "Return", - "src": "7138:11:1" + "src": "7113:11:1" } ] }, "documentation": "@dev Called by the sender if there was no withdraw AND the time lock has\nexpired. This will restore ownership of the tokens to the sender.\n * @param _contractId Id of HTLC to refund from.\n@return bool true on success", - "id": 826, + "id": 841, "implemented": true, - "isConstructor": false, - "isDeclaredConst": false, + "kind": "function", "modifiers": [ { "arguments": [ { "argumentTypes": null, - "id": 788, + "id": 803, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 785, - "src": "6865:11:1", + "referencedDeclaration": 800, + "src": "6840:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], - "id": 789, + "id": 804, "modifierName": { "argumentTypes": null, - "id": 787, + "id": 802, "name": "contractExists", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 528, - "src": "6850:14:1", + "referencedDeclaration": 541, + "src": "6825:14:1", "typeDescriptions": { "typeIdentifier": "t_modifier$_t_bytes32_$", "typeString": "modifier (bytes32)" } }, "nodeType": "ModifierInvocation", - "src": "6850:27:1" + "src": "6825:27:1" }, { "arguments": [ { "argumentTypes": null, - "id": 791, + "id": 806, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 785, - "src": "6897:11:1", + "referencedDeclaration": 800, + "src": "6872:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], - "id": 792, + "id": 807, "modifierName": { "argumentTypes": null, - "id": 790, + "id": 805, "name": "refundable", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 635, - "src": "6886:10:1", + "referencedDeclaration": 648, + "src": "6861:10:1", "typeDescriptions": { "typeIdentifier": "t_modifier$_t_bytes32_$", "typeString": "modifier (bytes32)" } }, "nodeType": "ModifierInvocation", - "src": "6886:23:1" + "src": "6861:23:1" } ], "name": "refund", "nodeType": "FunctionDefinition", "parameters": { - "id": 786, + "id": 801, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 785, + "id": 800, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 826, - "src": "6804:19:1", + "scope": 841, + "src": "6779:19:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -12138,10 +12572,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 784, + "id": 799, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "6804:7:1", + "src": "6779:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -12151,20 +12585,19 @@ "visibility": "internal" } ], - "src": "6803:21:1" + "src": "6778:21:1" }, - "payable": false, "returnParameters": { - "id": 795, + "id": 810, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 794, + "id": 809, "name": "", "nodeType": "VariableDeclaration", - "scope": 826, - "src": "6927:4:1", + "scope": 841, + "src": "6902:4:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -12172,10 +12605,10 @@ "typeString": "bool" }, "typeName": { - "id": 793, + "id": 808, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "6927:4:1", + "src": "6902:4:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -12185,19 +12618,19 @@ "visibility": "internal" } ], - "src": "6926:6:1" + "src": "6901:6:1" }, - "scope": 904, - "src": "6788:368:1", + "scope": 935, + "src": "6763:368:1", "stateMutability": "nonpayable", "superFunction": null, "visibility": "external" }, { "body": { - "id": 882, + "id": 913, "nodeType": "Block", - "src": "7690:377:1", + "src": "7665:440:1", "statements": [ { "condition": { @@ -12206,7 +12639,7 @@ "typeIdentifier": "t_bool", "typeString": "bool" }, - "id": 853, + "id": 868, "isConstant": false, "isLValue": false, "isPure": false, @@ -12216,12 +12649,12 @@ "arguments": [ { "argumentTypes": null, - "id": 850, + "id": 865, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 828, - "src": "7717:11:1", + "referencedDeclaration": 843, + "src": "7692:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -12235,18 +12668,18 @@ "typeString": "bytes32" } ], - "id": 849, + "id": 864, "name": "haveContract", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 903, - "src": "7704:12:1", + "referencedDeclaration": 934, + "src": "7679:12:1", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bool_$", "typeString": "function (bytes32) view returns (bool)" } }, - "id": 851, + "id": 866, "isConstant": false, "isLValue": false, "isPure": false, @@ -12254,7 +12687,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "7704:25:1", + "src": "7679:25:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -12265,14 +12698,14 @@ "rightExpression": { "argumentTypes": null, "hexValue": "66616c7365", - "id": 852, + "id": 867, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "7733:5:1", + "src": "7708:5:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -12280,51 +12713,343 @@ }, "value": "false" }, - "src": "7704:34:1", + "src": "7679:34:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, - "id": 855, + "id": 886, "nodeType": "IfStatement", - "src": "7700:59:1", + "src": "7675:121:1", "trueBody": { - "expression": null, - "functionReturnParameters": 848, - "id": 854, + "expression": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 870, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7743:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 869, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7735:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 871, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7735:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 873, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7755:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 872, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7747:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 874, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7747:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 876, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7767:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 875, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7759:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 877, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7759:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 878, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7771:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 879, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7774:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 880, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7777:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 881, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7780:5:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 882, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7787:5:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 883, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7794:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "id": 884, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "7734:62:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_address_payable_$_t_address_payable_$_t_address_payable_$_t_rational_0_by_1_$_t_rational_0_by_1_$_t_rational_0_by_1_$_t_bool_$_t_bool_$_t_rational_0_by_1_$", + "typeString": "tuple(address payable,address payable,address payable,int_const 0,int_const 0,int_const 0,bool,bool,int_const 0)" + } + }, + "functionReturnParameters": 863, + "id": 885, "nodeType": "Return", - "src": "7752:7:1" + "src": "7727:69:1" } }, { "assignments": [ - 857 + 888 ], "declarations": [ { "constant": false, - "id": 857, + "id": 888, "name": "c", "nodeType": "VariableDeclaration", - "scope": 882, - "src": "7768:22:1", + "scope": 913, + "src": "7806:22:1", "stateVariable": false, "storageLocation": "storage", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract" }, "typeName": { "contractScope": null, - "id": 856, + "id": 887, "name": "LockContract", "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 472, - "src": "7768:12:1", + "referencedDeclaration": 483, + "src": "7806:12:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract" } }, @@ -12332,31 +13057,31 @@ "visibility": "internal" } ], - "id": 861, + "id": 892, "initialValue": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 858, + "id": 889, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 639, - "src": "7793:9:1", + "referencedDeclaration": 652, + "src": "7831:9:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$472_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$483_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelockERC20.LockContract storage ref)" } }, - "id": 860, + "id": 891, "indexExpression": { "argumentTypes": null, - "id": 859, + "id": 890, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 828, - "src": "7803:11:1", + "referencedDeclaration": 843, + "src": "7841:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -12367,14 +13092,14 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "7793:22:1", + "src": "7831:22:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage", + "typeIdentifier": "t_struct$_LockContract_$483_storage", "typeString": "struct HashedTimelockERC20.LockContract storage ref" } }, "nodeType": "VariableDeclarationStatement", - "src": "7768:47:1" + "src": "7806:47:1" }, { "expression": { @@ -12384,26 +13109,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 862, + "id": 893, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 857, - "src": "7846:1:1", + "referencedDeclaration": 888, + "src": "7884:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 863, + "id": 894, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", - "referencedDeclaration": 455, - "src": "7846:8:1", + "referencedDeclaration": 466, + "src": "7884:8:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -12413,26 +13138,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 864, + "id": 895, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 857, - "src": "7868:1:1", + "referencedDeclaration": 888, + "src": "7906:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 865, + "id": 896, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "receiver", "nodeType": "MemberAccess", - "referencedDeclaration": 457, - "src": "7868:10:1", + "referencedDeclaration": 468, + "src": "7906:10:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -12442,26 +13167,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 866, + "id": 897, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 857, - "src": "7892:1:1", + "referencedDeclaration": 888, + "src": "7930:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 867, + "id": 898, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "tokenContract", "nodeType": "MemberAccess", - "referencedDeclaration": 459, - "src": "7892:15:1", + "referencedDeclaration": 470, + "src": "7930:15:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -12471,26 +13196,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 868, + "id": 899, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 857, - "src": "7921:1:1", + "referencedDeclaration": 888, + "src": "7959:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 869, + "id": 900, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "amount", "nodeType": "MemberAccess", - "referencedDeclaration": 461, - "src": "7921:8:1", + "referencedDeclaration": 472, + "src": "7959:8:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -12500,26 +13225,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 870, + "id": 901, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 857, - "src": "7943:1:1", + "referencedDeclaration": 888, + "src": "7981:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 871, + "id": 902, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "hashlock", "nodeType": "MemberAccess", - "referencedDeclaration": 463, - "src": "7943:10:1", + "referencedDeclaration": 474, + "src": "7981:10:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -12529,26 +13254,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 872, + "id": 903, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 857, - "src": "7967:1:1", + "referencedDeclaration": 888, + "src": "8005:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 873, + "id": 904, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "timelock", "nodeType": "MemberAccess", - "referencedDeclaration": 465, - "src": "7967:10:1", + "referencedDeclaration": 476, + "src": "8005:10:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -12558,26 +13283,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 874, + "id": 905, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 857, - "src": "7991:1:1", + "referencedDeclaration": 888, + "src": "8029:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 875, + "id": 906, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "withdrawn", "nodeType": "MemberAccess", - "referencedDeclaration": 467, - "src": "7991:11:1", + "referencedDeclaration": 478, + "src": "8029:11:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -12587,26 +13312,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 876, + "id": 907, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 857, - "src": "8016:1:1", + "referencedDeclaration": 888, + "src": "8054:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 877, + "id": 908, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "refunded", "nodeType": "MemberAccess", - "referencedDeclaration": 469, - "src": "8016:10:1", + "referencedDeclaration": 480, + "src": "8054:10:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -12616,71 +13341,70 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 878, + "id": 909, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 857, - "src": "8040:1:1", + "referencedDeclaration": 888, + "src": "8078:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage_ptr", + "typeIdentifier": "t_struct$_LockContract_$483_storage_ptr", "typeString": "struct HashedTimelockERC20.LockContract storage pointer" } }, - "id": 879, + "id": 910, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "preimage", "nodeType": "MemberAccess", - "referencedDeclaration": 471, - "src": "8040:10:1", + "referencedDeclaration": 482, + "src": "8078:10:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], - "id": 880, + "id": 911, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", - "src": "7832:228:1", + "src": "7870:228:1", "typeDescriptions": { "typeIdentifier": "t_tuple$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_bytes32_$_t_uint256_$_t_bool_$_t_bool_$_t_bytes32_$", "typeString": "tuple(address,address,address,uint256,bytes32,uint256,bool,bool,bytes32)" } }, - "functionReturnParameters": 848, - "id": 881, + "functionReturnParameters": 863, + "id": 912, "nodeType": "Return", - "src": "7825:235:1" + "src": "7863:235:1" } ] }, "documentation": "@dev Get contract details.\n@param _contractId HTLC contract id\n@return All parameters in struct LockContract for _contractId HTLC", - "id": 883, + "id": 914, "implemented": true, - "isConstructor": false, - "isDeclaredConst": true, + "kind": "function", "modifiers": [], "name": "getContract", "nodeType": "FunctionDefinition", "parameters": { - "id": 829, + "id": 844, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 828, + "id": 843, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 883, - "src": "7350:19:1", + "scope": 914, + "src": "7325:19:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -12688,10 +13412,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 827, + "id": 842, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "7350:7:1", + "src": "7325:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -12701,20 +13425,19 @@ "visibility": "internal" } ], - "src": "7349:21:1" + "src": "7324:21:1" }, - "payable": false, "returnParameters": { - "id": 848, + "id": 863, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 831, + "id": 846, "name": "sender", "nodeType": "VariableDeclaration", - "scope": 883, - "src": "7429:14:1", + "scope": 914, + "src": "7404:14:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -12722,10 +13445,11 @@ "typeString": "address" }, "typeName": { - "id": 830, + "id": 845, "name": "address", "nodeType": "ElementaryTypeName", - "src": "7429:7:1", + "src": "7404:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -12736,11 +13460,11 @@ }, { "constant": false, - "id": 833, + "id": 848, "name": "receiver", "nodeType": "VariableDeclaration", - "scope": 883, - "src": "7457:16:1", + "scope": 914, + "src": "7432:16:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -12748,10 +13472,11 @@ "typeString": "address" }, "typeName": { - "id": 832, + "id": 847, "name": "address", "nodeType": "ElementaryTypeName", - "src": "7457:7:1", + "src": "7432:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -12762,11 +13487,11 @@ }, { "constant": false, - "id": 835, + "id": 850, "name": "tokenContract", "nodeType": "VariableDeclaration", - "scope": 883, - "src": "7487:21:1", + "scope": 914, + "src": "7462:21:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -12774,10 +13499,11 @@ "typeString": "address" }, "typeName": { - "id": 834, + "id": 849, "name": "address", "nodeType": "ElementaryTypeName", - "src": "7487:7:1", + "src": "7462:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -12788,11 +13514,11 @@ }, { "constant": false, - "id": 837, + "id": 852, "name": "amount", "nodeType": "VariableDeclaration", - "scope": 883, - "src": "7522:11:1", + "scope": 914, + "src": "7497:11:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -12800,10 +13526,10 @@ "typeString": "uint256" }, "typeName": { - "id": 836, + "id": 851, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "7522:4:1", + "src": "7497:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -12814,11 +13540,11 @@ }, { "constant": false, - "id": 839, + "id": 854, "name": "hashlock", "nodeType": "VariableDeclaration", - "scope": 883, - "src": "7547:16:1", + "scope": 914, + "src": "7522:16:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -12826,10 +13552,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 838, + "id": 853, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "7547:7:1", + "src": "7522:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -12840,11 +13566,11 @@ }, { "constant": false, - "id": 841, + "id": 856, "name": "timelock", "nodeType": "VariableDeclaration", - "scope": 883, - "src": "7577:13:1", + "scope": 914, + "src": "7552:13:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -12852,10 +13578,10 @@ "typeString": "uint256" }, "typeName": { - "id": 840, + "id": 855, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "7577:4:1", + "src": "7552:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -12866,11 +13592,11 @@ }, { "constant": false, - "id": 843, + "id": 858, "name": "withdrawn", "nodeType": "VariableDeclaration", - "scope": 883, - "src": "7604:14:1", + "scope": 914, + "src": "7579:14:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -12878,10 +13604,10 @@ "typeString": "bool" }, "typeName": { - "id": 842, + "id": 857, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "7604:4:1", + "src": "7579:4:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -12892,11 +13618,11 @@ }, { "constant": false, - "id": 845, + "id": 860, "name": "refunded", "nodeType": "VariableDeclaration", - "scope": 883, - "src": "7632:13:1", + "scope": 914, + "src": "7607:13:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -12904,10 +13630,10 @@ "typeString": "bool" }, "typeName": { - "id": 844, + "id": 859, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "7632:4:1", + "src": "7607:4:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -12918,11 +13644,11 @@ }, { "constant": false, - "id": 847, + "id": 862, "name": "preimage", "nodeType": "VariableDeclaration", - "scope": 883, - "src": "7659:16:1", + "scope": 914, + "src": "7634:16:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -12930,10 +13656,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 846, + "id": 861, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "7659:7:1", + "src": "7634:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -12943,36 +13669,36 @@ "visibility": "internal" } ], - "src": "7415:270:1" + "src": "7390:270:1" }, - "scope": 904, - "src": "7329:738:1", + "scope": 935, + "src": "7304:801:1", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { - "id": 902, + "id": 933, "nodeType": "Block", - "src": "8302:71:1", + "src": "8340:71:1", "statements": [ { "expression": { "argumentTypes": null, - "id": 900, + "id": 931, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, - "id": 890, + "id": 921, "name": "exists", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 888, - "src": "8312:6:1", + "referencedDeclaration": 919, + "src": "8350:6:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -12989,7 +13715,7 @@ "typeIdentifier": "t_address", "typeString": "address" }, - "id": 898, + "id": 929, "isConstant": false, "isLValue": false, "isPure": false, @@ -13000,26 +13726,26 @@ "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 891, + "id": 922, "name": "contracts", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 639, - "src": "8322:9:1", + "referencedDeclaration": 652, + "src": "8360:9:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$472_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_LockContract_$483_storage_$", "typeString": "mapping(bytes32 => struct HashedTimelockERC20.LockContract storage ref)" } }, - "id": 893, + "id": 924, "indexExpression": { "argumentTypes": null, - "id": 892, + "id": 923, "name": "_contractId", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 885, - "src": "8332:11:1", + "referencedDeclaration": 916, + "src": "8370:11:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -13030,21 +13756,21 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "8322:22:1", + "src": "8360:22:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_LockContract_$472_storage", + "typeIdentifier": "t_struct$_LockContract_$483_storage", "typeString": "struct HashedTimelockERC20.LockContract storage ref" } }, - "id": 894, + "id": 925, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", - "referencedDeclaration": 455, - "src": "8322:29:1", + "referencedDeclaration": 466, + "src": "8360:29:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -13058,14 +13784,14 @@ { "argumentTypes": null, "hexValue": "30", - "id": 896, + "id": 927, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "8363:1:1", + "src": "8401:1:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", @@ -13081,20 +13807,20 @@ "typeString": "int_const 0" } ], - "id": 895, + "id": 926, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", - "src": "8355:7:1", + "src": "8393:7:1", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, - "id": 897, + "id": 928, "isConstant": false, "isLValue": false, "isPure": true, @@ -13102,63 +13828,62 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "8355:10:1", + "src": "8393:10:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, - "src": "8322:43:1", + "src": "8360:43:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], - "id": 899, + "id": 930, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", - "src": "8321:45:1", + "src": "8359:45:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "src": "8312:54:1", + "src": "8350:54:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "id": 901, + "id": 932, "nodeType": "ExpressionStatement", - "src": "8312:54:1" + "src": "8350:54:1" } ] }, "documentation": "@dev Is there a contract with id _contractId.\n@param _contractId Id into contracts mapping.", - "id": 903, + "id": 934, "implemented": true, - "isConstructor": false, - "isDeclaredConst": true, + "kind": "function", "modifiers": [], "name": "haveContract", "nodeType": "FunctionDefinition", "parameters": { - "id": 886, + "id": 917, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 885, + "id": 916, "name": "_contractId", "nodeType": "VariableDeclaration", - "scope": 903, - "src": "8217:19:1", + "scope": 934, + "src": "8255:19:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -13166,10 +13891,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 884, + "id": 915, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "8217:7:1", + "src": "8255:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -13179,20 +13904,19 @@ "visibility": "internal" } ], - "src": "8216:21:1" + "src": "8254:21:1" }, - "payable": false, "returnParameters": { - "id": 889, + "id": 920, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 888, + "id": 919, "name": "exists", "nodeType": "VariableDeclaration", - "scope": 903, - "src": "8285:11:1", + "scope": 934, + "src": "8323:11:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -13200,10 +13924,10 @@ "typeString": "bool" }, "typeName": { - "id": 887, + "id": 918, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "8285:4:1", + "src": "8323:4:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -13213,26 +13937,67 @@ "visibility": "internal" } ], - "src": "8284:13:1" + "src": "8322:13:1" }, - "scope": 904, - "src": "8195:178:1", + "scope": 935, + "src": "8233:178:1", "stateMutability": "view", "superFunction": null, "visibility": "internal" } ], - "scope": 905, - "src": "948:7428:1" + "scope": 936, + "src": "917:7497:1" } ], - "src": "0:8377:1" + "src": "0:8415:1" }, "compiler": { "name": "solc", - "version": "0.4.24+commit.e67f0147.Emscripten.clang" + "version": "0.5.0+commit.1d4f565a.Emscripten.clang" }, "networks": {}, - "schemaVersion": "2.0.0", - "updatedAt": "2018-06-06T05:18:47.594Z" + "schemaVersion": "3.0.1", + "updatedAt": "2019-02-09T05:41:13.723Z", + "devdoc": { + "methods": { + "getContract(bytes32)": { + "details": "Get contract details.", + "params": { + "_contractId": "HTLC contract id" + }, + "return": "All parameters in struct LockContract for _contractId HTLC" + }, + "newContract(address,bytes32,uint256,address,uint256)": { + "details": "Sender / Payer sets up a new hash time lock contract depositing the funds and providing the reciever and terms. * NOTE: _receiver must first call approve() on the token contract. See allowance check in tokensTransferable modifier.", + "params": { + "_amount": "Amount of the token to lock up.", + "_hashlock": "A sha-2 sha256 hash hashlock.", + "_receiver": "Receiver of the tokens.", + "_timelock": "UNIX epoch seconds time that the lock expires at. Refunds can be made after this time.", + "_tokenContract": "ERC20 Token contract address." + }, + "return": "contractId Id of the new HTLC. This is needed for subsequent calls." + }, + "refund(bytes32)": { + "details": "Called by the sender if there was no withdraw AND the time lock has expired. This will restore ownership of the tokens to the sender.", + "params": { + "_contractId": "Id of HTLC to refund from." + }, + "return": "bool true on success" + }, + "withdraw(bytes32,bytes32)": { + "details": "Called by the receiver once they know the preimage of the hashlock. This will transfer ownership of the locked tokens to their address.", + "params": { + "_contractId": "Id of the HTLC.", + "_preimage": "sha256(_preimage) should equal the contract hashlock." + }, + "return": "bool true on success" + } + }, + "title": "Hashed Timelock Contracts (HTLCs) on Ethereum ERC20 tokens. * This contract provides a way to create and keep HTLCs for ERC20 tokens. * See HashedTimelock.sol for a contract that provides the same functions for the native ETH token. * Protocol: * 1) newContract(receiver, hashlock, timelock, tokenContract, amount) - a sender calls this to create a new HTLC on a given token (tokenContract) for a given amount. A 32 byte contract id is returned 2) withdraw(contractId, preimage) - once the receiver knows the preimage of the hashlock hash they can claim the tokens with this function 3) refund() - after timelock has expired and if the receiver did not withdraw the tokens the sender / creater of the HTLC can get their tokens back with this function." + }, + "userdoc": { + "methods": {} + } } \ No newline at end of file diff --git a/config.example.js b/config.example.js new file mode 100644 index 0000000..2eaa67a --- /dev/null +++ b/config.example.js @@ -0,0 +1,15 @@ +module.exports = { + ownerAccount: { + kovan: "", + rinkeby: "", + infura: "" + }, + infura: { + apikey: "", + mnemonics: { + kovan: "", + rinkeby: "", + ropsten: "" + } + } +} diff --git a/deployment.json b/deployment.json index 9441e1d..32199e2 100644 --- a/deployment.json +++ b/deployment.json @@ -1,12 +1,12 @@ { "htlc": { - "kovan": "0xc3ed16874bc9551b079c135eb27b10ee1348ac12", - "ropsten": "0xbb6883511ff318ba85b5745fb1a6083537bf914c", + "kovan": "0xe196bb1e25483ed771b6691929d47943023c26fe", + "ropsten": "0x243785f6b65418191ea20b45fde7069ffe4f8cef", "testrpc": "0x345ca3e014aaf5dca488057592ee47305d9b3e10" }, "htlcERC20": { - "kovan": "0xfD4BEbA807E89E2cA209cd53c28471840446ddf2", - "ropsten": "0x6879e090240358f59fc5d212f87da63d3288749b", + "kovan": "0x763eedd3c04a9a2fca67ac51fc16e394472f29a2", + "ropsten": "0x16b6fabc530c7bfde69eafd9e271fb610e3fc3f7", "testrpc": "0xf25186b5081ff5ce73482ad761db0eb0d25abfbf" } } diff --git a/package-lock.json b/package-lock.json index 3d36032..a20cf60 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,9 +1,96 @@ { "name": "ethereum-htlc", - "version": "0.0.7", + "version": "0.0.8", "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/code-frame": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", + "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/highlight": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", + "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "acorn": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.0.tgz", + "integrity": "sha512-MW/FjM+IvU9CgBzjO3UIPCE2pyEwUsoFl+VGdczOPEdxfGFjuKny/gN54mOuX7Qxmb9Rg9MCn2oKiSUeW+pjrw==", + "dev": true + }, + "acorn-jsx": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.1.tgz", + "integrity": "sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg==", + "dev": true + }, + "ajv": { + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.8.1.tgz", + "integrity": "sha512-eqxCp82P+JfqL683wwsL73XmFs1eG6qjw+RD3YHx+Jll1r0jNd4dh8QG9NYAeNGA/hnZjeEDgtTskgJULbxpWQ==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "dev": true + }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", @@ -14,6 +101,27 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" }, + "any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, "babel-code-frame": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", @@ -603,6 +711,15 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, + "bindings": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.4.0.tgz", + "integrity": "sha512-7znEVX22Djn+nYjxCWKDne0RRloa9XfYa84yk3s+HkE3LpDYZmhArYr9O9huBoHY3/oXispx5LorIX7Sl2CgSQ==", + "dev": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, "bluebird": { "version": "3.5.1", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", @@ -627,6 +744,12 @@ "electron-to-chromium": "^1.3.47" } }, + "callsites": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.0.0.tgz", + "integrity": "sha512-tWnkwu9YEq2uzlBDI4RcLn8jrFvF9AOi8PxDNU3hZZjJcjkcRAq3vCI+vZcg1SuxISDYe86k9VZFwAxDiJGoAw==", + "dev": true + }, "caniuse-lite": { "version": "1.0.30000849", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000849.tgz", @@ -644,6 +767,48 @@ "supports-color": "^2.0.0" } }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, + "circular-json": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "dev": true + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -654,6 +819,19 @@ "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.1.tgz", "integrity": "sha1-rmh03GaTd4m4B1T/VCjfZoGcpQs=" }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -662,6 +840,12 @@ "ms": "2.0.0" } }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, "detect-indent": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", @@ -670,6 +854,15 @@ "repeating": "^2.0.0" } }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, "electron-to-chromium": { "version": "1.3.48", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.48.tgz", @@ -680,16 +873,294 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, + "eslint": { + "version": "5.13.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.13.0.tgz", + "integrity": "sha512-nqD5WQMisciZC5EHZowejLKQjWGuFS5c70fxqSKlnDME+oz9zmE8KTlX+lHSg+/5wsC/kf9Q9eMkC8qS3oM2fg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.5.3", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^2.1.0", + "eslint-scope": "^4.0.0", + "eslint-utils": "^1.3.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^5.0.0", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^2.0.0", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.7.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^6.1.0", + "js-yaml": "^3.12.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.5", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.2", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^5.5.1", + "strip-ansi": "^4.0.0", + "strip-json-comments": "^2.0.1", + "table": "^5.0.2", + "text-table": "^0.2.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "globals": { + "version": "11.10.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.10.0.tgz", + "integrity": "sha512-0GZF1RiPKU97IHUO5TORo9w1PwrH/NBPl+fS7oMLdaTRiYmYbwK4NWoZWrAdd0/abG9R2BU+OiwyQpTpE6pdfQ==", + "dev": true + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "eslint-scope": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", + "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz", + "integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==", + "dev": true + }, + "eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "dev": true + }, + "espree": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.0.tgz", + "integrity": "sha512-1MpUfwsdS9MMoN7ZXqAr9e9UKdVHDcvrJpyx7mm1WuQlx/ygErEQBzgi5Nh5qBHIoYweprhtMkTCb9GhcAIcsA==", + "dev": true, + "requires": { + "acorn": "^6.0.2", + "acorn-jsx": "^5.0.0", + "eslint-visitor-keys": "^1.0.0" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "dev": true, + "requires": { + "estraverse": "^4.0.0" + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "^4.1.0" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, "esutils": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" }, + "external-editor": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz", + "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", + "dev": true, + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-entry-cache": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", + "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "dev": true, + "requires": { + "flat-cache": "^1.2.1", + "object-assign": "^4.0.1" + } + }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true + }, + "flat-cache": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz", + "integrity": "sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg==", + "dev": true, + "requires": { + "circular-json": "^0.3.1", + "graceful-fs": "^4.1.2", + "rimraf": "~2.6.2", + "write": "^0.2.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, "globals": { "version": "9.18.0", "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==" }, + "graceful-fs": { + "version": "4.1.15", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", + "dev": true + }, "has-ansi": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", @@ -698,6 +1169,12 @@ "ansi-regex": "^2.0.0" } }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, "home-or-tmp": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", @@ -707,6 +1184,126 @@ "os-tmpdir": "^1.0.1" } }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "import-fresh": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.0.0.tgz", + "integrity": "sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "inquirer": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.2.tgz", + "integrity": "sha512-Z2rREiXA6cHRR9KBOarR3WuLlFzlIfAEIiB45ll5SSadMg7WqOh1MKEjjndfuH5ewXdixWCxqnVfGOQzPeiztA==", + "dev": true, + "requires": { + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^2.0.0", + "lodash": "^4.17.11", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.4.0", + "string-width": "^2.1.0", + "strip-ansi": "^5.0.0", + "through": "^2.3.6" + }, + "dependencies": { + "ansi-regex": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.0.0.tgz", + "integrity": "sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, + "strip-ansi": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.0.0.tgz", + "integrity": "sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow==", + "dev": true, + "requires": { + "ansi-regex": "^4.0.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "invariant": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz", @@ -723,21 +1320,77 @@ "number-is-nan": "^1.0.0" } }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, "js-tokens": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" }, + "js-yaml": { + "version": "3.12.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.1.tgz", + "integrity": "sha512-um46hB9wNOKlwkHgiuyEVAybXBjwFUV0Z/RaHJblRd9DXltue9FTYvzCr9ErQrK9Adz5MU4gHWVaNUfdmrC8qA==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, "jsesc": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=" }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, "json5": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=" }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, "lodash": { "version": "4.17.10", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", @@ -751,6 +1404,12 @@ "js-tokens": "^3.0.0" } }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -777,16 +1436,78 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "nan": { + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz", + "integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, "openzeppelin-solidity": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/openzeppelin-solidity/-/openzeppelin-solidity-2.1.2.tgz", "integrity": "sha512-1ggh+AZFpMAgGfgnVMQ8dwYawjD2QN4xuWkQS4FUbeUz1fnCKJpguUl2cyadyfDYjBq1XJ6MA6VkzYpTZtJMqw==" }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" + } + }, "os-homedir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", @@ -797,16 +1518,55 @@ "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" }, + "parent-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.0.tgz", + "integrity": "sha512-8Mf5juOMmiE4FcmzYc4IaiS9L3+9paz2KOiXzkRviCP6aDmN49Hz6EMWz0lGNp9pX80GvvAuLADtyGfW/Em3TA==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, "private": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==" }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, "regenerate": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", @@ -827,6 +1587,12 @@ "private": "^0.1.6" } }, + "regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "dev": true + }, "regexpu-core": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", @@ -865,16 +1631,108 @@ "is-finite": "^1.0.0" } }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "^2.1.0" + } + }, + "rxjs": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.4.0.tgz", + "integrity": "sha512-Z9Yfa11F6B9Sg/BK9MnqnQ+aQYicPLtilXBp2yUtDt2JRCE0h26d33EnfO3ZxoNxG0T92OUucP3Ct7cpfkdFfw==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, "semver": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==" }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, "slash": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=" }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + } + } + }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -888,6 +1746,39 @@ "source-map": "^0.5.6" } }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", @@ -896,11 +1787,58 @@ "ansi-regex": "^2.0.0" } }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" }, + "table": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/table/-/table-5.2.2.tgz", + "integrity": "sha512-f8mJmuu9beQEDkKHLzOv4VxVYlU68NpdzjbGPl69i4Hx0sTopJuNxuzJd17iV2h24dAfa93u794OnDA5jqXvfQ==", + "dev": true, + "requires": { + "ajv": "^6.6.1", + "lodash": "^4.17.11", + "slice-ansi": "^2.0.0", + "string-width": "^2.1.1" + }, + "dependencies": { + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, "to-fast-properties": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", @@ -910,6 +1848,98 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=" + }, + "truffle-hdwallet-provider": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/truffle-hdwallet-provider/-/truffle-hdwallet-provider-1.0.3.tgz", + "integrity": "sha512-Lm4MrXHnWg8wHNUoumUBc8AhlCBg05x7wZA81JOFfO0j3QU53A/hhSfV7v8gANbRsvpF5Su0s3SNQGJjewtnYw==", + "dev": true, + "requires": { + "any-promise": "^1.3.0", + "bindings": "^1.3.1", + "websocket": "^1.0.28" + } + }, + "tslib": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", + "dev": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "requires": { + "is-typedarray": "^1.0.0" + } + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "websocket": { + "version": "1.0.28", + "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.28.tgz", + "integrity": "sha512-00y/20/80P7H4bCYkzuuvvfDvh+dgtXi5kzDf3UcZwN6boTYaKvsrtZ5lIYm1Gsg48siMErd9M4zjSYfYFHTrA==", + "dev": true, + "requires": { + "debug": "^2.2.0", + "nan": "^2.11.0", + "typedarray-to-buffer": "^3.1.5", + "yaeti": "^0.0.6" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } + }, + "yaeti": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", + "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=", + "dev": true } } } diff --git a/package.json b/package.json index f667fbf..3ffb221 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ethereum-htlc", - "version": "0.0.7", + "version": "0.0.8", "description": "Hashed Timelock Contracts for Ethereum", "main": "truffle.js", "license": "GPL-3.0", @@ -13,8 +13,10 @@ "test": "test" }, "scripts": { + "deploy-kovan-infura": "npm run prepare && truffle migrate --network kovaninfura", + "deploy-ropsten-infura": "npm run prepare && truffle migrate --network ropsteninfura", + "deploy-rinkeby-infura": "npm run prepare && truffle migrate --network rinkebyinfura", "deploy-kovan": "npm run prepare && truffle migrate --network kovan", - "deploy-ropsten": "npm run prepare && truffle migrate --network ropsten", "prepare": "npm run publish-abi && npm run test", "prepublish": "npm run publish-abi", "publish-abi": "rm -rf build/ && truffle compile && cp build/contracts/HashedTimelock*.json abi/", @@ -34,6 +36,8 @@ "openzeppelin-solidity": "^2.1.2" }, "devDependencies": { - "bluebird": "^3.5.1" + "bluebird": "^3.5.1", + "eslint": "^5.13.0", + "truffle-hdwallet-provider": "^1.0.3" } } diff --git a/truffle.js b/truffle.js index 57354e2..85aa583 100644 --- a/truffle.js +++ b/truffle.js @@ -1,33 +1,56 @@ -require('babel-register') -require('babel-polyfill') +require("babel-register") +require("babel-polyfill") -const defaultGasLimit = 1200000 // enough for largest contract HashedTimelockERC20 -const ownerAccount = '0x62d5391445c0c843580b92705b84852b9edb813b' +const { existsSync } = require("fs") +const HDWalletProvider = require("truffle-hdwallet-provider") + +const configFilePath = "./config.js" +if (!existsSync(configFilePath)) { + console.error( + `config.js does not exist. Create it using the template config.example.js.` + ) + process.exit(-1) +} +const config = require(configFilePath) + +const oneGwei = 1000000000 +const defaultGasLimit = 1600000 // enough for largest contract HashedTimelockERC20 + +const infuraConfig = (network, networkId, gasPrice = oneGwei) => { + return { + provider: function() { + return new HDWalletProvider( + config.infura.mnemonics[network], + `https://${network}.infura.io/v3/${config.infura.apikey}`, + 0, + 5 + ) + }, + network_id: networkId, + from: config.ownerAccount[network], + gas: defaultGasLimit, + gasPrice + } +} module.exports = { networks: { develop: { - host: 'localhost', + host: "localhost", port: 8545, - network_id: '*', + network_id: "*" }, + kovaninfura: infuraConfig("kovan", 42, oneGwei * 2), + ropsteninfura: infuraConfig("ropsten", 3), + rinkebyinfura: infuraConfig("rinkeby", 4), kovan: { // use --geth mode for Parity or this will fail (see https://github.com/paritytech/parity/issues/5538) - host: '0.0.0.0', // Local Parity Docker container + host: "0.0.0.0", // Local Parity Docker container port: 8545, network_id: 42, - from: ownerAccount, + from: config.ownerAccount.kovan, gas: defaultGasLimit, - gasPrice: 2000000000, // 2 shannon/gwei - }, - ropsten: { - // use --geth mode for Parity or this will fail (see https://github.com/paritytech/parity/issues/5538) - host: '0.0.0.0', // Local Parity Docker container - port: 8545, - network_id: 3, - from: ownerAccount, - gas: defaultGasLimit, - gasPrice: 8000000000, // 8 shannon/gwei - }, - }, + gasPrice: oneGwei * 2 + } + } }