From 532d22912c5cc503cf658cd192b1a95633879f4c Mon Sep 17 00:00:00 2001 From: Glen De Cauwsemaecker Date: Mon, 5 Mar 2018 22:48:40 +0100 Subject: [PATCH] replace RIP160 with SHA256 --- abi/atomicswap.json | 16 +- build/contracts/AtomicSwap.json | 11947 +++++++++++++++++++++++++++++- build/contracts/Migrations.json | 1344 +++- cmd/generateSecret.js | 6 +- contracts/AtomicSwap.sol | 142 +- contracts/Migrations.sol | 11 +- modules/common.js | 4 +- package-lock.json | 77 +- package.json | 2 - 9 files changed, 13320 insertions(+), 229 deletions(-) diff --git a/abi/atomicswap.json b/abi/atomicswap.json index d7601ec..4ffdbec 100644 --- a/abi/atomicswap.json +++ b/abi/atomicswap.json @@ -8,7 +8,7 @@ }, { "name": "_hashedSecret", - "type": "bytes20" + "type": "bytes32" }, { "name": "_initiator", @@ -25,7 +25,7 @@ "inputs": [ { "name": "_hashedSecret", - "type": "bytes20" + "type": "bytes32" } ], "name": "refund", @@ -42,7 +42,7 @@ }, { "name": "_hashedSecret", - "type": "bytes20" + "type": "bytes32" } ], "name": "redeem", @@ -59,7 +59,7 @@ }, { "name": "_hashedSecret", - "type": "bytes20" + "type": "bytes32" }, { "name": "_participant", @@ -76,7 +76,7 @@ "inputs": [ { "name": "", - "type": "bytes20" + "type": "bytes32" } ], "name": "swaps", @@ -91,7 +91,7 @@ }, { "name": "hashedSecret", - "type": "bytes20" + "type": "bytes32" }, { "name": "secret", @@ -166,7 +166,7 @@ { "indexed": false, "name": "_hashedSecret", - "type": "bytes20" + "type": "bytes32" }, { "indexed": false, @@ -193,7 +193,7 @@ { "indexed": false, "name": "_hashedSecret", - "type": "bytes20" + "type": "bytes32" }, { "indexed": false, diff --git a/build/contracts/AtomicSwap.json b/build/contracts/AtomicSwap.json index d28721c..026871d 100644 --- a/build/contracts/AtomicSwap.json +++ b/build/contracts/AtomicSwap.json @@ -1,84 +1,12 @@ { - "contract_name": "AtomicSwap", + "contractName": "AtomicSwap", "abi": [ - { - "constant": false, - "inputs": [ - { - "name": "_refundTime", - "type": "uint256" - }, - { - "name": "_hashedSecret", - "type": "bytes20" - }, - { - "name": "_initiator", - "type": "address" - } - ], - "name": "participate", - "outputs": [], - "payable": true, - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_hashedSecret", - "type": "bytes20" - } - ], - "name": "refund", - "outputs": [], - "payable": false, - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_secret", - "type": "bytes32" - }, - { - "name": "_hashedSecret", - "type": "bytes20" - } - ], - "name": "redeem", - "outputs": [], - "payable": false, - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_refundTime", - "type": "uint256" - }, - { - "name": "_hashedSecret", - "type": "bytes20" - }, - { - "name": "_participant", - "type": "address" - } - ], - "name": "initiate", - "outputs": [], - "payable": true, - "type": "function" - }, { "constant": true, "inputs": [ { "name": "", - "type": "bytes20" + "type": "bytes32" } ], "name": "swaps", @@ -93,7 +21,7 @@ }, { "name": "hashedSecret", - "type": "bytes20" + "type": "bytes32" }, { "name": "secret", @@ -121,11 +49,13 @@ } ], "payable": false, + "stateMutability": "view", "type": "function" }, { "inputs": [], "payable": false, + "stateMutability": "nonpayable", "type": "constructor" }, { @@ -168,7 +98,7 @@ { "indexed": false, "name": "_hashedSecret", - "type": "bytes20" + "type": "bytes32" }, { "indexed": false, @@ -195,7 +125,7 @@ { "indexed": false, "name": "_hashedSecret", - "type": "bytes20" + "type": "bytes32" }, { "indexed": false, @@ -215,10 +145,11867 @@ ], "name": "Initiated", "type": "event" + }, + { + "constant": false, + "inputs": [ + { + "name": "_refundTime", + "type": "uint256" + }, + { + "name": "_hashedSecret", + "type": "bytes32" + }, + { + "name": "_participant", + "type": "address" + } + ], + "name": "initiate", + "outputs": [], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_refundTime", + "type": "uint256" + }, + { + "name": "_hashedSecret", + "type": "bytes32" + }, + { + "name": "_initiator", + "type": "address" + } + ], + "name": "participate", + "outputs": [], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_secret", + "type": "bytes32" + }, + { + "name": "_hashedSecret", + "type": "bytes32" + } + ], + "name": "redeem", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_hashedSecret", + "type": "bytes32" + } + ], + "name": "refund", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" } ], - "unlinked_binary": "0x6060604052341561000f57600080fd5b5b5b5b61093a806100216000396000f300606060405263ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166327f10ee081146100695780635a8f9b811461008f5780637ec27ba1146100b1578063eb8ae1ed146100d6578063f325cc91146100fc575b600080fd5b61008d6004356001606060020a031960243516600160a060020a0360443516610193565b005b341561009a57600080fd5b61008d6001606060020a0319600435166102dc565b005b34156100bc57600080fd5b61008d6004356001606060020a0319602435166104ba565b005b61008d6004356001606060020a031960243516600160a060020a0360443516610727565b005b341561010757600080fd5b61011c6001606060020a0319600435166108a2565b604051898152602081018990526001606060020a03198816604082015260608101879052600160a060020a038087166080830152851660a082015260c0810184905282151560e0820152610100810182600281111561017757fe5b60ff168152602001995050505050505050505060405180910390f35b8160005b6001606060020a03198216600090815260208190526040902060070154610100900460ff1660028111156101c757fe5b146101d157600080fd5b6001606060020a03198316600090815260208190526040902060018101859055428155600581018054600160a060020a0333811673ffffffffffffffffffffffffffffffffffffffff199283161790925560048301805492861692821692909217909155346006830155600280830180546c0100000000000000000000000088049316929092179091556007909101805461ff001916610100835b02179055507fd2ae53b489af667edae5247fc948af6bab36cb0ec684fb14cc114c95905f4f1982338534604051600160a060020a0394851681529290931660208301526001606060020a0319166040808301919091526060820192909252608001905180910390a15b5b50505050565b6001606060020a03198116600090815260208190526040902060018101549054829101421161030a57600080fd5b6001606060020a0319811660009081526020819052604090206007015460ff161561033457600080fd5b60025b6001606060020a03198316600090815260208190526040902060070154610100900460ff16600281111561036757fe5b14156103c5576001606060020a03198216600090815260208190526040908190206005810154600690910154600160a060020a039091169181156108fc02919051600060405180830381858888f1935050505015156103c557600080fd5b5b60015b6001606060020a03198316600090815260208190526040902060070154610100900460ff1660028111156103f957fe5b1415610457576001606060020a03198216600090815260208190526040908190206004810154600690910154600160a060020a039091169181156108fc02919051600060405180830381858888f19350505050151561045757600080fd5b5b6001606060020a0319821660009081526020819052604090819020600701805460ff191660011790557f3d2a04f53164bedf9a8a46353305d6b2d2261410406df3b41f99ce6489dc003c9042905190815260200160405180910390a15b5b5050565b80826001606060020a031982166003826000604051602001526040519081526020908101906040518083038160008661646e5a03f115156104fa57600080fd5b5050604051516c01000000000000000000000000026bffffffffffffffffffffffff191614151561052a57600080fd5b6001606060020a0319821660009081526020819052604090206001810154905401421061055657600080fd5b6001606060020a0319821660009081526020819052604090206007015460ff161561058057600080fd5b60025b6001606060020a03198416600090815260208190526040902060070154610100900460ff1660028111156105b357fe5b1415610611576001606060020a03198316600090815260208190526040908190206004810154600690910154600160a060020a039091169181156108fc02919051600060405180830381858888f19350505050151561061157600080fd5b5b60015b6001606060020a03198416600090815260208190526040902060070154610100900460ff16600281111561064557fe5b14156106a3576001606060020a03198316600090815260208190526040908190206005810154600690910154600160a060020a039091169181156108fc02919051600060405180830381858888f1935050505015156106a357600080fd5b5b6001606060020a0319831660009081526020819052604090819020600701805460ff191660011790557f82498456531a1065f689ba348ce20bda781238c424cf36748dd40bc282831e039042905190815260200160405180910390a16001606060020a0319831660009081526020819052604090206003018490555b5b50505050565b8160005b6001606060020a03198216600090815260208190526040902060070154610100900460ff16600281111561075b57fe5b1461076557600080fd5b6001606060020a031983166000908152602081905260409020600180820186905542825560028201805473ffffffffffffffffffffffffffffffffffffffff199081166c010000000000000000000000008804179091556005830180548216600160a060020a0387811691909117909155600484018054909216339091161790556007909101805461ff001916610100835b02179055506001606060020a0319831660009081526020819052604090819020346006820181905590547f8f52c15a8dda5af727677001f0ceb13df57f42198fd5cdde86a06aee80333a4b9290918791879187913391905195865260208601949094526001606060020a0319909216604080860191909152600160a060020a0391821660608601529116608084015260a083019190915260c0909101905180910390a15b5b50505050565b60006020819052908152604090208054600182015460028301546003840154600485015460058601546006870154600790970154959694956c01000000000000000000000000909402949293600160a060020a0392831693919092169160ff80821691610100900416895600a165627a7a7230582044355d5951a3ac829b5d2f94ad0fb5d30a8739df0650e6cd3b3273e63e51fee10029", + "bytecode": "0x6060604052341561000f57600080fd5b610e588061001e6000396000f30060606040526004361061006d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631aa02853146100725780637249fbb6146100b6578063ae052147146100dd578063b31597ad14610121578063eb84e7f214610155575b600080fd5b6100b460048080359060200190919080356000191690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610242565b005b34156100c157600080fd5b6100db6004808035600019169060200190919050506104ca565b005b61011f60048080359060200190919080356000191690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061078a565b005b341561012c57600080fd5b61015360048080356000191690602001909190803560001916906020019091905050610a3f565b005b341561016057600080fd5b61017a600480803560001916906020019091905050610d84565b604051808a8152602001898152602001886000191660001916815260200187600019166000191681526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018315151515815260200182600281111561022657fe5b60ff168152602001995050505050505050505060405180910390f35b816000600281111561025057fe5b600080836000191660001916815260200190815260200160002060070160019054906101000a900460ff16600281111561028657fe5b14151561029257600080fd5b836000808560001916600019168152602001908152602001600020600101819055504260008085600019166000191681526020019081526020016000206000018190555033600080856000191660001916815260200190815260200160002060050160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600080856000191660001916815260200190815260200160002060040160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503460008085600019166000191681526020019081526020016000206006018190555082600080856000191660001916815260200190815260200160002060020181600019169055506002600080856000191660001916815260200190815260200160002060070160016101000a81548160ff0219169083600281111561041057fe5b02179055507fa8506a11ec0098769a3a6fca95c3909827ae056c93e71bdc9af512a6831e06c482338534604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001836000191660001916815260200182815260200194505050505060405180910390a150505050565b80600080826000191660001916815260200190815260200160002060010154600080836000191660001916815260200190815260200160002060000154014211151561051557600080fd5b60001515600080836000191660001916815260200190815260200160002060070160009054906101000a900460ff16151514151561055257600080fd5b60028081111561055e57fe5b600080846000191660001916815260200190815260200160002060070160019054906101000a900460ff16600281111561059457fe5b141561063557600080836000191660001916815260200190815260200160002060050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6000808560001916600019168152602001908152602001600020600601549081150290604051600060405180830381858888f19350505050151561063457600080fd5b5b6001600281111561064257fe5b600080846000191660001916815260200190815260200160002060070160019054906101000a900460ff16600281111561067857fe5b141561071957600080836000191660001916815260200190815260200160002060040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6000808560001916600019168152602001908152602001600020600601549081150290604051600060405180830381858888f19350505050151561071857600080fd5b5b6001600080846000191660001916815260200190815260200160002060070160006101000a81548160ff0219169083151502179055507f3d2a04f53164bedf9a8a46353305d6b2d2261410406df3b41f99ce6489dc003c426040518082815260200191505060405180910390a15050565b816000600281111561079857fe5b600080836000191660001916815260200190815260200160002060070160019054906101000a900460ff1660028111156107ce57fe5b1415156107da57600080fd5b8360008085600019166000191681526020019081526020016000206001018190555042600080856000191660001916815260200190815260200160002060000181905550826000808560001916600019168152602001908152602001600020600201816000191690555081600080856000191660001916815260200190815260200160002060050160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555033600080856000191660001916815260200190815260200160002060040160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600080856000191660001916815260200190815260200160002060070160016101000a81548160ff0219169083600281111561093657fe5b0217905550346000808560001916600019168152602001908152602001600020600601819055507f75501a491c11746724d18ea6e5ac6a53864d886d653da6b846fdecda837cf57660008085600019166000191681526020019081526020016000206000015485858533346040518087815260200186815260200185600019166000191681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001965050505050505060405180910390a150505050565b8082816000191660028260006040516020015260405180826000191660001916815260200191505060206040518083038160008661646e5a03f11515610a8457600080fd5b50506040518051905060001916141515610a9d57600080fd5b6000808360001916600019168152602001908152602001600020600101546000808460001916600019168152602001908152602001600020600001540142101515610ae757600080fd5b60001515600080846000191660001916815260200190815260200160002060070160009054906101000a900460ff161515141515610b2457600080fd5b600280811115610b3057fe5b600080856000191660001916815260200190815260200160002060070160019054906101000a900460ff166002811115610b6657fe5b1415610c0757600080846000191660001916815260200190815260200160002060040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6000808660001916600019168152602001908152602001600020600601549081150290604051600060405180830381858888f193505050501515610c0657600080fd5b5b60016002811115610c1457fe5b600080856000191660001916815260200190815260200160002060070160019054906101000a900460ff166002811115610c4a57fe5b1415610ceb57600080846000191660001916815260200190815260200160002060050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6000808660001916600019168152602001908152602001600020600601549081150290604051600060405180830381858888f193505050501515610cea57600080fd5b5b6001600080856000191660001916815260200190815260200160002060070160006101000a81548160ff0219169083151502179055507f82498456531a1065f689ba348ce20bda781238c424cf36748dd40bc282831e03426040518082815260200191505060405180910390a1836000808560001916600019168152602001908152602001600020600301816000191690555050505050565b60006020528060005260406000206000915090508060000154908060010154908060020154908060030154908060040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060060154908060070160009054906101000a900460ff16908060070160019054906101000a900460ff169050895600a165627a7a72305820f451dcb8c020e9171c4444347970429e6f49bc68b2ab5123db09b704843ea0660029", + "deployedBytecode": "0x60606040526004361061006d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631aa02853146100725780637249fbb6146100b6578063ae052147146100dd578063b31597ad14610121578063eb84e7f214610155575b600080fd5b6100b460048080359060200190919080356000191690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610242565b005b34156100c157600080fd5b6100db6004808035600019169060200190919050506104ca565b005b61011f60048080359060200190919080356000191690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061078a565b005b341561012c57600080fd5b61015360048080356000191690602001909190803560001916906020019091905050610a3f565b005b341561016057600080fd5b61017a600480803560001916906020019091905050610d84565b604051808a8152602001898152602001886000191660001916815260200187600019166000191681526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018315151515815260200182600281111561022657fe5b60ff168152602001995050505050505050505060405180910390f35b816000600281111561025057fe5b600080836000191660001916815260200190815260200160002060070160019054906101000a900460ff16600281111561028657fe5b14151561029257600080fd5b836000808560001916600019168152602001908152602001600020600101819055504260008085600019166000191681526020019081526020016000206000018190555033600080856000191660001916815260200190815260200160002060050160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600080856000191660001916815260200190815260200160002060040160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503460008085600019166000191681526020019081526020016000206006018190555082600080856000191660001916815260200190815260200160002060020181600019169055506002600080856000191660001916815260200190815260200160002060070160016101000a81548160ff0219169083600281111561041057fe5b02179055507fa8506a11ec0098769a3a6fca95c3909827ae056c93e71bdc9af512a6831e06c482338534604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001836000191660001916815260200182815260200194505050505060405180910390a150505050565b80600080826000191660001916815260200190815260200160002060010154600080836000191660001916815260200190815260200160002060000154014211151561051557600080fd5b60001515600080836000191660001916815260200190815260200160002060070160009054906101000a900460ff16151514151561055257600080fd5b60028081111561055e57fe5b600080846000191660001916815260200190815260200160002060070160019054906101000a900460ff16600281111561059457fe5b141561063557600080836000191660001916815260200190815260200160002060050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6000808560001916600019168152602001908152602001600020600601549081150290604051600060405180830381858888f19350505050151561063457600080fd5b5b6001600281111561064257fe5b600080846000191660001916815260200190815260200160002060070160019054906101000a900460ff16600281111561067857fe5b141561071957600080836000191660001916815260200190815260200160002060040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6000808560001916600019168152602001908152602001600020600601549081150290604051600060405180830381858888f19350505050151561071857600080fd5b5b6001600080846000191660001916815260200190815260200160002060070160006101000a81548160ff0219169083151502179055507f3d2a04f53164bedf9a8a46353305d6b2d2261410406df3b41f99ce6489dc003c426040518082815260200191505060405180910390a15050565b816000600281111561079857fe5b600080836000191660001916815260200190815260200160002060070160019054906101000a900460ff1660028111156107ce57fe5b1415156107da57600080fd5b8360008085600019166000191681526020019081526020016000206001018190555042600080856000191660001916815260200190815260200160002060000181905550826000808560001916600019168152602001908152602001600020600201816000191690555081600080856000191660001916815260200190815260200160002060050160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555033600080856000191660001916815260200190815260200160002060040160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600080856000191660001916815260200190815260200160002060070160016101000a81548160ff0219169083600281111561093657fe5b0217905550346000808560001916600019168152602001908152602001600020600601819055507f75501a491c11746724d18ea6e5ac6a53864d886d653da6b846fdecda837cf57660008085600019166000191681526020019081526020016000206000015485858533346040518087815260200186815260200185600019166000191681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001965050505050505060405180910390a150505050565b8082816000191660028260006040516020015260405180826000191660001916815260200191505060206040518083038160008661646e5a03f11515610a8457600080fd5b50506040518051905060001916141515610a9d57600080fd5b6000808360001916600019168152602001908152602001600020600101546000808460001916600019168152602001908152602001600020600001540142101515610ae757600080fd5b60001515600080846000191660001916815260200190815260200160002060070160009054906101000a900460ff161515141515610b2457600080fd5b600280811115610b3057fe5b600080856000191660001916815260200190815260200160002060070160019054906101000a900460ff166002811115610b6657fe5b1415610c0757600080846000191660001916815260200190815260200160002060040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6000808660001916600019168152602001908152602001600020600601549081150290604051600060405180830381858888f193505050501515610c0657600080fd5b5b60016002811115610c1457fe5b600080856000191660001916815260200190815260200160002060070160019054906101000a900460ff166002811115610c4a57fe5b1415610ceb57600080846000191660001916815260200190815260200160002060050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6000808660001916600019168152602001908152602001600020600601549081150290604051600060405180830381858888f193505050501515610cea57600080fd5b5b6001600080856000191660001916815260200190815260200160002060070160006101000a81548160ff0219169083151502179055507f82498456531a1065f689ba348ce20bda781238c424cf36748dd40bc282831e03426040518082815260200191505060405180910390a1836000808560001916600019168152602001908152602001600020600301816000191690555050505050565b60006020528060005260406000206000915090508060000154908060010154908060020154908060030154908060040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060060154908060070160009054906101000a900460ff16908060070160019054906101000a900460ff169050895600a165627a7a72305820f451dcb8c020e9171c4444347970429e6f49bc68b2ab5123db09b704843ea0660029", + "sourceMap": "26:4086:0:-;;;823:31;;;;;;;;26:4086;;;;;;", + "deployedSourceMap": "26:4086:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2423:619;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3620:490;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1666:751;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3052:562;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;357:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2423:619;2559:13;1630:11;1600:41;;;;;;;;:5;:20;1606:13;1600:20;;;;;;;;;;;;;;;;;:26;;;;;;;;;;;;:41;;;;;;;;;1592:50;;;;;;;;2622:11;2588:5;:20;2594:13;2588:20;;;;;;;;;;;;;;;;;:31;;:45;;;;2680:15;2643:5;:20;2649:13;2643:20;;;;;;;;;;;;;;;;;:34;;:52;;;;2740:10;2705:5;:20;2711:13;2705:20;;;;;;;;;;;;;;;;;:32;;;:45;;;;;;;;;;;;;;;;;;2793:10;2760:5;:20;2766:13;2760:20;;;;;;;;;;;;;;;;;:30;;;:43;;;;;;;;;;;;;;;;;;2842:9;2813:5;:20;2819:13;2813:20;;;;;;;;;;;;;;;;;:26;;:38;;;;2897:13;2861:5;:20;2867:13;2861:20;;;;;;;;;;;;;;;;;:33;;:49;;;;;;;2949:17;2920:5;:20;2926:13;2920:20;;;;;;;;;;;;;;;;;:26;;;:46;;;;;;;;;;;;;;;;;;;;;;;;2976:59;2989:10;3000;3011:13;3025:9;2976:59;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2423:619;;;;:::o;3620:490::-;3695:13;982:5;:20;988:13;982:20;;;;;;;;;;;;;;;;;:31;;;945:5;:20;951:13;945:20;;;;;;;;;;;;;;;;;:34;;;:68;927:15;:86;919:95;;;;;;;;1064:5;1032:37;;:5;:20;1038:13;1032:20;;;;;;;;;;;;;;;;;:28;;;;;;;;;;;;:37;;;1024:46;;;;;;;;3759:17;3729:47;;;;;;;;:5;:20;3735:13;3729:20;;;;;;;;;;;;;;;;;:26;;;;;;;;;;;;:47;;;;;;;;;3725:147;;;3792:5;:20;3798:13;3792:20;;;;;;;;;;;;;;;;;:32;;;;;;;;;;;;:41;;:69;3834:5;:20;3840:13;3834:20;;;;;;;;;;;;;;;;;:26;;;3792:69;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3725:147;3915:15;3885:45;;;;;;;;:5;:20;3891:13;3885:20;;;;;;;;;;;;;;;;;:26;;;;;;;;;;;;:45;;;;;;;;;3881:143;;;3946:5;:20;3952:13;3946:20;;;;;;;;;;;;;;;;;:30;;;;;;;;;;;;:39;;:67;3986:5;:20;3992:13;3986:20;;;;;;;;;;;;;;;;;:26;;;3946:67;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3881:143;4064:4;4033:5;:20;4039:13;4033:20;;;;;;;;;;;;;;;;;:28;;;:35;;;;;;;;;;;;;;;;;;4078:25;4087:15;4078:25;;;;;;;;;;;;;;;;;;3620:490;;:::o;1666:751::-;1801:13;1630:11;1600:41;;;;;;;;:5;:20;1606:13;1600:20;;;;;;;;;;;;;;;;;:26;;;;;;;;;;;;:41;;;;;;;;;1592:50;;;;;;;;1864:11;1830:5;:20;1836:13;1830:20;;;;;;;;;;;;;;;;;:31;;:45;;;;1922:15;1885:5;:20;1891:13;1885:20;;;;;;;;;;;;;;;;;:34;;:52;;;;1983:13;1947:5;:20;1953:13;1947:20;;;;;;;;;;;;;;;;;:33;;:49;;;;;;;2041:12;2006:5;:20;2012:13;2006:20;;;;;;;;;;;;;;;;;:32;;;:47;;;;;;;;;;;;;;;;;;2096:10;2063:5;:20;2069:13;2063:20;;;;;;;;;;;;;;;;;:30;;;:43;;;;;;;;;;;;;;;;;;2145:15;2116:5;:20;2122:13;2116:20;;;;;;;;;;;;;;;;;:26;;;:44;;;;;;;;;;;;;;;;;;;;;;;;2199:9;2170:5;:20;2176:13;2170:20;;;;;;;;;;;;;;;;;:26;;:38;;;;2218:192;2241:5;:20;2247:13;2241:20;;;;;;;;;;;;;;;;;:34;;;2289:11;2314:13;2341:12;2367:10;2391:9;2218:192;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1666:751;;;;:::o;3052:562::-;3144:13;3159:7;1197:13;1178:32;;;:15;1185:7;1178:15;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:32;;;;1170:41;;;;;;;;1284:5;:20;1290:13;1284:20;;;;;;;;;;;;;;;;;:31;;;1247:5;:20;1253:13;1247:20;;;;;;;;;;;;;;;;;:34;;;:68;1229:15;:86;1221:95;;;;;;;;1366:5;1334:37;;:5;:20;1340:13;1334:20;;;;;;;;;;;;;;;;;:28;;;;;;;;;;;;:37;;;1326:46;;;;;;;;3216:17;3186:47;;;;;;;;:5;:20;3192:13;3186:20;;;;;;;;;;;;;;;;;:26;;;;;;;;;;;;:47;;;;;;;;;3182:145;;;3249:5;:20;3255:13;3249:20;;;;;;;;;;;;;;;;;:30;;;;;;;;;;;;:39;;:67;3289:5;:20;3295:13;3289:20;;;;;;;;;;;;;;;;;:26;;;3249:67;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3182:145;3370:15;3340:45;;;;;;;;:5;:20;3346:13;3340:20;;;;;;;;;;;;;;;;;:26;;;;;;;;;;;;:45;;;;;;;;;3336:145;;;3401:5;:20;3407:13;3401:20;;;;;;;;;;;;;;;;;:32;;;;;;;;;;;;:41;;:69;3443:5;:20;3449:13;3443:20;;;;;;;;;;;;;;;;;:26;;;3401:69;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3336:145;3521:4;3490:5;:20;3496:13;3490:20;;;;;;;;;;;;;;;;;:28;;;:35;;;;;;;;;;;;;;;;;;3535:25;3544:15;3535:25;;;;;;;;;;;;;;;;;;3600:7;3570:5;:20;3576:13;3570:20;;;;;;;;;;;;;;;;;:27;;:37;;;;;;;3052:562;;;;:::o;357:37::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o", + "source": "pragma solidity ^0.4.15;\n\ncontract AtomicSwap {\n\n enum State { Empty, Initiator, Participant }\n\n struct Swap {\n uint initTimestamp;\n uint refundTime;\n bytes32 hashedSecret;\n bytes32 secret;\n address initiator;\n address participant;\n uint256 value;\n bool emptied;\n State state;\n }\n\n mapping(bytes32 => Swap) public swaps;\n \n event Refunded(uint _refundTime);\n event Redeemed(uint _redeemTime);\n event Participated(\n address _initiator, \n address _participator, \n bytes32 _hashedSecret,\n uint256 _value\n );\n event Initiated(\n uint _initTimestamp,\n uint _refundTime,\n bytes32 _hashedSecret,\n address _participant,\n address _initiator,\n uint256 _funds\n );\n\n function AtomicSwap() public {}\n \n modifier isRefundable(bytes32 _hashedSecret) {\n require(block.timestamp > swaps[_hashedSecret].initTimestamp + swaps[_hashedSecret].refundTime);\n require(swaps[_hashedSecret].emptied == false);\n _;\n }\n \n modifier isRedeemable(bytes32 _hashedSecret, bytes32 _secret) {\n require(sha256(_secret) == _hashedSecret);\n require(block.timestamp < swaps[_hashedSecret].initTimestamp + swaps[_hashedSecret].refundTime);\n require(swaps[_hashedSecret].emptied == false);\n _;\n }\n \n modifier isInitiator(bytes32 _hashedSecret) {\n require(msg.sender == swaps[_hashedSecret].initiator);\n _;\n }\n \n modifier isNotInitiated(bytes32 _hashedSecret) {\n require(swaps[_hashedSecret].state == State.Empty);\n _;\n }\n\n function initiate (uint _refundTime,bytes32 _hashedSecret,address _participant)\n public\n payable \n isNotInitiated(_hashedSecret)\n {\n swaps[_hashedSecret].refundTime = _refundTime;\n swaps[_hashedSecret].initTimestamp = block.timestamp;\n swaps[_hashedSecret].hashedSecret = _hashedSecret;\n swaps[_hashedSecret].participant = _participant;\n swaps[_hashedSecret].initiator = msg.sender;\n swaps[_hashedSecret].state = State.Initiator;\n swaps[_hashedSecret].value = msg.value;\n Initiated(\n swaps[_hashedSecret].initTimestamp,\n _refundTime,\n _hashedSecret,\n _participant,\n msg.sender,\n msg.value\n );\n }\n\n function participate(uint _refundTime, bytes32 _hashedSecret,address _initiator)\n public\n payable \n isNotInitiated(_hashedSecret)\n {\n swaps[_hashedSecret].refundTime = _refundTime;\n swaps[_hashedSecret].initTimestamp = block.timestamp;\n swaps[_hashedSecret].participant = msg.sender;\n swaps[_hashedSecret].initiator = _initiator;\n swaps[_hashedSecret].value = msg.value;\n swaps[_hashedSecret].hashedSecret = _hashedSecret;\n swaps[_hashedSecret].state = State.Participant;\n Participated(_initiator,msg.sender,_hashedSecret,msg.value);\n }\n \n function redeem(bytes32 _secret, bytes32 _hashedSecret)\n public\n isRedeemable(_hashedSecret, _secret)\n {\n if (swaps[_hashedSecret].state == State.Participant) {\n swaps[_hashedSecret].initiator.transfer(swaps[_hashedSecret].value);\n }\n if (swaps[_hashedSecret].state == State.Initiator) {\n swaps[_hashedSecret].participant.transfer(swaps[_hashedSecret].value);\n }\n swaps[_hashedSecret].emptied = true;\n Redeemed(block.timestamp);\n swaps[_hashedSecret].secret = _secret;\n }\n\n function refund(bytes32 _hashedSecret)\n public\n isRefundable(_hashedSecret) \n {\n if (swaps[_hashedSecret].state == State.Participant) {\n swaps[_hashedSecret].participant.transfer(swaps[_hashedSecret].value);\n }\n if (swaps[_hashedSecret].state == State.Initiator) {\n swaps[_hashedSecret].initiator.transfer(swaps[_hashedSecret].value);\n }\n swaps[_hashedSecret].emptied = true;\n Refunded(block.timestamp);\n }\n}", + "sourcePath": "/Users/glendc/Projects/AltCoinExchange/ethatomicswap/contracts/AtomicSwap.sol", + "ast": { + "absolutePath": "/Users/glendc/Projects/AltCoinExchange/ethatomicswap/contracts/AtomicSwap.sol", + "exportedSymbols": { + "AtomicSwap": [ + 454 + ] + }, + "id": 455, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1, + "literals": [ + "solidity", + "^", + "0.4", + ".15" + ], + "nodeType": "PragmaDirective", + "src": "0:24:0" + }, + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 454, + "linearizedBaseContracts": [ + 454 + ], + "name": "AtomicSwap", + "nodeType": "ContractDefinition", + "nodes": [ + { + "canonicalName": "AtomicSwap.State", + "id": 5, + "members": [ + { + "id": 2, + "name": "Empty", + "nodeType": "EnumValue", + "src": "66:5:0" + }, + { + "id": 3, + "name": "Initiator", + "nodeType": "EnumValue", + "src": "73:9:0" + }, + { + "id": 4, + "name": "Participant", + "nodeType": "EnumValue", + "src": "84:11:0" + } + ], + "name": "State", + "nodeType": "EnumDefinition", + "src": "53:44:0" + }, + { + "canonicalName": "AtomicSwap.Swap", + "id": 24, + "members": [ + { + "constant": false, + "id": 7, + "name": "initTimestamp", + "nodeType": "VariableDeclaration", + "scope": 24, + "src": "125:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "125:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 9, + "name": "refundTime", + "nodeType": "VariableDeclaration", + "scope": 24, + "src": "153:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "153:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 11, + "name": "hashedSecret", + "nodeType": "VariableDeclaration", + "scope": 24, + "src": "178:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 10, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "178:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 13, + "name": "secret", + "nodeType": "VariableDeclaration", + "scope": 24, + "src": "208:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 12, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "208:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 15, + "name": "initiator", + "nodeType": "VariableDeclaration", + "scope": 24, + "src": "232:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "232:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 17, + "name": "participant", + "nodeType": "VariableDeclaration", + "scope": 24, + "src": "259:19:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "259:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 19, + "name": "value", + "nodeType": "VariableDeclaration", + "scope": 24, + "src": "288:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 18, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "288:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 21, + "name": "emptied", + "nodeType": "VariableDeclaration", + "scope": 24, + "src": "311:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 20, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "311:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 23, + "name": "state", + "nodeType": "VariableDeclaration", + "scope": 24, + "src": "333:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + }, + "typeName": { + "contractScope": null, + "id": 22, + "name": "State", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 5, + "src": "333:5:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "value": null, + "visibility": "internal" + } + ], + "name": "Swap", + "nodeType": "StructDefinition", + "scope": 454, + "src": "103:248:0", + "visibility": "public" + }, + { + "constant": false, + "id": 28, + "name": "swaps", + "nodeType": "VariableDeclaration", + "scope": 454, + "src": "357:37:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + }, + "typeName": { + "id": 27, + "keyType": { + "id": 25, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "365:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "357:24:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + }, + "valueType": { + "contractScope": null, + "id": 26, + "name": "Swap", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 24, + "src": "376:4:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage_ptr", + "typeString": "struct AtomicSwap.Swap storage pointer" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "anonymous": false, + "id": 32, + "name": "Refunded", + "nodeType": "EventDefinition", + "parameters": { + "id": 31, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 30, + "indexed": false, + "name": "_refundTime", + "nodeType": "VariableDeclaration", + "scope": 32, + "src": "420:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 29, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "420:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "419:18:0" + }, + "src": "405:33:0" + }, + { + "anonymous": false, + "id": 36, + "name": "Redeemed", + "nodeType": "EventDefinition", + "parameters": { + "id": 35, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 34, + "indexed": false, + "name": "_redeemTime", + "nodeType": "VariableDeclaration", + "scope": 36, + "src": "458:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 33, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "458:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "457:18:0" + }, + "src": "443:33:0" + }, + { + "anonymous": false, + "id": 46, + "name": "Participated", + "nodeType": "EventDefinition", + "parameters": { + "id": 45, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 38, + "indexed": false, + "name": "_initiator", + "nodeType": "VariableDeclaration", + "scope": 46, + "src": "509:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 37, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "509:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 40, + "indexed": false, + "name": "_participator", + "nodeType": "VariableDeclaration", + "scope": 46, + "src": "538:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 39, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "538:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 42, + "indexed": false, + "name": "_hashedSecret", + "nodeType": "VariableDeclaration", + "scope": 46, + "src": "570:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 41, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "570:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 44, + "indexed": false, + "name": "_value", + "nodeType": "VariableDeclaration", + "scope": 46, + "src": "601:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 43, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "601:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "499:122:0" + }, + "src": "481:141:0" + }, + { + "anonymous": false, + "id": 60, + "name": "Initiated", + "nodeType": "EventDefinition", + "parameters": { + "id": 59, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 48, + "indexed": false, + "name": "_initTimestamp", + "nodeType": "VariableDeclaration", + "scope": 60, + "src": "652:19:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 47, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "652:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 50, + "indexed": false, + "name": "_refundTime", + "nodeType": "VariableDeclaration", + "scope": 60, + "src": "681:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 49, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "681:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 52, + "indexed": false, + "name": "_hashedSecret", + "nodeType": "VariableDeclaration", + "scope": 60, + "src": "707:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 51, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "707:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 54, + "indexed": false, + "name": "_participant", + "nodeType": "VariableDeclaration", + "scope": 60, + "src": "738:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 53, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "738:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 56, + "indexed": false, + "name": "_initiator", + "nodeType": "VariableDeclaration", + "scope": 60, + "src": "768:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 55, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "768:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 58, + "indexed": false, + "name": "_funds", + "nodeType": "VariableDeclaration", + "scope": 60, + "src": "796:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 57, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "796:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "642:174:0" + }, + "src": "627:190:0" + }, + { + "body": { + "id": 63, + "nodeType": "Block", + "src": "852:2:0", + "statements": [] + }, + "id": 64, + "implemented": true, + "isConstructor": true, + "isDeclaredConst": false, + "modifiers": [], + "name": "AtomicSwap", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 61, + "nodeType": "ParameterList", + "parameters": [], + "src": "842:2:0" + }, + "payable": false, + "returnParameters": { + "id": 62, + "nodeType": "ParameterList", + "parameters": [], + "src": "852:0:0" + }, + "scope": 454, + "src": "823:31:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 93, + "nodeType": "Block", + "src": "909:179:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 80, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 69, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 515, + "src": "927:5:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 70, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "timestamp", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "927:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 79, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 71, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "945:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 73, + "indexExpression": { + "argumentTypes": null, + "id": 72, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 66, + "src": "951:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "945:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 74, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "initTimestamp", + "nodeType": "MemberAccess", + "referencedDeclaration": 7, + "src": "945:34:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 75, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "982:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 77, + "indexExpression": { + "argumentTypes": null, + "id": 76, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 66, + "src": "988:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "982:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 78, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "refundTime", + "nodeType": "MemberAccess", + "referencedDeclaration": 9, + "src": "982:31:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "945:68:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "927:86:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 68, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 526, + "src": "919:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 81, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "919:95:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 82, + "nodeType": "ExpressionStatement", + "src": "919:95:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 89, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 84, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "1032:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 86, + "indexExpression": { + "argumentTypes": null, + "id": 85, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 66, + "src": "1038:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1032:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 87, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "emptied", + "nodeType": "MemberAccess", + "referencedDeclaration": 21, + "src": "1032:28:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 88, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1064:5:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "src": "1032:37:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 83, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 526, + "src": "1024:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 90, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1024:46:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 91, + "nodeType": "ExpressionStatement", + "src": "1024:46:0" + }, + { + "id": 92, + "nodeType": "PlaceholderStatement", + "src": "1080:1:0" + } + ] + }, + "id": 94, + "name": "isRefundable", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 67, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 66, + "name": "_hashedSecret", + "nodeType": "VariableDeclaration", + "scope": 94, + "src": "886:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 65, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "886:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "885:23:0" + }, + "src": "864:224:0", + "visibility": "internal" + }, + { + "body": { + "id": 133, + "nodeType": "Block", + "src": "1160:230:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "id": 105, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 102, + "name": "_secret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 98, + "src": "1185:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 101, + "name": "sha256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 530, + "src": "1178:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_sha256_pure$__$returns$_t_bytes32_$", + "typeString": "function () pure returns (bytes32)" + } + }, + "id": 103, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1178:15:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 104, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 96, + "src": "1197:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "1178:32:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 100, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 526, + "src": "1170:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 106, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1170:41:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 107, + "nodeType": "ExpressionStatement", + "src": "1170:41:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 120, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 109, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 515, + "src": "1229:5:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 110, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "timestamp", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1229:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 119, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 111, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "1247:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 113, + "indexExpression": { + "argumentTypes": null, + "id": 112, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 96, + "src": "1253:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1247:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 114, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "initTimestamp", + "nodeType": "MemberAccess", + "referencedDeclaration": 7, + "src": "1247:34:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 115, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "1284:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 117, + "indexExpression": { + "argumentTypes": null, + "id": 116, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 96, + "src": "1290:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1284:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 118, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "refundTime", + "nodeType": "MemberAccess", + "referencedDeclaration": 9, + "src": "1284:31:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1247:68:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1229:86:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 108, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 526, + "src": "1221:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 121, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1221:95:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 122, + "nodeType": "ExpressionStatement", + "src": "1221:95:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 129, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 124, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "1334:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 126, + "indexExpression": { + "argumentTypes": null, + "id": 125, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 96, + "src": "1340:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1334:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 127, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "emptied", + "nodeType": "MemberAccess", + "referencedDeclaration": 21, + "src": "1334:28:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 128, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1366:5:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "src": "1334:37:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 123, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 526, + "src": "1326:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 130, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1326:46:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 131, + "nodeType": "ExpressionStatement", + "src": "1326:46:0" + }, + { + "id": 132, + "nodeType": "PlaceholderStatement", + "src": "1382:1:0" + } + ] + }, + "id": 134, + "name": "isRedeemable", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 99, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 96, + "name": "_hashedSecret", + "nodeType": "VariableDeclaration", + "scope": 134, + "src": "1120:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 95, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1120:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 98, + "name": "_secret", + "nodeType": "VariableDeclaration", + "scope": 134, + "src": "1143:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 97, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1143:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1119:40:0" + }, + "src": "1098:292:0", + "visibility": "internal" + }, + { + "body": { + "id": 149, + "nodeType": "Block", + "src": "1444:81:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 145, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 139, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 523, + "src": "1462:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 140, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1462:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 141, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "1476:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 143, + "indexExpression": { + "argumentTypes": null, + "id": 142, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 136, + "src": "1482:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1476:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 144, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "initiator", + "nodeType": "MemberAccess", + "referencedDeclaration": 15, + "src": "1476:30:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "1462:44:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 138, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 526, + "src": "1454:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 146, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1454:53:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 147, + "nodeType": "ExpressionStatement", + "src": "1454:53:0" + }, + { + "id": 148, + "nodeType": "PlaceholderStatement", + "src": "1517:1:0" + } + ] + }, + "id": 150, + "name": "isInitiator", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 137, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 136, + "name": "_hashedSecret", + "nodeType": "VariableDeclaration", + "scope": 150, + "src": "1421:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 135, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1421:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1420:23:0" + }, + "src": "1400:125:0", + "visibility": "internal" + }, + { + "body": { + "id": 165, + "nodeType": "Block", + "src": "1582:78:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + }, + "id": 161, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 155, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "1600:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 157, + "indexExpression": { + "argumentTypes": null, + "id": 156, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 152, + "src": "1606:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1600:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 158, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "state", + "nodeType": "MemberAccess", + "referencedDeclaration": 23, + "src": "1600:26:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 159, + "name": "State", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5, + "src": "1630:5:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_State_$5_$", + "typeString": "type(enum AtomicSwap.State)" + } + }, + "id": 160, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "Empty", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1630:11:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "src": "1600:41:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 154, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 526, + "src": "1592:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 162, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1592:50:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 163, + "nodeType": "ExpressionStatement", + "src": "1592:50:0" + }, + { + "id": 164, + "nodeType": "PlaceholderStatement", + "src": "1652:1:0" + } + ] + }, + "id": 166, + "name": "isNotInitiated", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 153, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 152, + "name": "_hashedSecret", + "nodeType": "VariableDeclaration", + "scope": 166, + "src": "1559:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 151, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1559:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1558:23:0" + }, + "src": "1535:125:0", + "visibility": "internal" + }, + { + "body": { + "id": 245, + "nodeType": "Block", + "src": "1820:597:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 183, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 178, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "1830:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 180, + "indexExpression": { + "argumentTypes": null, + "id": 179, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 170, + "src": "1836:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1830:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 181, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "refundTime", + "nodeType": "MemberAccess", + "referencedDeclaration": 9, + "src": "1830:31:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 182, + "name": "_refundTime", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 168, + "src": "1864:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1830:45:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 184, + "nodeType": "ExpressionStatement", + "src": "1830:45:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 191, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 185, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "1885:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 187, + "indexExpression": { + "argumentTypes": null, + "id": 186, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 170, + "src": "1891:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1885:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 188, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "initTimestamp", + "nodeType": "MemberAccess", + "referencedDeclaration": 7, + "src": "1885:34:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 189, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 515, + "src": "1922:5:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 190, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "timestamp", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1922:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1885:52:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 192, + "nodeType": "ExpressionStatement", + "src": "1885:52:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 198, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 193, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "1947:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 195, + "indexExpression": { + "argumentTypes": null, + "id": 194, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 170, + "src": "1953:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1947:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 196, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "hashedSecret", + "nodeType": "MemberAccess", + "referencedDeclaration": 11, + "src": "1947:33:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 197, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 170, + "src": "1983:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "1947:49:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "id": 199, + "nodeType": "ExpressionStatement", + "src": "1947:49:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 205, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 200, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "2006:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 202, + "indexExpression": { + "argumentTypes": null, + "id": 201, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 170, + "src": "2012:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2006:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 203, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "participant", + "nodeType": "MemberAccess", + "referencedDeclaration": 17, + "src": "2006:32:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 204, + "name": "_participant", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 172, + "src": "2041:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "2006:47:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 206, + "nodeType": "ExpressionStatement", + "src": "2006:47:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 213, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 207, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "2063:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 209, + "indexExpression": { + "argumentTypes": null, + "id": 208, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 170, + "src": "2069:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2063:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 210, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "initiator", + "nodeType": "MemberAccess", + "referencedDeclaration": 15, + "src": "2063:30:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 211, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 523, + "src": "2096:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 212, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2096:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "2063:43:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 214, + "nodeType": "ExpressionStatement", + "src": "2063:43:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 221, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 215, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "2116:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 217, + "indexExpression": { + "argumentTypes": null, + "id": 216, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 170, + "src": "2122:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2116:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 218, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "state", + "nodeType": "MemberAccess", + "referencedDeclaration": 23, + "src": "2116:26:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 219, + "name": "State", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5, + "src": "2145:5:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_State_$5_$", + "typeString": "type(enum AtomicSwap.State)" + } + }, + "id": 220, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "Initiator", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2145:15:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "src": "2116:44:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "id": 222, + "nodeType": "ExpressionStatement", + "src": "2116:44:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 229, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 223, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "2170:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 225, + "indexExpression": { + "argumentTypes": null, + "id": 224, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 170, + "src": "2176:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2170:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 226, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "value", + "nodeType": "MemberAccess", + "referencedDeclaration": 19, + "src": "2170:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 227, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 523, + "src": "2199:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 228, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "value", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2199:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2170:38:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 230, + "nodeType": "ExpressionStatement", + "src": "2170:38:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 232, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "2241:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 234, + "indexExpression": { + "argumentTypes": null, + "id": 233, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 170, + "src": "2247:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2241:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 235, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "initTimestamp", + "nodeType": "MemberAccess", + "referencedDeclaration": 7, + "src": "2241:34:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 236, + "name": "_refundTime", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 168, + "src": "2289:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 237, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 170, + "src": "2314:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 238, + "name": "_participant", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 172, + "src": "2341:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 239, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 523, + "src": "2367:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 240, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2367:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 241, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 523, + "src": "2391:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 242, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "value", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2391:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 231, + "name": "Initiated", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 60, + "src": "2218:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$_t_bytes32_$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256,bytes32,address,address,uint256)" + } + }, + "id": 243, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2218:192:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 244, + "nodeType": "ExpressionStatement", + "src": "2218:192:0" + } + ] + }, + "id": 246, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [ + { + "arguments": [ + { + "argumentTypes": null, + "id": 175, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 170, + "src": "1801:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "id": 176, + "modifierName": { + "argumentTypes": null, + "id": 174, + "name": "isNotInitiated", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 166, + "src": "1786:14:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$_t_bytes32_$", + "typeString": "modifier (bytes32)" + } + }, + "nodeType": "ModifierInvocation", + "src": "1786:29:0" + } + ], + "name": "initiate", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 173, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 168, + "name": "_refundTime", + "nodeType": "VariableDeclaration", + "scope": 246, + "src": "1685:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 167, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1685:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 170, + "name": "_hashedSecret", + "nodeType": "VariableDeclaration", + "scope": 246, + "src": "1702:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 169, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1702:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 172, + "name": "_participant", + "nodeType": "VariableDeclaration", + "scope": 246, + "src": "1724:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 171, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1724:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1684:61:0" + }, + "payable": true, + "returnParameters": { + "id": 177, + "nodeType": "ParameterList", + "parameters": [], + "src": "1820:0:0" + }, + "scope": 454, + "src": "1666:751:0", + "stateMutability": "payable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 320, + "nodeType": "Block", + "src": "2578:464:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 263, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 258, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "2588:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 260, + "indexExpression": { + "argumentTypes": null, + "id": 259, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 250, + "src": "2594:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2588:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 261, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "refundTime", + "nodeType": "MemberAccess", + "referencedDeclaration": 9, + "src": "2588:31:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 262, + "name": "_refundTime", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 248, + "src": "2622:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2588:45:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 264, + "nodeType": "ExpressionStatement", + "src": "2588:45:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 271, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 265, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "2643:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 267, + "indexExpression": { + "argumentTypes": null, + "id": 266, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 250, + "src": "2649:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2643:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 268, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "initTimestamp", + "nodeType": "MemberAccess", + "referencedDeclaration": 7, + "src": "2643:34:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 269, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 515, + "src": "2680:5:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 270, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "timestamp", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2680:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2643:52:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 272, + "nodeType": "ExpressionStatement", + "src": "2643:52:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 279, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 273, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "2705:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 275, + "indexExpression": { + "argumentTypes": null, + "id": 274, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 250, + "src": "2711:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2705:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 276, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "participant", + "nodeType": "MemberAccess", + "referencedDeclaration": 17, + "src": "2705:32:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 277, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 523, + "src": "2740:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 278, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2740:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "2705:45:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 280, + "nodeType": "ExpressionStatement", + "src": "2705:45:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 286, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 281, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "2760:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 283, + "indexExpression": { + "argumentTypes": null, + "id": 282, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 250, + "src": "2766:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2760:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 284, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "initiator", + "nodeType": "MemberAccess", + "referencedDeclaration": 15, + "src": "2760:30:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 285, + "name": "_initiator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 252, + "src": "2793:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "2760:43:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 287, + "nodeType": "ExpressionStatement", + "src": "2760:43:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 294, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 288, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "2813:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 290, + "indexExpression": { + "argumentTypes": null, + "id": 289, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 250, + "src": "2819:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2813:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 291, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "value", + "nodeType": "MemberAccess", + "referencedDeclaration": 19, + "src": "2813:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 292, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 523, + "src": "2842:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 293, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "value", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2842:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2813:38:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 295, + "nodeType": "ExpressionStatement", + "src": "2813:38:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 301, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 296, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "2861:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 298, + "indexExpression": { + "argumentTypes": null, + "id": 297, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 250, + "src": "2867:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2861:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 299, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "hashedSecret", + "nodeType": "MemberAccess", + "referencedDeclaration": 11, + "src": "2861:33:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 300, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 250, + "src": "2897:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "2861:49:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "id": 302, + "nodeType": "ExpressionStatement", + "src": "2861:49:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 309, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 303, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "2920:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 305, + "indexExpression": { + "argumentTypes": null, + "id": 304, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 250, + "src": "2926:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2920:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 306, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "state", + "nodeType": "MemberAccess", + "referencedDeclaration": 23, + "src": "2920:26:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 307, + "name": "State", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5, + "src": "2949:5:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_State_$5_$", + "typeString": "type(enum AtomicSwap.State)" + } + }, + "id": 308, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "Participant", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2949:17:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "src": "2920:46:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "id": 310, + "nodeType": "ExpressionStatement", + "src": "2920:46:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 312, + "name": "_initiator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 252, + "src": "2989:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 313, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 523, + "src": "3000:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 314, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3000:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 315, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 250, + "src": "3011:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 316, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 523, + "src": "3025:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 317, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "value", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3025:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 311, + "name": "Participated", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 46, + "src": "2976:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_bytes32_$_t_uint256_$returns$__$", + "typeString": "function (address,address,bytes32,uint256)" + } + }, + "id": 318, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2976:59:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 319, + "nodeType": "ExpressionStatement", + "src": "2976:59:0" + } + ] + }, + "id": 321, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [ + { + "arguments": [ + { + "argumentTypes": null, + "id": 255, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 250, + "src": "2559:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "id": 256, + "modifierName": { + "argumentTypes": null, + "id": 254, + "name": "isNotInitiated", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 166, + "src": "2544:14:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$_t_bytes32_$", + "typeString": "modifier (bytes32)" + } + }, + "nodeType": "ModifierInvocation", + "src": "2544:29:0" + } + ], + "name": "participate", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 253, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 248, + "name": "_refundTime", + "nodeType": "VariableDeclaration", + "scope": 321, + "src": "2444:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 247, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2444:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 250, + "name": "_hashedSecret", + "nodeType": "VariableDeclaration", + "scope": 321, + "src": "2462:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 249, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2462:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 252, + "name": "_initiator", + "nodeType": "VariableDeclaration", + "scope": 321, + "src": "2484:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 251, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2484:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2443:60:0" + }, + "payable": true, + "returnParameters": { + "id": 257, + "nodeType": "ParameterList", + "parameters": [], + "src": "2578:0:0" + }, + "scope": 454, + "src": "2423:619:0", + "stateMutability": "payable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 391, + "nodeType": "Block", + "src": "3172:442:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + }, + "id": 338, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 332, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "3186:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 334, + "indexExpression": { + "argumentTypes": null, + "id": 333, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 325, + "src": "3192:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3186:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 335, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "state", + "nodeType": "MemberAccess", + "referencedDeclaration": 23, + "src": "3186:26:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 336, + "name": "State", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5, + "src": "3216:5:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_State_$5_$", + "typeString": "type(enum AtomicSwap.State)" + } + }, + "id": 337, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "Participant", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3216:17:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "src": "3186:47:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 351, + "nodeType": "IfStatement", + "src": "3182:145:0", + "trueBody": { + "id": 350, + "nodeType": "Block", + "src": "3235:92:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 344, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "3289:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 346, + "indexExpression": { + "argumentTypes": null, + "id": 345, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 325, + "src": "3295:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3289:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 347, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "value", + "nodeType": "MemberAccess", + "referencedDeclaration": 19, + "src": "3289:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 339, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "3249:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 341, + "indexExpression": { + "argumentTypes": null, + "id": 340, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 325, + "src": "3255:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3249:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 342, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "initiator", + "nodeType": "MemberAccess", + "referencedDeclaration": 15, + "src": "3249:30:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 343, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transfer", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3249:39:0", + "typeDescriptions": { + "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 348, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3249:67:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 349, + "nodeType": "ExpressionStatement", + "src": "3249:67:0" + } + ] + } + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + }, + "id": 358, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 352, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "3340:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 354, + "indexExpression": { + "argumentTypes": null, + "id": 353, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 325, + "src": "3346:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3340:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 355, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "state", + "nodeType": "MemberAccess", + "referencedDeclaration": 23, + "src": "3340:26:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 356, + "name": "State", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5, + "src": "3370:5:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_State_$5_$", + "typeString": "type(enum AtomicSwap.State)" + } + }, + "id": 357, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "Initiator", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3370:15:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "src": "3340:45:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 371, + "nodeType": "IfStatement", + "src": "3336:145:0", + "trueBody": { + "id": 370, + "nodeType": "Block", + "src": "3387:94:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 364, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "3443:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 366, + "indexExpression": { + "argumentTypes": null, + "id": 365, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 325, + "src": "3449:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3443:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 367, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "value", + "nodeType": "MemberAccess", + "referencedDeclaration": 19, + "src": "3443:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 359, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "3401:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 361, + "indexExpression": { + "argumentTypes": null, + "id": 360, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 325, + "src": "3407:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3401:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 362, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "participant", + "nodeType": "MemberAccess", + "referencedDeclaration": 17, + "src": "3401:32:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 363, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transfer", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3401:41:0", + "typeDescriptions": { + "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 368, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3401:69:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 369, + "nodeType": "ExpressionStatement", + "src": "3401:69:0" + } + ] + } + }, + { + "expression": { + "argumentTypes": null, + "id": 377, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 372, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "3490:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 374, + "indexExpression": { + "argumentTypes": null, + "id": 373, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 325, + "src": "3496:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3490:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 375, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "emptied", + "nodeType": "MemberAccess", + "referencedDeclaration": 21, + "src": "3490:28:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 376, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3521:4:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "3490:35:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 378, + "nodeType": "ExpressionStatement", + "src": "3490:35:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 380, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 515, + "src": "3544:5:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 381, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "timestamp", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3544:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 379, + "name": "Redeemed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 36, + "src": "3535:8:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 382, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3535:25:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 383, + "nodeType": "ExpressionStatement", + "src": "3535:25:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 389, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 384, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "3570:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 386, + "indexExpression": { + "argumentTypes": null, + "id": 385, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 325, + "src": "3576:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3570:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 387, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "secret", + "nodeType": "MemberAccess", + "referencedDeclaration": 13, + "src": "3570:27:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 388, + "name": "_secret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 323, + "src": "3600:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "3570:37:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "id": 390, + "nodeType": "ExpressionStatement", + "src": "3570:37:0" + } + ] + }, + "id": 392, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [ + { + "arguments": [ + { + "argumentTypes": null, + "id": 328, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 325, + "src": "3144:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 329, + "name": "_secret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 323, + "src": "3159:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "id": 330, + "modifierName": { + "argumentTypes": null, + "id": 327, + "name": "isRedeemable", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 134, + "src": "3131:12:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$_t_bytes32_$_t_bytes32_$", + "typeString": "modifier (bytes32,bytes32)" + } + }, + "nodeType": "ModifierInvocation", + "src": "3131:36:0" + } + ], + "name": "redeem", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 326, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 323, + "name": "_secret", + "nodeType": "VariableDeclaration", + "scope": 392, + "src": "3068:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 322, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3068:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 325, + "name": "_hashedSecret", + "nodeType": "VariableDeclaration", + "scope": 392, + "src": "3085:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 324, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3085:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3067:40:0" + }, + "payable": false, + "returnParameters": { + "id": 331, + "nodeType": "ParameterList", + "parameters": [], + "src": "3172:0:0" + }, + "scope": 454, + "src": "3052:562:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 452, + "nodeType": "Block", + "src": "3715:395:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + }, + "id": 406, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 400, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "3729:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 402, + "indexExpression": { + "argumentTypes": null, + "id": 401, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 394, + "src": "3735:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3729:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 403, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "state", + "nodeType": "MemberAccess", + "referencedDeclaration": 23, + "src": "3729:26:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 404, + "name": "State", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5, + "src": "3759:5:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_State_$5_$", + "typeString": "type(enum AtomicSwap.State)" + } + }, + "id": 405, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "Participant", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3759:17:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "src": "3729:47:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 419, + "nodeType": "IfStatement", + "src": "3725:147:0", + "trueBody": { + "id": 418, + "nodeType": "Block", + "src": "3778:94:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 412, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "3834:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 414, + "indexExpression": { + "argumentTypes": null, + "id": 413, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 394, + "src": "3840:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3834:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 415, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "value", + "nodeType": "MemberAccess", + "referencedDeclaration": 19, + "src": "3834:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 407, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "3792:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 409, + "indexExpression": { + "argumentTypes": null, + "id": 408, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 394, + "src": "3798:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3792:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 410, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "participant", + "nodeType": "MemberAccess", + "referencedDeclaration": 17, + "src": "3792:32:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 411, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transfer", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3792:41:0", + "typeDescriptions": { + "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 416, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3792:69:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 417, + "nodeType": "ExpressionStatement", + "src": "3792:69:0" + } + ] + } + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + }, + "id": 426, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 420, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "3885:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 422, + "indexExpression": { + "argumentTypes": null, + "id": 421, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 394, + "src": "3891:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3885:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 423, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "state", + "nodeType": "MemberAccess", + "referencedDeclaration": 23, + "src": "3885:26:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 424, + "name": "State", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5, + "src": "3915:5:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_State_$5_$", + "typeString": "type(enum AtomicSwap.State)" + } + }, + "id": 425, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "Initiator", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3915:15:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "src": "3885:45:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 439, + "nodeType": "IfStatement", + "src": "3881:143:0", + "trueBody": { + "id": 438, + "nodeType": "Block", + "src": "3932:92:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 432, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "3986:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 434, + "indexExpression": { + "argumentTypes": null, + "id": 433, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 394, + "src": "3992:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3986:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 435, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "value", + "nodeType": "MemberAccess", + "referencedDeclaration": 19, + "src": "3986:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 427, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "3946:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 429, + "indexExpression": { + "argumentTypes": null, + "id": 428, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 394, + "src": "3952:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3946:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 430, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "initiator", + "nodeType": "MemberAccess", + "referencedDeclaration": 15, + "src": "3946:30:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 431, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transfer", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3946:39:0", + "typeDescriptions": { + "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 436, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3946:67:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 437, + "nodeType": "ExpressionStatement", + "src": "3946:67:0" + } + ] + } + }, + { + "expression": { + "argumentTypes": null, + "id": 445, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 440, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "4033:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 442, + "indexExpression": { + "argumentTypes": null, + "id": 441, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 394, + "src": "4039:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4033:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 443, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "emptied", + "nodeType": "MemberAccess", + "referencedDeclaration": 21, + "src": "4033:28:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 444, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4064:4:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "4033:35:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 446, + "nodeType": "ExpressionStatement", + "src": "4033:35:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 448, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 515, + "src": "4087:5:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 449, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "timestamp", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4087:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 447, + "name": "Refunded", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 32, + "src": "4078:8:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 450, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4078:25:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 451, + "nodeType": "ExpressionStatement", + "src": "4078:25:0" + } + ] + }, + "id": 453, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [ + { + "arguments": [ + { + "argumentTypes": null, + "id": 397, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 394, + "src": "3695:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "id": 398, + "modifierName": { + "argumentTypes": null, + "id": 396, + "name": "isRefundable", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "3682:12:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$_t_bytes32_$", + "typeString": "modifier (bytes32)" + } + }, + "nodeType": "ModifierInvocation", + "src": "3682:27:0" + } + ], + "name": "refund", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 395, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 394, + "name": "_hashedSecret", + "nodeType": "VariableDeclaration", + "scope": 453, + "src": "3636:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 393, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3636:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3635:23:0" + }, + "payable": false, + "returnParameters": { + "id": 399, + "nodeType": "ParameterList", + "parameters": [], + "src": "3715:0:0" + }, + "scope": 454, + "src": "3620:490:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 455, + "src": "26:4086:0" + } + ], + "src": "0:4112:0" + }, + "legacyAST": { + "absolutePath": "/Users/glendc/Projects/AltCoinExchange/ethatomicswap/contracts/AtomicSwap.sol", + "exportedSymbols": { + "AtomicSwap": [ + 454 + ] + }, + "id": 455, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1, + "literals": [ + "solidity", + "^", + "0.4", + ".15" + ], + "nodeType": "PragmaDirective", + "src": "0:24:0" + }, + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 454, + "linearizedBaseContracts": [ + 454 + ], + "name": "AtomicSwap", + "nodeType": "ContractDefinition", + "nodes": [ + { + "canonicalName": "AtomicSwap.State", + "id": 5, + "members": [ + { + "id": 2, + "name": "Empty", + "nodeType": "EnumValue", + "src": "66:5:0" + }, + { + "id": 3, + "name": "Initiator", + "nodeType": "EnumValue", + "src": "73:9:0" + }, + { + "id": 4, + "name": "Participant", + "nodeType": "EnumValue", + "src": "84:11:0" + } + ], + "name": "State", + "nodeType": "EnumDefinition", + "src": "53:44:0" + }, + { + "canonicalName": "AtomicSwap.Swap", + "id": 24, + "members": [ + { + "constant": false, + "id": 7, + "name": "initTimestamp", + "nodeType": "VariableDeclaration", + "scope": 24, + "src": "125:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 6, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "125:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 9, + "name": "refundTime", + "nodeType": "VariableDeclaration", + "scope": 24, + "src": "153:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 8, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "153:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 11, + "name": "hashedSecret", + "nodeType": "VariableDeclaration", + "scope": 24, + "src": "178:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 10, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "178:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 13, + "name": "secret", + "nodeType": "VariableDeclaration", + "scope": 24, + "src": "208:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 12, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "208:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 15, + "name": "initiator", + "nodeType": "VariableDeclaration", + "scope": 24, + "src": "232:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 14, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "232:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 17, + "name": "participant", + "nodeType": "VariableDeclaration", + "scope": 24, + "src": "259:19:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 16, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "259:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 19, + "name": "value", + "nodeType": "VariableDeclaration", + "scope": 24, + "src": "288:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 18, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "288:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 21, + "name": "emptied", + "nodeType": "VariableDeclaration", + "scope": 24, + "src": "311:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 20, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "311:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 23, + "name": "state", + "nodeType": "VariableDeclaration", + "scope": 24, + "src": "333:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + }, + "typeName": { + "contractScope": null, + "id": 22, + "name": "State", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 5, + "src": "333:5:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "value": null, + "visibility": "internal" + } + ], + "name": "Swap", + "nodeType": "StructDefinition", + "scope": 454, + "src": "103:248:0", + "visibility": "public" + }, + { + "constant": false, + "id": 28, + "name": "swaps", + "nodeType": "VariableDeclaration", + "scope": 454, + "src": "357:37:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + }, + "typeName": { + "id": 27, + "keyType": { + "id": 25, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "365:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Mapping", + "src": "357:24:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + }, + "valueType": { + "contractScope": null, + "id": 26, + "name": "Swap", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 24, + "src": "376:4:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage_ptr", + "typeString": "struct AtomicSwap.Swap storage pointer" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "anonymous": false, + "id": 32, + "name": "Refunded", + "nodeType": "EventDefinition", + "parameters": { + "id": 31, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 30, + "indexed": false, + "name": "_refundTime", + "nodeType": "VariableDeclaration", + "scope": 32, + "src": "420:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 29, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "420:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "419:18:0" + }, + "src": "405:33:0" + }, + { + "anonymous": false, + "id": 36, + "name": "Redeemed", + "nodeType": "EventDefinition", + "parameters": { + "id": 35, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 34, + "indexed": false, + "name": "_redeemTime", + "nodeType": "VariableDeclaration", + "scope": 36, + "src": "458:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 33, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "458:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "457:18:0" + }, + "src": "443:33:0" + }, + { + "anonymous": false, + "id": 46, + "name": "Participated", + "nodeType": "EventDefinition", + "parameters": { + "id": 45, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 38, + "indexed": false, + "name": "_initiator", + "nodeType": "VariableDeclaration", + "scope": 46, + "src": "509:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 37, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "509:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 40, + "indexed": false, + "name": "_participator", + "nodeType": "VariableDeclaration", + "scope": 46, + "src": "538:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 39, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "538:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 42, + "indexed": false, + "name": "_hashedSecret", + "nodeType": "VariableDeclaration", + "scope": 46, + "src": "570:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 41, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "570:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 44, + "indexed": false, + "name": "_value", + "nodeType": "VariableDeclaration", + "scope": 46, + "src": "601:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 43, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "601:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "499:122:0" + }, + "src": "481:141:0" + }, + { + "anonymous": false, + "id": 60, + "name": "Initiated", + "nodeType": "EventDefinition", + "parameters": { + "id": 59, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 48, + "indexed": false, + "name": "_initTimestamp", + "nodeType": "VariableDeclaration", + "scope": 60, + "src": "652:19:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 47, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "652:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 50, + "indexed": false, + "name": "_refundTime", + "nodeType": "VariableDeclaration", + "scope": 60, + "src": "681:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 49, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "681:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 52, + "indexed": false, + "name": "_hashedSecret", + "nodeType": "VariableDeclaration", + "scope": 60, + "src": "707:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 51, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "707:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 54, + "indexed": false, + "name": "_participant", + "nodeType": "VariableDeclaration", + "scope": 60, + "src": "738:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 53, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "738:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 56, + "indexed": false, + "name": "_initiator", + "nodeType": "VariableDeclaration", + "scope": 60, + "src": "768:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 55, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "768:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 58, + "indexed": false, + "name": "_funds", + "nodeType": "VariableDeclaration", + "scope": 60, + "src": "796:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 57, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "796:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "642:174:0" + }, + "src": "627:190:0" + }, + { + "body": { + "id": 63, + "nodeType": "Block", + "src": "852:2:0", + "statements": [] + }, + "id": 64, + "implemented": true, + "isConstructor": true, + "isDeclaredConst": false, + "modifiers": [], + "name": "AtomicSwap", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 61, + "nodeType": "ParameterList", + "parameters": [], + "src": "842:2:0" + }, + "payable": false, + "returnParameters": { + "id": 62, + "nodeType": "ParameterList", + "parameters": [], + "src": "852:0:0" + }, + "scope": 454, + "src": "823:31:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 93, + "nodeType": "Block", + "src": "909:179:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 80, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 69, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 515, + "src": "927:5:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 70, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "timestamp", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "927:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 79, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 71, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "945:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 73, + "indexExpression": { + "argumentTypes": null, + "id": 72, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 66, + "src": "951:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "945:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 74, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "initTimestamp", + "nodeType": "MemberAccess", + "referencedDeclaration": 7, + "src": "945:34:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 75, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "982:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 77, + "indexExpression": { + "argumentTypes": null, + "id": 76, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 66, + "src": "988:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "982:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 78, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "refundTime", + "nodeType": "MemberAccess", + "referencedDeclaration": 9, + "src": "982:31:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "945:68:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "927:86:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 68, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 526, + "src": "919:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 81, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "919:95:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 82, + "nodeType": "ExpressionStatement", + "src": "919:95:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 89, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 84, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "1032:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 86, + "indexExpression": { + "argumentTypes": null, + "id": 85, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 66, + "src": "1038:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1032:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 87, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "emptied", + "nodeType": "MemberAccess", + "referencedDeclaration": 21, + "src": "1032:28:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 88, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1064:5:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "src": "1032:37:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 83, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 526, + "src": "1024:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 90, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1024:46:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 91, + "nodeType": "ExpressionStatement", + "src": "1024:46:0" + }, + { + "id": 92, + "nodeType": "PlaceholderStatement", + "src": "1080:1:0" + } + ] + }, + "id": 94, + "name": "isRefundable", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 67, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 66, + "name": "_hashedSecret", + "nodeType": "VariableDeclaration", + "scope": 94, + "src": "886:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 65, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "886:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "885:23:0" + }, + "src": "864:224:0", + "visibility": "internal" + }, + { + "body": { + "id": 133, + "nodeType": "Block", + "src": "1160:230:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "id": 105, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 102, + "name": "_secret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 98, + "src": "1185:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 101, + "name": "sha256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 530, + "src": "1178:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_sha256_pure$__$returns$_t_bytes32_$", + "typeString": "function () pure returns (bytes32)" + } + }, + "id": 103, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1178:15:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 104, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 96, + "src": "1197:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "1178:32:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 100, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 526, + "src": "1170:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 106, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1170:41:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 107, + "nodeType": "ExpressionStatement", + "src": "1170:41:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 120, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 109, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 515, + "src": "1229:5:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 110, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "timestamp", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1229:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 119, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 111, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "1247:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 113, + "indexExpression": { + "argumentTypes": null, + "id": 112, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 96, + "src": "1253:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1247:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 114, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "initTimestamp", + "nodeType": "MemberAccess", + "referencedDeclaration": 7, + "src": "1247:34:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 115, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "1284:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 117, + "indexExpression": { + "argumentTypes": null, + "id": 116, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 96, + "src": "1290:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1284:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 118, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "refundTime", + "nodeType": "MemberAccess", + "referencedDeclaration": 9, + "src": "1284:31:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1247:68:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1229:86:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 108, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 526, + "src": "1221:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 121, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1221:95:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 122, + "nodeType": "ExpressionStatement", + "src": "1221:95:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 129, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 124, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "1334:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 126, + "indexExpression": { + "argumentTypes": null, + "id": 125, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 96, + "src": "1340:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1334:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 127, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "emptied", + "nodeType": "MemberAccess", + "referencedDeclaration": 21, + "src": "1334:28:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 128, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1366:5:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "src": "1334:37:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 123, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 526, + "src": "1326:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 130, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1326:46:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 131, + "nodeType": "ExpressionStatement", + "src": "1326:46:0" + }, + { + "id": 132, + "nodeType": "PlaceholderStatement", + "src": "1382:1:0" + } + ] + }, + "id": 134, + "name": "isRedeemable", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 99, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 96, + "name": "_hashedSecret", + "nodeType": "VariableDeclaration", + "scope": 134, + "src": "1120:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 95, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1120:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 98, + "name": "_secret", + "nodeType": "VariableDeclaration", + "scope": 134, + "src": "1143:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 97, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1143:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1119:40:0" + }, + "src": "1098:292:0", + "visibility": "internal" + }, + { + "body": { + "id": 149, + "nodeType": "Block", + "src": "1444:81:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 145, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 139, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 523, + "src": "1462:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 140, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1462:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 141, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "1476:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 143, + "indexExpression": { + "argumentTypes": null, + "id": 142, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 136, + "src": "1482:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1476:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 144, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "initiator", + "nodeType": "MemberAccess", + "referencedDeclaration": 15, + "src": "1476:30:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "1462:44:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 138, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 526, + "src": "1454:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 146, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1454:53:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 147, + "nodeType": "ExpressionStatement", + "src": "1454:53:0" + }, + { + "id": 148, + "nodeType": "PlaceholderStatement", + "src": "1517:1:0" + } + ] + }, + "id": 150, + "name": "isInitiator", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 137, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 136, + "name": "_hashedSecret", + "nodeType": "VariableDeclaration", + "scope": 150, + "src": "1421:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 135, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1421:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1420:23:0" + }, + "src": "1400:125:0", + "visibility": "internal" + }, + { + "body": { + "id": 165, + "nodeType": "Block", + "src": "1582:78:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + }, + "id": 161, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 155, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "1600:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 157, + "indexExpression": { + "argumentTypes": null, + "id": 156, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 152, + "src": "1606:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1600:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 158, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "state", + "nodeType": "MemberAccess", + "referencedDeclaration": 23, + "src": "1600:26:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 159, + "name": "State", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5, + "src": "1630:5:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_State_$5_$", + "typeString": "type(enum AtomicSwap.State)" + } + }, + "id": 160, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "Empty", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1630:11:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "src": "1600:41:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 154, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 526, + "src": "1592:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 162, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1592:50:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 163, + "nodeType": "ExpressionStatement", + "src": "1592:50:0" + }, + { + "id": 164, + "nodeType": "PlaceholderStatement", + "src": "1652:1:0" + } + ] + }, + "id": 166, + "name": "isNotInitiated", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 153, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 152, + "name": "_hashedSecret", + "nodeType": "VariableDeclaration", + "scope": 166, + "src": "1559:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 151, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1559:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1558:23:0" + }, + "src": "1535:125:0", + "visibility": "internal" + }, + { + "body": { + "id": 245, + "nodeType": "Block", + "src": "1820:597:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 183, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 178, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "1830:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 180, + "indexExpression": { + "argumentTypes": null, + "id": 179, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 170, + "src": "1836:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1830:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 181, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "refundTime", + "nodeType": "MemberAccess", + "referencedDeclaration": 9, + "src": "1830:31:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 182, + "name": "_refundTime", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 168, + "src": "1864:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1830:45:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 184, + "nodeType": "ExpressionStatement", + "src": "1830:45:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 191, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 185, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "1885:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 187, + "indexExpression": { + "argumentTypes": null, + "id": 186, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 170, + "src": "1891:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1885:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 188, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "initTimestamp", + "nodeType": "MemberAccess", + "referencedDeclaration": 7, + "src": "1885:34:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 189, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 515, + "src": "1922:5:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 190, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "timestamp", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1922:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1885:52:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 192, + "nodeType": "ExpressionStatement", + "src": "1885:52:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 198, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 193, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "1947:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 195, + "indexExpression": { + "argumentTypes": null, + "id": 194, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 170, + "src": "1953:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1947:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 196, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "hashedSecret", + "nodeType": "MemberAccess", + "referencedDeclaration": 11, + "src": "1947:33:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 197, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 170, + "src": "1983:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "1947:49:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "id": 199, + "nodeType": "ExpressionStatement", + "src": "1947:49:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 205, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 200, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "2006:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 202, + "indexExpression": { + "argumentTypes": null, + "id": 201, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 170, + "src": "2012:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2006:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 203, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "participant", + "nodeType": "MemberAccess", + "referencedDeclaration": 17, + "src": "2006:32:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 204, + "name": "_participant", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 172, + "src": "2041:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "2006:47:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 206, + "nodeType": "ExpressionStatement", + "src": "2006:47:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 213, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 207, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "2063:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 209, + "indexExpression": { + "argumentTypes": null, + "id": 208, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 170, + "src": "2069:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2063:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 210, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "initiator", + "nodeType": "MemberAccess", + "referencedDeclaration": 15, + "src": "2063:30:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 211, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 523, + "src": "2096:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 212, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2096:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "2063:43:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 214, + "nodeType": "ExpressionStatement", + "src": "2063:43:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 221, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 215, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "2116:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 217, + "indexExpression": { + "argumentTypes": null, + "id": 216, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 170, + "src": "2122:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2116:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 218, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "state", + "nodeType": "MemberAccess", + "referencedDeclaration": 23, + "src": "2116:26:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 219, + "name": "State", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5, + "src": "2145:5:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_State_$5_$", + "typeString": "type(enum AtomicSwap.State)" + } + }, + "id": 220, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "Initiator", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2145:15:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "src": "2116:44:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "id": 222, + "nodeType": "ExpressionStatement", + "src": "2116:44:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 229, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 223, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "2170:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 225, + "indexExpression": { + "argumentTypes": null, + "id": 224, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 170, + "src": "2176:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2170:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 226, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "value", + "nodeType": "MemberAccess", + "referencedDeclaration": 19, + "src": "2170:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 227, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 523, + "src": "2199:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 228, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "value", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2199:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2170:38:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 230, + "nodeType": "ExpressionStatement", + "src": "2170:38:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 232, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "2241:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 234, + "indexExpression": { + "argumentTypes": null, + "id": 233, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 170, + "src": "2247:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2241:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 235, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "initTimestamp", + "nodeType": "MemberAccess", + "referencedDeclaration": 7, + "src": "2241:34:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 236, + "name": "_refundTime", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 168, + "src": "2289:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 237, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 170, + "src": "2314:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 238, + "name": "_participant", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 172, + "src": "2341:12:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 239, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 523, + "src": "2367:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 240, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2367:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 241, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 523, + "src": "2391:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 242, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "value", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2391:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 231, + "name": "Initiated", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 60, + "src": "2218:9:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$_t_bytes32_$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (uint256,uint256,bytes32,address,address,uint256)" + } + }, + "id": 243, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2218:192:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 244, + "nodeType": "ExpressionStatement", + "src": "2218:192:0" + } + ] + }, + "id": 246, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [ + { + "arguments": [ + { + "argumentTypes": null, + "id": 175, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 170, + "src": "1801:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "id": 176, + "modifierName": { + "argumentTypes": null, + "id": 174, + "name": "isNotInitiated", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 166, + "src": "1786:14:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$_t_bytes32_$", + "typeString": "modifier (bytes32)" + } + }, + "nodeType": "ModifierInvocation", + "src": "1786:29:0" + } + ], + "name": "initiate", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 173, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 168, + "name": "_refundTime", + "nodeType": "VariableDeclaration", + "scope": 246, + "src": "1685:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 167, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1685:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 170, + "name": "_hashedSecret", + "nodeType": "VariableDeclaration", + "scope": 246, + "src": "1702:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 169, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1702:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 172, + "name": "_participant", + "nodeType": "VariableDeclaration", + "scope": 246, + "src": "1724:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 171, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1724:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1684:61:0" + }, + "payable": true, + "returnParameters": { + "id": 177, + "nodeType": "ParameterList", + "parameters": [], + "src": "1820:0:0" + }, + "scope": 454, + "src": "1666:751:0", + "stateMutability": "payable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 320, + "nodeType": "Block", + "src": "2578:464:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 263, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 258, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "2588:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 260, + "indexExpression": { + "argumentTypes": null, + "id": 259, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 250, + "src": "2594:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2588:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 261, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "refundTime", + "nodeType": "MemberAccess", + "referencedDeclaration": 9, + "src": "2588:31:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 262, + "name": "_refundTime", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 248, + "src": "2622:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2588:45:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 264, + "nodeType": "ExpressionStatement", + "src": "2588:45:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 271, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 265, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "2643:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 267, + "indexExpression": { + "argumentTypes": null, + "id": 266, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 250, + "src": "2649:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2643:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 268, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "initTimestamp", + "nodeType": "MemberAccess", + "referencedDeclaration": 7, + "src": "2643:34:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 269, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 515, + "src": "2680:5:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 270, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "timestamp", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2680:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2643:52:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 272, + "nodeType": "ExpressionStatement", + "src": "2643:52:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 279, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 273, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "2705:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 275, + "indexExpression": { + "argumentTypes": null, + "id": 274, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 250, + "src": "2711:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2705:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 276, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "participant", + "nodeType": "MemberAccess", + "referencedDeclaration": 17, + "src": "2705:32:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 277, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 523, + "src": "2740:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 278, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2740:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "2705:45:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 280, + "nodeType": "ExpressionStatement", + "src": "2705:45:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 286, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 281, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "2760:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 283, + "indexExpression": { + "argumentTypes": null, + "id": 282, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 250, + "src": "2766:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2760:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 284, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "initiator", + "nodeType": "MemberAccess", + "referencedDeclaration": 15, + "src": "2760:30:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 285, + "name": "_initiator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 252, + "src": "2793:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "2760:43:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 287, + "nodeType": "ExpressionStatement", + "src": "2760:43:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 294, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 288, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "2813:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 290, + "indexExpression": { + "argumentTypes": null, + "id": 289, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 250, + "src": "2819:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2813:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 291, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "value", + "nodeType": "MemberAccess", + "referencedDeclaration": 19, + "src": "2813:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 292, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 523, + "src": "2842:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 293, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "value", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2842:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2813:38:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 295, + "nodeType": "ExpressionStatement", + "src": "2813:38:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 301, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 296, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "2861:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 298, + "indexExpression": { + "argumentTypes": null, + "id": 297, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 250, + "src": "2867:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2861:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 299, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "hashedSecret", + "nodeType": "MemberAccess", + "referencedDeclaration": 11, + "src": "2861:33:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 300, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 250, + "src": "2897:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "2861:49:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "id": 302, + "nodeType": "ExpressionStatement", + "src": "2861:49:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 309, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 303, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "2920:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 305, + "indexExpression": { + "argumentTypes": null, + "id": 304, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 250, + "src": "2926:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2920:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 306, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "state", + "nodeType": "MemberAccess", + "referencedDeclaration": 23, + "src": "2920:26:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 307, + "name": "State", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5, + "src": "2949:5:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_State_$5_$", + "typeString": "type(enum AtomicSwap.State)" + } + }, + "id": 308, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "Participant", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2949:17:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "src": "2920:46:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "id": 310, + "nodeType": "ExpressionStatement", + "src": "2920:46:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 312, + "name": "_initiator", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 252, + "src": "2989:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 313, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 523, + "src": "3000:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 314, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3000:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 315, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 250, + "src": "3011:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 316, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 523, + "src": "3025:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 317, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "value", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3025:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 311, + "name": "Participated", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 46, + "src": "2976:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_bytes32_$_t_uint256_$returns$__$", + "typeString": "function (address,address,bytes32,uint256)" + } + }, + "id": 318, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2976:59:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 319, + "nodeType": "ExpressionStatement", + "src": "2976:59:0" + } + ] + }, + "id": 321, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [ + { + "arguments": [ + { + "argumentTypes": null, + "id": 255, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 250, + "src": "2559:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "id": 256, + "modifierName": { + "argumentTypes": null, + "id": 254, + "name": "isNotInitiated", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 166, + "src": "2544:14:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$_t_bytes32_$", + "typeString": "modifier (bytes32)" + } + }, + "nodeType": "ModifierInvocation", + "src": "2544:29:0" + } + ], + "name": "participate", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 253, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 248, + "name": "_refundTime", + "nodeType": "VariableDeclaration", + "scope": 321, + "src": "2444:16:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 247, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2444:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 250, + "name": "_hashedSecret", + "nodeType": "VariableDeclaration", + "scope": 321, + "src": "2462:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 249, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2462:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 252, + "name": "_initiator", + "nodeType": "VariableDeclaration", + "scope": 321, + "src": "2484:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 251, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2484:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2443:60:0" + }, + "payable": true, + "returnParameters": { + "id": 257, + "nodeType": "ParameterList", + "parameters": [], + "src": "2578:0:0" + }, + "scope": 454, + "src": "2423:619:0", + "stateMutability": "payable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 391, + "nodeType": "Block", + "src": "3172:442:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + }, + "id": 338, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 332, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "3186:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 334, + "indexExpression": { + "argumentTypes": null, + "id": 333, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 325, + "src": "3192:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3186:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 335, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "state", + "nodeType": "MemberAccess", + "referencedDeclaration": 23, + "src": "3186:26:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 336, + "name": "State", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5, + "src": "3216:5:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_State_$5_$", + "typeString": "type(enum AtomicSwap.State)" + } + }, + "id": 337, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "Participant", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3216:17:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "src": "3186:47:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 351, + "nodeType": "IfStatement", + "src": "3182:145:0", + "trueBody": { + "id": 350, + "nodeType": "Block", + "src": "3235:92:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 344, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "3289:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 346, + "indexExpression": { + "argumentTypes": null, + "id": 345, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 325, + "src": "3295:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3289:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 347, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "value", + "nodeType": "MemberAccess", + "referencedDeclaration": 19, + "src": "3289:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 339, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "3249:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 341, + "indexExpression": { + "argumentTypes": null, + "id": 340, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 325, + "src": "3255:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3249:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 342, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "initiator", + "nodeType": "MemberAccess", + "referencedDeclaration": 15, + "src": "3249:30:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 343, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transfer", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3249:39:0", + "typeDescriptions": { + "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 348, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3249:67:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 349, + "nodeType": "ExpressionStatement", + "src": "3249:67:0" + } + ] + } + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + }, + "id": 358, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 352, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "3340:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 354, + "indexExpression": { + "argumentTypes": null, + "id": 353, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 325, + "src": "3346:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3340:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 355, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "state", + "nodeType": "MemberAccess", + "referencedDeclaration": 23, + "src": "3340:26:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 356, + "name": "State", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5, + "src": "3370:5:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_State_$5_$", + "typeString": "type(enum AtomicSwap.State)" + } + }, + "id": 357, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "Initiator", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3370:15:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "src": "3340:45:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 371, + "nodeType": "IfStatement", + "src": "3336:145:0", + "trueBody": { + "id": 370, + "nodeType": "Block", + "src": "3387:94:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 364, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "3443:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 366, + "indexExpression": { + "argumentTypes": null, + "id": 365, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 325, + "src": "3449:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3443:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 367, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "value", + "nodeType": "MemberAccess", + "referencedDeclaration": 19, + "src": "3443:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 359, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "3401:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 361, + "indexExpression": { + "argumentTypes": null, + "id": 360, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 325, + "src": "3407:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3401:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 362, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "participant", + "nodeType": "MemberAccess", + "referencedDeclaration": 17, + "src": "3401:32:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 363, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transfer", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3401:41:0", + "typeDescriptions": { + "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 368, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3401:69:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 369, + "nodeType": "ExpressionStatement", + "src": "3401:69:0" + } + ] + } + }, + { + "expression": { + "argumentTypes": null, + "id": 377, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 372, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "3490:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 374, + "indexExpression": { + "argumentTypes": null, + "id": 373, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 325, + "src": "3496:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3490:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 375, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "emptied", + "nodeType": "MemberAccess", + "referencedDeclaration": 21, + "src": "3490:28:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 376, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3521:4:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "3490:35:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 378, + "nodeType": "ExpressionStatement", + "src": "3490:35:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 380, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 515, + "src": "3544:5:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 381, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "timestamp", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3544:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 379, + "name": "Redeemed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 36, + "src": "3535:8:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 382, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3535:25:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 383, + "nodeType": "ExpressionStatement", + "src": "3535:25:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 389, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 384, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "3570:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 386, + "indexExpression": { + "argumentTypes": null, + "id": 385, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 325, + "src": "3576:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3570:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 387, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "secret", + "nodeType": "MemberAccess", + "referencedDeclaration": 13, + "src": "3570:27:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 388, + "name": "_secret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 323, + "src": "3600:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "3570:37:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "id": 390, + "nodeType": "ExpressionStatement", + "src": "3570:37:0" + } + ] + }, + "id": 392, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [ + { + "arguments": [ + { + "argumentTypes": null, + "id": 328, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 325, + "src": "3144:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 329, + "name": "_secret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 323, + "src": "3159:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "id": 330, + "modifierName": { + "argumentTypes": null, + "id": 327, + "name": "isRedeemable", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 134, + "src": "3131:12:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$_t_bytes32_$_t_bytes32_$", + "typeString": "modifier (bytes32,bytes32)" + } + }, + "nodeType": "ModifierInvocation", + "src": "3131:36:0" + } + ], + "name": "redeem", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 326, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 323, + "name": "_secret", + "nodeType": "VariableDeclaration", + "scope": 392, + "src": "3068:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 322, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3068:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 325, + "name": "_hashedSecret", + "nodeType": "VariableDeclaration", + "scope": 392, + "src": "3085:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 324, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3085:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3067:40:0" + }, + "payable": false, + "returnParameters": { + "id": 331, + "nodeType": "ParameterList", + "parameters": [], + "src": "3172:0:0" + }, + "scope": 454, + "src": "3052:562:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 452, + "nodeType": "Block", + "src": "3715:395:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + }, + "id": 406, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 400, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "3729:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 402, + "indexExpression": { + "argumentTypes": null, + "id": 401, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 394, + "src": "3735:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3729:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 403, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "state", + "nodeType": "MemberAccess", + "referencedDeclaration": 23, + "src": "3729:26:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 404, + "name": "State", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5, + "src": "3759:5:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_State_$5_$", + "typeString": "type(enum AtomicSwap.State)" + } + }, + "id": 405, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "Participant", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3759:17:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "src": "3729:47:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 419, + "nodeType": "IfStatement", + "src": "3725:147:0", + "trueBody": { + "id": 418, + "nodeType": "Block", + "src": "3778:94:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 412, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "3834:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 414, + "indexExpression": { + "argumentTypes": null, + "id": 413, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 394, + "src": "3840:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3834:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 415, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "value", + "nodeType": "MemberAccess", + "referencedDeclaration": 19, + "src": "3834:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 407, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "3792:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 409, + "indexExpression": { + "argumentTypes": null, + "id": 408, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 394, + "src": "3798:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3792:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 410, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "participant", + "nodeType": "MemberAccess", + "referencedDeclaration": 17, + "src": "3792:32:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 411, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transfer", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3792:41:0", + "typeDescriptions": { + "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 416, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3792:69:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 417, + "nodeType": "ExpressionStatement", + "src": "3792:69:0" + } + ] + } + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + }, + "id": 426, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 420, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "3885:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 422, + "indexExpression": { + "argumentTypes": null, + "id": 421, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 394, + "src": "3891:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3885:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 423, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "state", + "nodeType": "MemberAccess", + "referencedDeclaration": 23, + "src": "3885:26:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 424, + "name": "State", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5, + "src": "3915:5:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_State_$5_$", + "typeString": "type(enum AtomicSwap.State)" + } + }, + "id": 425, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "Initiator", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3915:15:0", + "typeDescriptions": { + "typeIdentifier": "t_enum$_State_$5", + "typeString": "enum AtomicSwap.State" + } + }, + "src": "3885:45:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 439, + "nodeType": "IfStatement", + "src": "3881:143:0", + "trueBody": { + "id": 438, + "nodeType": "Block", + "src": "3932:92:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 432, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "3986:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 434, + "indexExpression": { + "argumentTypes": null, + "id": 433, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 394, + "src": "3992:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3986:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 435, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "value", + "nodeType": "MemberAccess", + "referencedDeclaration": 19, + "src": "3986:26:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 427, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "3946:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 429, + "indexExpression": { + "argumentTypes": null, + "id": 428, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 394, + "src": "3952:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3946:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 430, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "initiator", + "nodeType": "MemberAccess", + "referencedDeclaration": 15, + "src": "3946:30:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 431, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transfer", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3946:39:0", + "typeDescriptions": { + "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 436, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3946:67:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 437, + "nodeType": "ExpressionStatement", + "src": "3946:67:0" + } + ] + } + }, + { + "expression": { + "argumentTypes": null, + "id": 445, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 440, + "name": "swaps", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 28, + "src": "4033:5:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Swap_$24_storage_$", + "typeString": "mapping(bytes32 => struct AtomicSwap.Swap storage ref)" + } + }, + "id": 442, + "indexExpression": { + "argumentTypes": null, + "id": 441, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 394, + "src": "4039:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "4033:20:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Swap_$24_storage", + "typeString": "struct AtomicSwap.Swap storage ref" + } + }, + "id": 443, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "emptied", + "nodeType": "MemberAccess", + "referencedDeclaration": 21, + "src": "4033:28:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 444, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4064:4:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "4033:35:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 446, + "nodeType": "ExpressionStatement", + "src": "4033:35:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 448, + "name": "block", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 515, + "src": "4087:5:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_block", + "typeString": "block" + } + }, + "id": 449, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "timestamp", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "4087:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 447, + "name": "Refunded", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 32, + "src": "4078:8:0", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 450, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4078:25:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 451, + "nodeType": "ExpressionStatement", + "src": "4078:25:0" + } + ] + }, + "id": 453, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [ + { + "arguments": [ + { + "argumentTypes": null, + "id": 397, + "name": "_hashedSecret", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 394, + "src": "3695:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "id": 398, + "modifierName": { + "argumentTypes": null, + "id": 396, + "name": "isRefundable", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 94, + "src": "3682:12:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$_t_bytes32_$", + "typeString": "modifier (bytes32)" + } + }, + "nodeType": "ModifierInvocation", + "src": "3682:27:0" + } + ], + "name": "refund", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 395, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 394, + "name": "_hashedSecret", + "nodeType": "VariableDeclaration", + "scope": 453, + "src": "3636:21:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 393, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3636:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "3635:23:0" + }, + "payable": false, + "returnParameters": { + "id": 399, + "nodeType": "ParameterList", + "parameters": [], + "src": "3715:0:0" + }, + "scope": 454, + "src": "3620:490:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 455, + "src": "26:4086:0" + } + ], + "src": "0:4112:0" + }, + "compiler": { + "name": "solc", + "version": "0.4.19+commit.c4cbbb05.Emscripten.clang" + }, "networks": {}, - "schema_version": "0.0.5", - "updated_at": 1508414518662 + "schemaVersion": "2.0.0", + "updatedAt": "2018-03-05T21:40:11.700Z" } \ No newline at end of file diff --git a/build/contracts/Migrations.json b/build/contracts/Migrations.json index 94bcaeb..368928e 100644 --- a/build/contracts/Migrations.json +++ b/build/contracts/Migrations.json @@ -1,19 +1,6 @@ { - "contract_name": "Migrations", + "contractName": "Migrations", "abi": [ - { - "constant": false, - "inputs": [ - { - "name": "new_address", - "type": "address" - } - ], - "name": "upgrade", - "outputs": [], - "payable": false, - "type": "function" - }, { "constant": true, "inputs": [], @@ -25,6 +12,7 @@ } ], "payable": false, + "stateMutability": "view", "type": "function" }, { @@ -38,8 +26,15 @@ } ], "payable": false, + "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, { "constant": false, "inputs": [ @@ -51,16 +46,1327 @@ "name": "setCompleted", "outputs": [], "payable": false, + "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [], + "constant": false, + "inputs": [ + { + "name": "newAddress", + "type": "address" + } + ], + "name": "upgrade", + "outputs": [], "payable": false, - "type": "constructor" + "stateMutability": "nonpayable", + "type": "function" } ], - "unlinked_binary": "0x6060604052341561000f57600080fd5b5b60008054600160a060020a03191633600160a060020a03161790555b5b6101e58061003c6000396000f300606060405263ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630900f010811461005e578063445df0ac1461007f5780638da5cb5b146100a4578063fdacd576146100d3575b600080fd5b341561006957600080fd5b61007d600160a060020a03600435166100eb565b005b341561008a57600080fd5b610092610182565b60405190815260200160405180910390f35b34156100af57600080fd5b6100b7610188565b604051600160a060020a03909116815260200160405180910390f35b34156100de57600080fd5b61007d600435610197565b005b6000805433600160a060020a039081169116141561017c5781905080600160a060020a031663fdacd5766001546040517c010000000000000000000000000000000000000000000000000000000063ffffffff84160281526004810191909152602401600060405180830381600087803b151561016757600080fd5b6102c65a03f1151561017857600080fd5b5050505b5b5b5050565b60015481565b600054600160a060020a031681565b60005433600160a060020a03908116911614156101b45760018190555b5b5b505600a165627a7a7230582004af8f1ac2ffcbea11ca292cc7aa8a232cd2d7a984ed8a5123f6dc6371db9ccc0029", + "bytecode": "0x6060604052341561000f57600080fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506102db8061005e6000396000f300606060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630900f01014610067578063445df0ac146100a05780638da5cb5b146100c9578063fdacd5761461011e575b600080fd5b341561007257600080fd5b61009e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610141565b005b34156100ab57600080fd5b6100b3610224565b6040518082815260200191505060405180910390f35b34156100d457600080fd5b6100dc61022a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561012957600080fd5b61013f600480803590602001909190505061024f565b005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610220578190508073ffffffffffffffffffffffffffffffffffffffff1663fdacd5766001546040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b151561020b57600080fd5b6102c65a03f1151561021c57600080fd5b5050505b5050565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102ac57806001819055505b505600a165627a7a7230582078b64ed9a2a47b6dd5313aca550cf45a71125b26e627bf1e5327528fecc43caa0029", + "deployedBytecode": "0x606060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630900f01014610067578063445df0ac146100a05780638da5cb5b146100c9578063fdacd5761461011e575b600080fd5b341561007257600080fd5b61009e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610141565b005b34156100ab57600080fd5b6100b3610224565b6040518082815260200191505060405180910390f35b34156100d457600080fd5b6100dc61022a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561012957600080fd5b61013f600480803590602001909190505061024f565b005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610220578190508073ffffffffffffffffffffffffffffffffffffffff1663fdacd5766001546040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b151561020b57600080fd5b6102c65a03f1151561021c57600080fd5b5050505b5050565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102ac57806001819055505b505600a165627a7a7230582078b64ed9a2a47b6dd5313aca550cf45a71125b26e627bf1e5327528fecc43caa0029", + "sourceMap": "25:493:0:-;;;183:58;;;;;;;;226:10;218:5;;:18;;;;;;;;;;;;;;;;;;25:493;;;;;;", + "deployedSourceMap": "25:493:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;353:163;;;;;;;;;;;;;;;;;;;;;;;;;;;;73:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;245:104;;;;;;;;;;;;;;;;;;;;;;;;;;353:163;414:19;160:5;;;;;;;;;;;146:19;;:10;:19;;;142:32;;;447:10;414:44;;464:8;:21;;;486:24;;464:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;142:32;353:163;;:::o;73:36::-;;;;:::o;49:20::-;;;;;;;;;;;;;:::o;245:104::-;160:5;;;;;;;;;;;146:19;;:10;:19;;;142:32;;;335:9;308:24;:36;;;;142:32;245:104;:::o", + "source": "pragma solidity ^0.4.4;\n\ncontract Migrations {\n address public owner;\n uint public last_completed_migration;\n\n modifier restricted() {\n if (msg.sender == owner)\n _;\n }\n\n function Migrations() public {\n owner = msg.sender;\n }\n\n function setCompleted(uint completed) public restricted { \n last_completed_migration = completed;\n }\n\n function upgrade(address newAddress) public restricted {\n Migrations upgraded = Migrations(newAddress);\n upgraded.setCompleted(last_completed_migration);\n }\n}\n", + "sourcePath": "/Users/glendc/Projects/AltCoinExchange/ethatomicswap/contracts/Migrations.sol", + "ast": { + "absolutePath": "/Users/glendc/Projects/AltCoinExchange/ethatomicswap/contracts/Migrations.sol", + "exportedSymbols": { + "Migrations": [ + 56 + ] + }, + "id": 57, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1, + "literals": [ + "solidity", + "^", + "0.4", + ".4" + ], + "nodeType": "PragmaDirective", + "src": "0:23:0" + }, + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 56, + "linearizedBaseContracts": [ + 56 + ], + "name": "Migrations", + "nodeType": "ContractDefinition", + "nodes": [ + { + "constant": false, + "id": 3, + "name": "owner", + "nodeType": "VariableDeclaration", + "scope": 56, + "src": "49:20:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "49:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 5, + "name": "last_completed_migration", + "nodeType": "VariableDeclaration", + "scope": 56, + "src": "73:36:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "73:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "public" + }, + { + "body": { + "id": 13, + "nodeType": "Block", + "src": "136:43:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 10, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 7, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "146:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 8, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "146:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 9, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "160:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "146:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 12, + "nodeType": "IfStatement", + "src": "142:32:0", + "trueBody": { + "id": 11, + "nodeType": "PlaceholderStatement", + "src": "173:1:0" + } + } + ] + }, + "id": 14, + "name": "restricted", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 6, + "nodeType": "ParameterList", + "parameters": [], + "src": "133:2:0" + }, + "src": "114:65:0", + "visibility": "internal" + }, + { + "body": { + "id": 22, + "nodeType": "Block", + "src": "212:29:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 20, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 17, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "218:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 18, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "226:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 19, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "226:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "218:18:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 21, + "nodeType": "ExpressionStatement", + "src": "218:18:0" + } + ] + }, + "id": 23, + "implemented": true, + "isConstructor": true, + "isDeclaredConst": false, + "modifiers": [], + "name": "Migrations", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15, + "nodeType": "ParameterList", + "parameters": [], + "src": "202:2:0" + }, + "payable": false, + "returnParameters": { + "id": 16, + "nodeType": "ParameterList", + "parameters": [], + "src": "212:0:0" + }, + "scope": 56, + "src": "183:58:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 34, + "nodeType": "Block", + "src": "301:48:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 32, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 30, + "name": "last_completed_migration", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5, + "src": "308:24:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 31, + "name": "completed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25, + "src": "335:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "308:36:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 33, + "nodeType": "ExpressionStatement", + "src": "308:36:0" + } + ] + }, + "id": 35, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [ + { + "arguments": [], + "id": 28, + "modifierName": { + "argumentTypes": null, + "id": 27, + "name": "restricted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14, + "src": "290:10:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "290:10:0" + } + ], + "name": "setCompleted", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 26, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 25, + "name": "completed", + "nodeType": "VariableDeclaration", + "scope": 35, + "src": "267:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 24, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "267:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "266:16:0" + }, + "payable": false, + "returnParameters": { + "id": 29, + "nodeType": "ParameterList", + "parameters": [], + "src": "301:0:0" + }, + "scope": 56, + "src": "245:104:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 54, + "nodeType": "Block", + "src": "408:108:0", + "statements": [ + { + "assignments": [ + 43 + ], + "declarations": [ + { + "constant": false, + "id": 43, + "name": "upgraded", + "nodeType": "VariableDeclaration", + "scope": 55, + "src": "414:19:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Migrations_$56", + "typeString": "contract Migrations" + }, + "typeName": { + "contractScope": null, + "id": 42, + "name": "Migrations", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 56, + "src": "414:10:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Migrations_$56", + "typeString": "contract Migrations" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 47, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 45, + "name": "newAddress", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 37, + "src": "447:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 44, + "name": "Migrations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 56, + "src": "436:10:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Migrations_$56_$", + "typeString": "type(contract Migrations)" + } + }, + "id": 46, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "436:22:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Migrations_$56", + "typeString": "contract Migrations" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "414:44:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 51, + "name": "last_completed_migration", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5, + "src": "486:24:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 48, + "name": "upgraded", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 43, + "src": "464:8:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Migrations_$56", + "typeString": "contract Migrations" + } + }, + "id": 50, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "setCompleted", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "464:21:0", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256) external" + } + }, + "id": 52, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "464:47:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 53, + "nodeType": "ExpressionStatement", + "src": "464:47:0" + } + ] + }, + "id": 55, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [ + { + "arguments": [], + "id": 40, + "modifierName": { + "argumentTypes": null, + "id": 39, + "name": "restricted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14, + "src": "397:10:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "397:10:0" + } + ], + "name": "upgrade", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 38, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 37, + "name": "newAddress", + "nodeType": "VariableDeclaration", + "scope": 55, + "src": "370:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 36, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "370:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "369:20:0" + }, + "payable": false, + "returnParameters": { + "id": 41, + "nodeType": "ParameterList", + "parameters": [], + "src": "408:0:0" + }, + "scope": 56, + "src": "353:163:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 57, + "src": "25:493:0" + } + ], + "src": "0:519:0" + }, + "legacyAST": { + "absolutePath": "/Users/glendc/Projects/AltCoinExchange/ethatomicswap/contracts/Migrations.sol", + "exportedSymbols": { + "Migrations": [ + 56 + ] + }, + "id": 57, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1, + "literals": [ + "solidity", + "^", + "0.4", + ".4" + ], + "nodeType": "PragmaDirective", + "src": "0:23:0" + }, + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 56, + "linearizedBaseContracts": [ + 56 + ], + "name": "Migrations", + "nodeType": "ContractDefinition", + "nodes": [ + { + "constant": false, + "id": 3, + "name": "owner", + "nodeType": "VariableDeclaration", + "scope": 56, + "src": "49:20:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "49:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 5, + "name": "last_completed_migration", + "nodeType": "VariableDeclaration", + "scope": 56, + "src": "73:36:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "73:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "public" + }, + { + "body": { + "id": 13, + "nodeType": "Block", + "src": "136:43:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 10, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 7, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "146:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 8, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "146:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 9, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "160:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "146:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 12, + "nodeType": "IfStatement", + "src": "142:32:0", + "trueBody": { + "id": 11, + "nodeType": "PlaceholderStatement", + "src": "173:1:0" + } + } + ] + }, + "id": 14, + "name": "restricted", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 6, + "nodeType": "ParameterList", + "parameters": [], + "src": "133:2:0" + }, + "src": "114:65:0", + "visibility": "internal" + }, + { + "body": { + "id": 22, + "nodeType": "Block", + "src": "212:29:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 20, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 17, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "218:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 18, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 68, + "src": "226:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 19, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "226:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "218:18:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 21, + "nodeType": "ExpressionStatement", + "src": "218:18:0" + } + ] + }, + "id": 23, + "implemented": true, + "isConstructor": true, + "isDeclaredConst": false, + "modifiers": [], + "name": "Migrations", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 15, + "nodeType": "ParameterList", + "parameters": [], + "src": "202:2:0" + }, + "payable": false, + "returnParameters": { + "id": 16, + "nodeType": "ParameterList", + "parameters": [], + "src": "212:0:0" + }, + "scope": 56, + "src": "183:58:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 34, + "nodeType": "Block", + "src": "301:48:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 32, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 30, + "name": "last_completed_migration", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5, + "src": "308:24:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 31, + "name": "completed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25, + "src": "335:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "308:36:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 33, + "nodeType": "ExpressionStatement", + "src": "308:36:0" + } + ] + }, + "id": 35, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [ + { + "arguments": [], + "id": 28, + "modifierName": { + "argumentTypes": null, + "id": 27, + "name": "restricted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14, + "src": "290:10:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "290:10:0" + } + ], + "name": "setCompleted", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 26, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 25, + "name": "completed", + "nodeType": "VariableDeclaration", + "scope": 35, + "src": "267:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 24, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "267:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "266:16:0" + }, + "payable": false, + "returnParameters": { + "id": 29, + "nodeType": "ParameterList", + "parameters": [], + "src": "301:0:0" + }, + "scope": 56, + "src": "245:104:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 54, + "nodeType": "Block", + "src": "408:108:0", + "statements": [ + { + "assignments": [ + 43 + ], + "declarations": [ + { + "constant": false, + "id": 43, + "name": "upgraded", + "nodeType": "VariableDeclaration", + "scope": 55, + "src": "414:19:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Migrations_$56", + "typeString": "contract Migrations" + }, + "typeName": { + "contractScope": null, + "id": 42, + "name": "Migrations", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 56, + "src": "414:10:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Migrations_$56", + "typeString": "contract Migrations" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 47, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 45, + "name": "newAddress", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 37, + "src": "447:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 44, + "name": "Migrations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 56, + "src": "436:10:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Migrations_$56_$", + "typeString": "type(contract Migrations)" + } + }, + "id": 46, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "436:22:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Migrations_$56", + "typeString": "contract Migrations" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "414:44:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 51, + "name": "last_completed_migration", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5, + "src": "486:24:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 48, + "name": "upgraded", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 43, + "src": "464:8:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Migrations_$56", + "typeString": "contract Migrations" + } + }, + "id": 50, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "setCompleted", + "nodeType": "MemberAccess", + "referencedDeclaration": 35, + "src": "464:21:0", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256) external" + } + }, + "id": 52, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "464:47:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 53, + "nodeType": "ExpressionStatement", + "src": "464:47:0" + } + ] + }, + "id": 55, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [ + { + "arguments": [], + "id": 40, + "modifierName": { + "argumentTypes": null, + "id": 39, + "name": "restricted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14, + "src": "397:10:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "397:10:0" + } + ], + "name": "upgrade", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 38, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 37, + "name": "newAddress", + "nodeType": "VariableDeclaration", + "scope": 55, + "src": "370:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 36, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "370:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "369:20:0" + }, + "payable": false, + "returnParameters": { + "id": 41, + "nodeType": "ParameterList", + "parameters": [], + "src": "408:0:0" + }, + "scope": 56, + "src": "353:163:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 57, + "src": "25:493:0" + } + ], + "src": "0:519:0" + }, + "compiler": { + "name": "solc", + "version": "0.4.19+commit.c4cbbb05.Emscripten.clang" + }, "networks": {}, - "schema_version": "0.0.5", - "updated_at": 1508414518662 + "schemaVersion": "2.0.0", + "updatedAt": "2018-03-05T21:41:44.663Z" } \ No newline at end of file diff --git a/cmd/generateSecret.js b/cmd/generateSecret.js index d0085cd..72b8a00 100644 --- a/cmd/generateSecret.js +++ b/cmd/generateSecret.js @@ -1,9 +1,9 @@ -const RIPEMD160 = require('ripemd160') const crypto = require('crypto') -// Generate random 32byte secret and create RIPEMD160 hash from it +// Generate random 32byte secret and create SHA256 hash from it crypto.randomBytes(32, function(err, buffer) { console.log("\nSecret:\t\t\t", buffer.toString('hex')); - hashedSecret = new RIPEMD160().update(buffer).digest('hex') + hashedSecret = crypto.createHmac('sha256', buffer) + .digest('hex'); console.log("\Hashed Secret:\t\t", hashedSecret, "\n") }); \ No newline at end of file diff --git a/contracts/AtomicSwap.sol b/contracts/AtomicSwap.sol index dba6c85..fc44ecd 100644 --- a/contracts/AtomicSwap.sol +++ b/contracts/AtomicSwap.sol @@ -7,7 +7,7 @@ contract AtomicSwap { struct Swap { uint initTimestamp; uint refundTime; - bytes20 hashedSecret; + bytes32 hashedSecret; bytes32 secret; address initiator; address participant; @@ -16,77 +16,79 @@ contract AtomicSwap { State state; } - mapping(bytes20 => Swap) public swaps; + mapping(bytes32 => Swap) public swaps; - event Refunded(uint _refundTime); + event Refunded(uint _refundTime); event Redeemed(uint _redeemTime); event Participated( address _initiator, address _participator, - bytes20 _hashedSecret, + bytes32 _hashedSecret, uint256 _value ); - event Initiated( - uint _initTimestamp, - uint _refundTime, - bytes20 _hashedSecret, - address _participant, - address _initiator, - uint256 _funds - ); + event Initiated( + uint _initTimestamp, + uint _refundTime, + bytes32 _hashedSecret, + address _participant, + address _initiator, + uint256 _funds + ); - function AtomicSwap() {} + function AtomicSwap() public {} + + modifier isRefundable(bytes32 _hashedSecret) { + require(block.timestamp > swaps[_hashedSecret].initTimestamp + swaps[_hashedSecret].refundTime); + require(swaps[_hashedSecret].emptied == false); + _; + } + + modifier isRedeemable(bytes32 _hashedSecret, bytes32 _secret) { + require(sha256(_secret) == _hashedSecret); + require(block.timestamp < swaps[_hashedSecret].initTimestamp + swaps[_hashedSecret].refundTime); + require(swaps[_hashedSecret].emptied == false); + _; + } - modifier isRefundable(bytes20 _hashedSecret) { - require(block.timestamp > swaps[_hashedSecret].initTimestamp + swaps[_hashedSecret].refundTime); - require(swaps[_hashedSecret].emptied == false); - _; - } - - modifier isRedeemable(bytes20 _hashedSecret, bytes32 _secret) { - require(ripemd160(_secret) == _hashedSecret); - require(block.timestamp < swaps[_hashedSecret].initTimestamp + swaps[_hashedSecret].refundTime); - require(swaps[_hashedSecret].emptied == false); - _; - } - - modifier isInitiator(bytes20 _hashedSecret) { - require(msg.sender == swaps[_hashedSecret].initiator); - _; - } - - modifier isNotInitiated(bytes20 _hashedSecret) { - require(swaps[_hashedSecret].state == State.Empty); - _; - } + modifier isInitiator(bytes32 _hashedSecret) { + require(msg.sender == swaps[_hashedSecret].initiator); + _; + } + + modifier isNotInitiated(bytes32 _hashedSecret) { + require(swaps[_hashedSecret].state == State.Empty); + _; + } - function initiate (uint _refundTime,bytes20 _hashedSecret,address _participant) - payable - isNotInitiated(_hashedSecret) - { - swaps[_hashedSecret].refundTime = _refundTime; - swaps[_hashedSecret].initTimestamp = block.timestamp; - swaps[_hashedSecret].hashedSecret = _hashedSecret; - swaps[_hashedSecret].participant = _participant; - swaps[_hashedSecret].initiator = msg.sender; + function initiate (uint _refundTime,bytes32 _hashedSecret,address _participant) + public + payable + isNotInitiated(_hashedSecret) + { + swaps[_hashedSecret].refundTime = _refundTime; + swaps[_hashedSecret].initTimestamp = block.timestamp; + swaps[_hashedSecret].hashedSecret = _hashedSecret; + swaps[_hashedSecret].participant = _participant; + swaps[_hashedSecret].initiator = msg.sender; swaps[_hashedSecret].state = State.Initiator; swaps[_hashedSecret].value = msg.value; - Initiated( - swaps[_hashedSecret].initTimestamp, - _refundTime, - _hashedSecret, - _participant, - msg.sender, - msg.value - ); - } + Initiated( + swaps[_hashedSecret].initTimestamp, + _refundTime, + _hashedSecret, + _participant, + msg.sender, + msg.value + ); + } - function participate(uint _refundTime, bytes20 _hashedSecret,address _initiator) + function participate(uint _refundTime, bytes32 _hashedSecret,address _initiator) + public payable isNotInitiated(_hashedSecret) { swaps[_hashedSecret].refundTime = _refundTime; - swaps[_hashedSecret].initTimestamp = block.timestamp; + swaps[_hashedSecret].initTimestamp = block.timestamp; swaps[_hashedSecret].participant = msg.sender; swaps[_hashedSecret].initiator = _initiator; swaps[_hashedSecret].value = msg.value; @@ -94,31 +96,33 @@ contract AtomicSwap { swaps[_hashedSecret].state = State.Participant; Participated(_initiator,msg.sender,_hashedSecret,msg.value); } - - function redeem(bytes32 _secret, bytes20 _hashedSecret) - isRedeemable(_hashedSecret, _secret) - { - if(swaps[_hashedSecret].state == State.Participant){ + + function redeem(bytes32 _secret, bytes32 _hashedSecret) + public + isRedeemable(_hashedSecret, _secret) + { + if (swaps[_hashedSecret].state == State.Participant) { swaps[_hashedSecret].initiator.transfer(swaps[_hashedSecret].value); } - if(swaps[_hashedSecret].state == State.Initiator){ + if (swaps[_hashedSecret].state == State.Initiator) { swaps[_hashedSecret].participant.transfer(swaps[_hashedSecret].value); } swaps[_hashedSecret].emptied = true; Redeemed(block.timestamp); swaps[_hashedSecret].secret = _secret; - } + } - function refund(bytes20 _hashedSecret) - isRefundable(_hashedSecret) - { - if(swaps[_hashedSecret].state == State.Participant){ + function refund(bytes32 _hashedSecret) + public + isRefundable(_hashedSecret) + { + if (swaps[_hashedSecret].state == State.Participant) { swaps[_hashedSecret].participant.transfer(swaps[_hashedSecret].value); } - if(swaps[_hashedSecret].state == State.Initiator){ + if (swaps[_hashedSecret].state == State.Initiator) { swaps[_hashedSecret].initiator.transfer(swaps[_hashedSecret].value); } swaps[_hashedSecret].emptied = true; - Refunded(block.timestamp); - } + Refunded(block.timestamp); + } } \ No newline at end of file diff --git a/contracts/Migrations.sol b/contracts/Migrations.sol index 7e7fe8d..64eebf6 100644 --- a/contracts/Migrations.sol +++ b/contracts/Migrations.sol @@ -5,19 +5,20 @@ contract Migrations { uint public last_completed_migration; modifier restricted() { - if (msg.sender == owner) _; + if (msg.sender == owner) + _; } - function Migrations() { + function Migrations() public { owner = msg.sender; } - function setCompleted(uint completed) restricted { + function setCompleted(uint completed) public restricted { last_completed_migration = completed; } - function upgrade(address new_address) restricted { - Migrations upgraded = Migrations(new_address); + function upgrade(address newAddress) public restricted { + Migrations upgraded = Migrations(newAddress); upgraded.setCompleted(last_completed_migration); } } diff --git a/modules/common.js b/modules/common.js index 0a9f485..780b4f7 100644 --- a/modules/common.js +++ b/modules/common.js @@ -1,4 +1,3 @@ -const RIPEMD160 = require('ripemd160'); const crypto = require('crypto'); /** @@ -18,7 +17,8 @@ var Common = function () { var secretBuffer = crypto.randomBytes(32); var secret = secretBuffer.toString('hex'); - var hashedSecret = new RIPEMD160().update(secretBuffer).digest('hex'); + var hashedSecret = crypto.createHmac('sha256', secretBuffer) + .digest('hex'); console.log("\nSecret:\t\t\t", secret); console.log("\Hashed Secret:\t\t", hashedSecret, "\n"); diff --git a/package-lock.json b/package-lock.json index 3c32eda..65258b7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,7 +47,7 @@ "async-limiter": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", - "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==" + "integrity": "sha1-ePrtjD0HSrgfIrTphdeehzj3IPg=" }, "asynckit": { "version": "0.4.0", @@ -86,7 +86,7 @@ "bignumber.js": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-4.1.0.tgz", - "integrity": "sha512-eJzYkFYy9L4JzXsbymsFn3p54D+llV27oTQ+ziJG7WFRheJcNZilgVXMG0LoZtlQSKBsJdWtLFqOD0u+U0jZKA==" + "integrity": "sha1-228UBnwUC9RmJIFaeRbJLZtsJLE=" }, "bl": { "version": "1.2.1", @@ -112,7 +112,7 @@ "bn.js": { "version": "4.11.8", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + "integrity": "sha1-LN4J617jQfSEdGuwMJsyU7GxRC8=" }, "body-parser": { "version": "1.18.2", @@ -201,7 +201,7 @@ "cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "integrity": "sha1-h2Dk7MJy9MNjUy+SbYdKriwTl94=", "requires": { "inherits": "2.0.3", "safe-buffer": "5.1.1" @@ -246,7 +246,7 @@ "content-type": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", - "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" + "integrity": "sha1-4TjMdeBAxyexlm/l5fjJruJW/js=" }, "cookie": { "version": "0.3.1", @@ -307,18 +307,13 @@ "boom": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", - "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", + "integrity": "sha1-XdnabuOl8wIHdDYpDLcX0/SlTgI=", "requires": { "hoek": "4.2.0" } } } }, - "crypto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/crypto/-/crypto-1.0.1.tgz", - "integrity": "sha512-VxBKmeNcqQdiUQUW2Tzq0t377b54N2bMtXO/qiLa+6eRRmmC4qT3D4OnTGoT/U6O9aklQ/jTwbOtRMTTY8G0Ig==" - }, "crypto-js": { "version": "3.1.9-1", "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.1.9-1.tgz", @@ -366,7 +361,7 @@ "decompress-tar": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/decompress-tar/-/decompress-tar-4.1.1.tgz", - "integrity": "sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ==", + "integrity": "sha1-cYy9P8sWIJcW5womuE57pFkuWvE=", "requires": { "file-type": "5.2.0", "is-stream": "1.1.0", @@ -376,7 +371,7 @@ "decompress-tarbz2": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz", - "integrity": "sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A==", + "integrity": "sha1-MIKluIDqQEOBY0nzeLVsUWvho5s=", "requires": { "decompress-tar": "4.1.1", "file-type": "6.2.0", @@ -388,14 +383,14 @@ "file-type": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/file-type/-/file-type-6.2.0.tgz", - "integrity": "sha512-YPcTBDV+2Tm0VqjybVd32MHdlEGAtuxS3VAYsumFokDSMG+ROT5wawGlnHDoz7bfMcMDt9hxuXvXwoKUx2fkOg==" + "integrity": "sha1-5QzXXTVv/tTjBtxPW89Sp5kDqRk=" } } }, "decompress-targz": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/decompress-targz/-/decompress-targz-4.1.1.tgz", - "integrity": "sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w==", + "integrity": "sha1-wJvDXE0R894J8tLaU+neI+fOHu4=", "requires": { "decompress-tar": "4.1.1", "file-type": "5.2.0", @@ -457,7 +452,7 @@ "diff": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/diff/-/diff-3.3.1.tgz", - "integrity": "sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww==" + "integrity": "sha1-qoVnpu7QPFMfyJ0/cRzQ5SWd7HU=" }, "dom-walk": { "version": "0.1.1", @@ -528,7 +523,7 @@ "eth-lib": { "version": "0.1.27", "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.1.27.tgz", - "integrity": "sha512-B8czsfkJYzn2UIEMwjc7Mbj+Cy72V+/OXH/tb44LV8jhrjizQJJ325xMOMyk3+ETa6r6oi0jsUY14+om8mQMWA==", + "integrity": "sha1-8LD9FE+GXS1r+CV6QABPLnXKHdY=", "requires": { "bn.js": "4.11.8", "elliptic": "6.4.0", @@ -606,7 +601,7 @@ "setprototypeof": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", - "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" + "integrity": "sha1-0L2FU2iHtv58DYGMuWLZ2RxU5lY=" } } }, @@ -737,7 +732,7 @@ "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "integrity": "sha1-wZyd+aAocC1nhhI4SmVSQExjbRU=", "requires": { "fs.realpath": "1.0.0", "inflight": "1.0.6", @@ -759,7 +754,7 @@ "got": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/got/-/got-7.1.0.tgz", - "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==", + "integrity": "sha1-BUUP2ECU5rvqVvRRpDqcKJFmOFo=", "requires": { "decompress-response": "3.3.0", "duplexer3": "0.1.4", @@ -790,7 +785,7 @@ "growl": { "version": "1.10.3", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.3.tgz", - "integrity": "sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q==" + "integrity": "sha1-GSa6kM8+3+KttJJ/WIC8IsZseQ8=" }, "har-schema": { "version": "2.0.0", @@ -819,7 +814,7 @@ "has-to-string-tag-x": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", - "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", + "integrity": "sha1-oEWrOD17SyASoAFIqwql8pAETU0=", "requires": { "has-symbol-support-x": "1.4.1" } @@ -835,7 +830,7 @@ "hash.js": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", - "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "integrity": "sha1-NA3tvmKQGHFRweodd3o0SJNd+EY=", "requires": { "inherits": "2.0.3", "minimalistic-assert": "1.0.0" @@ -844,7 +839,7 @@ "hawk": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", - "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", + "integrity": "sha1-r02RTrBl+bXOTZ0RwcshJu7MMDg=", "requires": { "boom": "4.3.1", "cryptiles": "3.1.2", @@ -901,7 +896,7 @@ "iconv-lite": { "version": "0.4.19", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", - "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" + "integrity": "sha1-90aPYBNfXl2tM5nAqBvpoWA6CCs=" }, "ieee754": { "version": "1.1.8", @@ -980,7 +975,7 @@ "isurl": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz", - "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", + "integrity": "sha1-sn9PSfPNqj6kSgpbfzRi5u3DnWc=", "requires": { "has-to-string-tag-x": "1.4.1", "is-object": "1.0.1" @@ -1106,7 +1101,7 @@ "mime": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", - "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" + "integrity": "sha1-Eh+evEnjdm8xGnbh+hyAA8SwOqY=" }, "mime-db": { "version": "1.30.0", @@ -1147,7 +1142,7 @@ "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", "requires": { "brace-expansion": "1.1.8" } @@ -1230,7 +1225,7 @@ "mz": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", - "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "integrity": "sha1-lQCAV6Vsr63CvGPd5/n/aVWUjjI=", "requires": { "any-promise": "1.3.0", "object-assign": "4.1.1", @@ -1310,7 +1305,7 @@ "p-cancelable": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.3.0.tgz", - "integrity": "sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw==" + "integrity": "sha1-ueEjgAvOu3rBOkeb4ZW1B7mNMPo=" }, "p-finally": { "version": "1.0.0", @@ -1352,7 +1347,7 @@ "pbkdf2": { "version": "3.0.14", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.14.tgz", - "integrity": "sha512-gjsZW9O34fm0R7PaLHRJmLLVfSoesxztjPjE9o6R+qtVJij90ltg1joIovN9GKrRW3t1PzhDDG3UMEMFfZ+1wA==", + "integrity": "sha1-o14TxkeZsGzhUyD0WcIw5o5zut4=", "requires": { "create-hash": "1.1.3", "create-hmac": "1.1.6", @@ -1421,7 +1416,7 @@ "qs": { "version": "6.5.1", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", - "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" + "integrity": "sha1-NJzfbu+J7EXBLX1es/wMhwNDptg=" }, "query-string": { "version": "2.4.2", @@ -1474,7 +1469,7 @@ "request": { "version": "2.83.0", "resolved": "https://registry.npmjs.org/request/-/request-2.83.0.tgz", - "integrity": "sha512-lR3gD69osqm6EYLk9wB/G1W/laGWjzH90t1vEa2xuxHD5KUrSzp9pUSfTm+YC5Nxt2T8nMPEvKlhbQayU7bgFw==", + "integrity": "sha1-ygtl2gLtYpNYh4COb1EDgQNOM1Y=", "requires": { "aws-sign2": "0.7.0", "aws4": "1.6.0", @@ -1511,7 +1506,7 @@ "rimraf": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "integrity": "sha1-LtgVDSShbqhlHm1u8PR8QVjOejY=", "requires": { "glob": "7.1.2" } @@ -1528,7 +1523,7 @@ "safe-buffer": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + "integrity": "sha1-iTMSr2myEj3vcfV4iQAWce6yyFM=" }, "scrypt": { "version": "6.0.3", @@ -1566,7 +1561,7 @@ "send": { "version": "0.16.1", "resolved": "https://registry.npmjs.org/send/-/send-0.16.1.tgz", - "integrity": "sha512-ElCLJdJIKPk6ux/Hocwhk7NFHpI3pVm/IZOYWqUmoxcgeyM+MpxHHKhb8QmlJDX1pU6WrgaHBkVNm73Sv7uc2A==", + "integrity": "sha1-pw4coh0TgsEdDZ9iMd6ygQgNerM=", "requires": { "debug": "2.6.9", "depd": "1.1.1", @@ -1586,7 +1581,7 @@ "serve-static": { "version": "1.13.1", "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.1.tgz", - "integrity": "sha512-hSMUZrsPa/I09VYFJwa627JJkNs0NrfL1Uzuup+GqHfToR2KcsXFymXSV90hoyw3M+msjFuQly+YzIH/q0MGlQ==", + "integrity": "sha1-TFfVNASnYdjy58HooYpH2/J4pxk=", "requires": { "encodeurl": "1.0.1", "escape-html": "1.0.3", @@ -1597,7 +1592,7 @@ "servify": { "version": "0.1.12", "resolved": "https://registry.npmjs.org/servify/-/servify-0.1.12.tgz", - "integrity": "sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw==", + "integrity": "sha1-FCq3vuHx0DO2bQcHCGCFsXwG25U=", "requires": { "body-parser": "1.18.2", "cors": "2.8.4", @@ -1684,7 +1679,7 @@ "string_decoder": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=", "requires": { "safe-buffer": "5.1.1" } @@ -1713,7 +1708,7 @@ "supports-color": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", - "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", + "integrity": "sha1-iD992rwWUUKyphQn8zUt7RldGj4=", "requires": { "has-flag": "2.0.0" } @@ -1881,7 +1876,7 @@ "unbzip2-stream": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.2.5.tgz", - "integrity": "sha512-izD3jxT8xkzwtXRUZjtmRwKnZoeECrfZ8ra/ketwOcusbZEp4mjULMnJOCfTDZBgGQAAY1AJ/IgxcwkavcX9Og==", + "integrity": "sha1-c6AzpWe7veWWVLGTxE1Ip+T0PEc=", "requires": { "buffer": "3.6.0", "through": "2.3.8" diff --git a/package.json b/package.json index 71bab52..89dc36e 100644 --- a/package.json +++ b/package.json @@ -11,12 +11,10 @@ "dependencies": { "bignumber.js": "^4.1.0", "clone": "^2.1.1", - "crypto": "^1.0.1", "crypto-js": "^3.1.9-1", "minimist": "^1.2.0", "mocha": "^4.0.1", "random-hex": "^1.0.2", - "ripemd160": "^2.0.1", "web3": "^1.0.0-beta.23" }, "devDependencies": {