From 432a3e1fe1ec83f5f4da3efead759f0e05a2339b Mon Sep 17 00:00:00 2001 From: greg Date: Tue, 5 Jun 2018 15:11:57 -0400 Subject: [PATCH 1/3] inital --- shyft-cli/web3/testContract.js | 58 ++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 shyft-cli/web3/testContract.js diff --git a/shyft-cli/web3/testContract.js b/shyft-cli/web3/testContract.js new file mode 100644 index 0000000000..78813c2f7c --- /dev/null +++ b/shyft-cli/web3/testContract.js @@ -0,0 +1,58 @@ +var testContract = web3.eth.contract([{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"live","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_bool","type":"bool"}],"name":"Live","type":"event"}]); +var test = testContract.new( + { + from: web3.eth.accounts[0], + data: '0x6060604052341561000f57600080fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101698061005e6000396000f30060606040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680638da5cb5b14610051578063957aa58c146100a6575b600080fd5b341561005c57600080fd5b6100646100d3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156100b157600080fd5b6100b96100f8565b604051808215151515815260200191505060405180910390f35b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60007f63f89985c88a92552c6e2ce4d4e46e9fbb7a06168c4536e662261decae02f9e76001604051808215151515815260200191505060405180910390a160019050905600a165627a7a7230582091089d445770c1c9bb2f0f86f6c0b8552ef59af41930e1f7ecfac34326b20e590029', + gas: '4700000' + }, function (e, contract){ + if (e) { + console.log("Error: ", e) + } + console.log("TX Hash:", contract.transactionHash) + if (typeof contract.address !== 'undefined') { + console.log('Contract address: ' + contract.address) + console.log('TransactionHash: ' + contract.transactionHash); + interact(contract.address); + } + }); + +function waitBlock(callback) { + function innerWaitBlock() { + + var receipt = web3.eth.getTransactionReceipt(test.transactionHash); + if (receipt && receipt.contractAddress) { + callback(receipt); + } else { + // console.log("Waiting a mined block to include your contract... currently in block " + web3.eth.blockNumber); + setTimeout(innerWaitBlock(), 4000); + } + } + innerWaitBlock(); +} + +waitBlock(function (receipt) { + // do stuff here now that the contract has been deployed + console.log("[Receipt] Contract Address: ", receipt.contract.address) +}); + +function interact(addr) { + var contract = testContract.at(addr); + contract.live({ + from: web3.eth.accounts[0], + gas: '4700000' + }, function (e, res) { + if (e) { + console.log(e) + } + console.log('Live TxHash: ', res) + }); + contract.live.call({ + from: web3.eth.accounts[0], + gas: '4700000' + }, function (e, res) { + if (e) { + console.log(e) + } + console.log('Live Response: ', res) + }) +} \ No newline at end of file From ede486a68ad310e08a09ca61937e57e34b3ae0ed Mon Sep 17 00:00:00 2001 From: greg Date: Fri, 8 Jun 2018 14:07:46 -0400 Subject: [PATCH 2/3] Add test cases to shyft-clie/web3 and removed logs from consesnus.go and blockchain.go --- .gitignore | 2 + consensus/ethash/consensus.go | 1 - core/blockchain.go | 1 - shyft-cli/web3/deployContract.js | 54 +- .../.node-xmlhttprequest-sync-64192 | 0 shyft-cli/web3/token_test/deployToken.js | 22 + shyft-cli/web3/token_test/multi.js | 22 + shyft-cli/web3/token_test/package-lock.json | 43 + .../build/contracts/Migrations.json | 1393 +++++ .../build/contracts/Transfers.json | 4652 +++++++++++++++++ .../build/contracts/Transfers2.json | 423 ++ .../contracts/Migrations.sol | 23 + .../contracts/Transfers.sol | 44 + .../contracts/Transfers2.sol | 7 + .../migrations/1_initial_migration.js | 5 + .../migrations/2_migrate.js | 7 + .../transfer-through-master/package-lock.json | 5 + .../web3/transfer-through-master/package.json | 15 + .../web3/transfer-through-master/test/test.js | 41 + .../transfer-through-master/truffle-config.js | 12 + .../web3/transfer-through-master/truffle.js | 10 + 21 files changed, 6755 insertions(+), 27 deletions(-) create mode 100644 shyft-cli/web3/token_test/.node-xmlhttprequest-sync-64192 create mode 100644 shyft-cli/web3/token_test/deployToken.js create mode 100644 shyft-cli/web3/token_test/multi.js create mode 100644 shyft-cli/web3/token_test/package-lock.json create mode 100755 shyft-cli/web3/transfer-through-master/build/contracts/Migrations.json create mode 100755 shyft-cli/web3/transfer-through-master/build/contracts/Transfers.json create mode 100755 shyft-cli/web3/transfer-through-master/build/contracts/Transfers2.json create mode 100755 shyft-cli/web3/transfer-through-master/contracts/Migrations.sol create mode 100755 shyft-cli/web3/transfer-through-master/contracts/Transfers.sol create mode 100755 shyft-cli/web3/transfer-through-master/contracts/Transfers2.sol create mode 100755 shyft-cli/web3/transfer-through-master/migrations/1_initial_migration.js create mode 100755 shyft-cli/web3/transfer-through-master/migrations/2_migrate.js create mode 100755 shyft-cli/web3/transfer-through-master/package-lock.json create mode 100755 shyft-cli/web3/transfer-through-master/package.json create mode 100755 shyft-cli/web3/transfer-through-master/test/test.js create mode 100755 shyft-cli/web3/transfer-through-master/truffle-config.js create mode 100755 shyft-cli/web3/transfer-through-master/truffle.js diff --git a/.gitignore b/.gitignore index a2326e3cfa..3561546ca9 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,5 @@ $HOME # Remove Shyft Data shyftData/* +shyft-cli/web3/token_test/node_modules +shyft-cli/web3/transfer-through-master/node_modules diff --git a/consensus/ethash/consensus.go b/consensus/ethash/consensus.go index 24c15c4f83..f78d95f783 100644 --- a/consensus/ethash/consensus.go +++ b/consensus/ethash/consensus.go @@ -565,6 +565,5 @@ func accumulateRewards(config *params.ChainConfig, state *state.StateDB, header if (config.IsShyftNetwork(header.Number)) { state.AddBalance(ShyftNetworkConduitAddress, ShyftNetworkBlockReward) - log.Info("ShyftNetwork") } } diff --git a/core/blockchain.go b/core/blockchain.go index 2e231d8ee1..59abba501f 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -142,7 +142,6 @@ type BlockChain struct { // available in the database. It initialises the default Ethereum Validator and // Processor. func NewBlockChain(db ethdb.Database, blockExplorerDb *sql.DB, cacheConfig *CacheConfig, chainConfig *params.ChainConfig, engine consensus.Engine, vmConfig vm.Config) (*BlockChain, error) { - fmt.Printf("+++++++++++++++++core/blockchain.GO+++++++++++++++++++++++++NewBlockChain()") if cacheConfig == nil { cacheConfig = &CacheConfig{ TrieNodeLimit: 256 * 1024 * 1024, diff --git a/shyft-cli/web3/deployContract.js b/shyft-cli/web3/deployContract.js index 109a58febf..e4f35923c8 100644 --- a/shyft-cli/web3/deployContract.js +++ b/shyft-cli/web3/deployContract.js @@ -1,27 +1,31 @@ -// using contract from https://www.ethereum.org/greeter -// compiled on remix +var _message = "Hello" ; +var inboxContract = web3.eth.contract([{"constant":false,"inputs":[{"name":"_newMessage","type":"string"}],"name":"setMessage","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"message","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_message","type":"string"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_newMessage","type":"string"}],"name":"EventMessage","type":"event"}]); +var inbox = inboxContract.new( + _message, + { + from: web3.eth.accounts[0], + data: '0x6060604052341561000f57600080fd5b604051610454380380610454833981016040528080518201919050508060009080519060200190610041929190610048565b50506100ed565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061008957805160ff19168380011785556100b7565b828001600101855582156100b7579182015b828111156100b657825182559160200191906001019061009b565b5b5090506100c491906100c8565b5090565b6100ea91905b808211156100e65760008160009055506001016100ce565b5090565b90565b610358806100fc6000396000f30060606040526000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063368b877214610048578063e21f37ce146100a557600080fd5b341561005357600080fd5b6100a3600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610133565b005b34156100b057600080fd5b6100b86101e9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f85780820151818401526020810190506100dd565b50505050905090810190601f1680156101255780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b8060009080519060200190610149929190610287565b507f2ec385c52f10e65de137fbbeb2582bb0f4a8460a2163012971e923d179d73ea7816040518080602001828103825283818151815260200191508051906020019080838360005b838110156101ac578082015181840152602081019050610191565b50505050905090810190601f1680156101d95780820380516001836020036101000a031916815260200191505b509250505060405180910390a150565b60008054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561027f5780601f106102545761010080835404028352916020019161027f565b820191906000526020600020905b81548152906001019060200180831161026257829003601f168201915b505050505081565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106102c857805160ff19168380011785556102f6565b828001600101855582156102f6579182015b828111156102f55782518255916020019190600101906102da565b5b5090506103039190610307565b5090565b61032991905b8082111561032557600081600090555060010161030d565b5090565b905600a165627a7a72305820c83fcf90975f9c6996cf8dde1a2a1f4fab1f408588a2f8587487833ac98665630029', + gas: '4700000' + }, function (e, contract){ + if(!e) { + // NOTE: The callback will fire twice! + // Once the contract has the transactionHash property set and once its deployed on an address. + // e.g. check tx hash on the first call (transaction send) + if(!contract.address) { + console.log("TX hash:") + console.log(contract.transactionHash) // The hash of the transaction, which deploys the contract -var _greeting = "Greeter Contract" ; -var greeterContract = web3.eth.contract([{"constant":false,"inputs":[],"name":"kill","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"greet","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_greeting","type":"string"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]); -var greeter = greeterContract.new( - _greeting, - { - from: web3.eth.accounts[0], - data: '0x6060604052341561000f57600080fd5b6040516103a93803806103a983398101604052808051820191905050336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060019080519060200190610081929190610088565b505061012d565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100c957805160ff19168380011785556100f7565b828001600101855582156100f7579182015b828111156100f65782518255916020019190600101906100db565b5b5090506101049190610108565b5090565b61012a91905b8082111561012657600081600090555060010161010e565b5090565b90565b61026d8061013c6000396000f30060606040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806341c0e1b514610051578063cfae321714610066575b600080fd5b341561005c57600080fd5b6100646100f4565b005b341561007157600080fd5b610079610185565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100b957808201518184015260208101905061009e565b50505050905090810190601f1680156100e65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610183576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b565b61018d61022d565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102235780601f106101f857610100808354040283529160200191610223565b820191906000526020600020905b81548152906001019060200180831161020657829003601f168201915b5050505050905090565b6020604051908101604052806000815250905600a165627a7a7230582015882dcaabcda0ebdb1b26a10e36f26a424e148671f4703dde3c1956ebaa67830029', - gas: '4700000' - }, function (e, contract){ - if(!e) { - // NOTE: The callback will fire twice! - // Once the contract has the transactionHash property set and once its deployed on an address. - // e.g. check tx hash on the first call (transaction send) - if(!contract.address) { - console.log("TX hash:") - console.log(contract.transactionHash) // The hash of the transaction, which deploys the contract + } else { + console.log("Contract address:") + console.log(contract.address) // the contract address + contract.methods.setMessage('New').call({from: web3.eth.accounts[0]}, function(error, result){ + if (error) { + console.log(error) + } else { + console.log('[METHOD RESULT]: ', result) + } + }); + } - } else { - console.log("Contract address:") - console.log(contract.address) // the contract address - } - - } - }) + } + }); diff --git a/shyft-cli/web3/token_test/.node-xmlhttprequest-sync-64192 b/shyft-cli/web3/token_test/.node-xmlhttprequest-sync-64192 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/shyft-cli/web3/token_test/deployToken.js b/shyft-cli/web3/token_test/deployToken.js new file mode 100644 index 0000000000..6173cca77b --- /dev/null +++ b/shyft-cli/web3/token_test/deployToken.js @@ -0,0 +1,22 @@ +var Web3 = require('web3') +var web3 = new Web3(new Web3.providers.HttpProvider("http://127.0.0.1:8545")); + +var initialSupply = 1000000000000000 +var mytokenContract = web3.eth.contract([{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"_bool","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"initialSupply","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]); +var mytoken = mytokenContract.new( + initialSupply, + { + from: web3.eth.accounts[0], + data: '0x6060604052341561000f57600080fd5b60405160208061032f83398101604052808051906020019091905050806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550506102b18061007e6000396000f30060606040526000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806370a0823114610048578063a9059cbb1461009557600080fd5b341561005357600080fd5b61007f600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506100ef565b6040518082815260200191505060405180910390f35b34156100a057600080fd5b6100d5600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610107565b604051808215151515815260200191505060405180910390f35b60006020528060005260406000206000915090505481565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561015657600080fd5b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401101515156101e357600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555060019050929150505600a165627a7a723058207dba9cbbfe34ea34b40caa5e6d2b53f9194dafa2420207342bebe3a5c949840c0029', + gas: '4700000' + }, function (e, contract) { + if (e) console.log("err1", e); + if (typeof contract.address !== 'undefined') { + console.log('Contract mined! address: ' + contract.address + ' transactionHash: ' + contract.transactionHash); + var a = mytokenContract.at(contract.address); + a.transfer.sendTransaction(web3.eth.accounts[0], 5000000, {from: web3.eth.accounts[0]}, function (err, res) { + if (err) console.log("err", err); + console.log(res) + }) + } + }); \ No newline at end of file diff --git a/shyft-cli/web3/token_test/multi.js b/shyft-cli/web3/token_test/multi.js new file mode 100644 index 0000000000..9344c0e61a --- /dev/null +++ b/shyft-cli/web3/token_test/multi.js @@ -0,0 +1,22 @@ +var Web3 = require('web3') +var web3 = new Web3(new Web3.providers.HttpProvider("http://127.0.0.1:8545")); + +var _message = "Hello"; +var multi = web3.eth.contract([{"constant":false,"inputs":[{"name":"_newMessage","type":"string"}],"name":"setMessage","outputs":[{"name":"_str","type":"string"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"message","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_message","type":"string"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_newMessage","type":"string"}],"name":"EventMessage","type":"event"}]); +var inbox = multi.new( + _message, + { + from: web3.eth.accounts[0], + data: '0x6060604052341561000f57600080fd5b6040516109cd3803806109cd833981016040528080518201919050508060009080519060200190610041929190610048565b50506100ed565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061008957805160ff19168380011785556100b7565b828001600101855582156100b7579182015b828111156100b657825182559160200191906001019061009b565b5b5090506100c491906100c8565b5090565b6100ea91905b808211156100e65760008160009055506001016100ce565b5090565b90565b6108d1806100fc6000396000f30060606040526000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063368b877214610048578063e21f37ce1461011e57600080fd5b341561005357600080fd5b6100a3600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506101ac565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100e35780820151818401526020810190506100c8565b50505050905090810190601f1680156101105780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561012957600080fd5b6101316102b9565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610171578082015181840152602081019050610156565b50505050905090810190601f16801561019e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101b46107d8565b6101bc6107d8565b82600090805190602001906101d29291906107ec565b507f2ec385c52f10e65de137fbbeb2582bb0f4a8460a2163012971e923d179d73ea7836040518080602001828103825283818151815260200191508051906020019080838360005b8381101561023557808201518184015260208101905061021a565b50505050905090810190601f1680156102625780820380516001836020036101000a031916815260200191505b509250505060405180910390a16102ae836040805190810160405280600181526020017f6400000000000000000000000000000000000000000000000000000000000000815250610357565b905080915050919050565b60008054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561034f5780601f106103245761010080835404028352916020019161034f565b820191906000526020600020905b81548152906001019060200180831161033257829003601f168201915b505050505081565b61035f6107d8565b61039c83836020604051908101604052806000815250602060405190810160405280600081525060206040519081016040528060008152506103a4565b905092915050565b6103ac6107d8565b6103b461086c565b6103bc61086c565b6103c461086c565b6103cc61086c565b6103d461086c565b6103dc6107d8565b6103e461086c565b6000808e98508d97508c96508b95508a94508451865188518a518c51010101016040518059106104115750595b9080825280602002602001820160405250935083925060009150600090505b88518110156104e357888181518110151561044757fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f01000000000000000000000000000000000000000000000000000000000000000283838060010194508151811015156104a657fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080600101915050610430565b600090505b875181101561059b5787818151811015156104ff57fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f010000000000000000000000000000000000000000000000000000000000000002838380600101945081518110151561055e57fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806001019150506104e8565b600090505b86518110156106535786818151811015156105b757fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f010000000000000000000000000000000000000000000000000000000000000002838380600101945081518110151561061657fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806001019150506105a0565b600090505b855181101561070b57858181518110151561066f57fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f01000000000000000000000000000000000000000000000000000000000000000283838060010194508151811015156106ce57fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080600101915050610658565b600090505b84518110156107c357848181518110151561072757fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f010000000000000000000000000000000000000000000000000000000000000002838380600101945081518110151561078657fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080600101915050610710565b82995050505050505050505095945050505050565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061082d57805160ff191683800117855561085b565b8280016001018555821561085b579182015b8281111561085a57825182559160200191906001019061083f565b5b5090506108689190610880565b5090565b602060405190810160405280600081525090565b6108a291905b8082111561089e576000816000905550600101610886565b5090565b905600a165627a7a7230582020b529379f871d55b9275f90248d26586073f215f39c72d4f954eae2c85256170029', + gas: '4700000' + }, function (e, contract) { + if (e) console.log("err1", e); + if (typeof contract.address !== 'undefined') { + console.log('Contract mined! address: ' + contract.address + ' transactionHash: ' + contract.transactionHash); + var a = multi.at(contract.address); + a.setMessage.sendTransaction("Hi dustin this is what i am", {from: web3.eth.accounts[0]}, function (err, res) { + if (err) console.log("err", err); + console.log(res) + }) + } + }); \ No newline at end of file diff --git a/shyft-cli/web3/token_test/package-lock.json b/shyft-cli/web3/token_test/package-lock.json new file mode 100644 index 0000000000..74e85e8570 --- /dev/null +++ b/shyft-cli/web3/token_test/package-lock.json @@ -0,0 +1,43 @@ +{ + "name": "token_contract", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "bignumber.js": { + "version": "git+https://github.com/frozeman/bignumber.js-nolookahead.git#57692b3ecfc98bbdd6b3a516cb2353652ea49934" + }, + "crypto-js": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.1.8.tgz", + "integrity": "sha1-cV8HC/YBTyrpkqmLOSkli3E/CNU=" + }, + "utf8": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/utf8/-/utf8-2.1.2.tgz", + "integrity": "sha1-H6DZJw6b6FDZsFAn9jUZv0ZFfZY=" + }, + "web3": { + "version": "0.20.6", + "resolved": "https://registry.npmjs.org/web3/-/web3-0.20.6.tgz", + "integrity": "sha1-PpcwauAk+yThCj11yIQwJWIhUSA=", + "requires": { + "bignumber.js": "git+https://github.com/frozeman/bignumber.js-nolookahead.git#57692b3ecfc98bbdd6b3a516cb2353652ea49934", + "crypto-js": "3.1.8", + "utf8": "2.1.2", + "xhr2": "0.1.4", + "xmlhttprequest": "1.8.0" + } + }, + "xhr2": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/xhr2/-/xhr2-0.1.4.tgz", + "integrity": "sha1-f4dliEdxbbUCYyOBL4GMras4el8=" + }, + "xmlhttprequest": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz", + "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw=" + } + } +} diff --git a/shyft-cli/web3/transfer-through-master/build/contracts/Migrations.json b/shyft-cli/web3/transfer-through-master/build/contracts/Migrations.json new file mode 100755 index 0000000000..fae58950b1 --- /dev/null +++ b/shyft-cli/web3/transfer-through-master/build/contracts/Migrations.json @@ -0,0 +1,1393 @@ +{ + "contractName": "Migrations", + "abi": [ + { + "constant": true, + "inputs": [], + "name": "last_completed_migration", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "owner", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "constant": false, + "inputs": [ + { + "name": "completed", + "type": "uint256" + } + ], + "name": "setCompleted", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "new_address", + "type": "address" + } + ], + "name": "upgrade", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506102f8806100606000396000f300608060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630900f01014610067578063445df0ac146100aa5780638da5cb5b146100d5578063fdacd5761461012c575b600080fd5b34801561007357600080fd5b506100a8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610159565b005b3480156100b657600080fd5b506100bf610241565b6040518082815260200191505060405180910390f35b3480156100e157600080fd5b506100ea610247565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561013857600080fd5b506101576004803603810190808035906020019092919050505061026c565b005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561023d578190508073ffffffffffffffffffffffffffffffffffffffff1663fdacd5766001546040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b15801561022457600080fd5b505af1158015610238573d6000803e3d6000fd5b505050505b5050565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102c957806001819055505b505600a165627a7a7230582081dfbd8174037e45d69fcbe70d6680c7a2138f79ab9ba39bdffaa14fb7854aa50029", + "deployedBytecode": "0x608060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630900f01014610067578063445df0ac146100aa5780638da5cb5b146100d5578063fdacd5761461012c575b600080fd5b34801561007357600080fd5b506100a8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610159565b005b3480156100b657600080fd5b506100bf610241565b6040518082815260200191505060405180910390f35b3480156100e157600080fd5b506100ea610247565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561013857600080fd5b506101576004803603810190808035906020019092919050505061026c565b005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561023d578190508073ffffffffffffffffffffffffffffffffffffffff1663fdacd5766001546040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b15801561022457600080fd5b505af1158015610238573d6000803e3d6000fd5b505050505b5050565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102c957806001819055505b505600a165627a7a7230582081dfbd8174037e45d69fcbe70d6680c7a2138f79ab9ba39bdffaa14fb7854aa50029", + "sourceMap": "26:480:0:-;;;115:50;8:9:-1;5:2;;;30:1;27;20:12;5:2;115:50:0;150:10;142:5;;:18;;;;;;;;;;;;;;;;;;26:480;;;;;;", + "deployedSourceMap": "26:480:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;339:165;;8:9:-1;5:2;;;30:1;27;20:12;5:2;339:165:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;74:36;;8:9:-1;5:2;;;30:1;27;20:12;5:2;74:36:0;;;;;;;;;;;;;;;;;;;;;;;50:20;;8:9:-1;5:2;;;30:1;27;20:12;5:2;50:20:0;;;;;;;;;;;;;;;;;;;;;;;;;;;232:103;;8:9:-1;5:2;;;30:1;27;20:12;5:2;232:103:0;;;;;;;;;;;;;;;;;;;;;;;;;;339:165;401:19;215:5;;;;;;;;;;;201:19;;:10;:19;;;197:26;;;434:11;401:45;;452:8;:21;;;474:24;;452:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;452:47:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;452:47:0;;;;197:26;339:165;;:::o;74:36::-;;;;:::o;50:20::-;;;;;;;;;;;;;:::o;232:103::-;215:5;;;;;;;;;;;201:19;;:10;:19;;;197:26;;;321:9;294:24;:36;;;;197:26;232:103;:::o", + "source": "pragma solidity ^0.4.23;\n\ncontract Migrations {\n address public owner;\n uint public last_completed_migration;\n\n constructor() public {\n owner = msg.sender;\n }\n\n modifier restricted() {\n if (msg.sender == owner) _;\n }\n\n function setCompleted(uint completed) public restricted {\n last_completed_migration = completed;\n }\n\n function upgrade(address new_address) public restricted {\n Migrations upgraded = Migrations(new_address);\n upgraded.setCompleted(last_completed_migration);\n }\n}\n", + "sourcePath": "/Users/gregmarkou/Jobs/Jobs/ChainSafe/shyftNetwork/shyft_go-ethereum/shyft-cli/web3/transfer-through-master/contracts/Migrations.sol", + "ast": { + "absolutePath": "/Users/gregmarkou/Jobs/Jobs/ChainSafe/shyftNetwork/shyft_go-ethereum/shyft-cli/web3/transfer-through-master/contracts/Migrations.sol", + "exportedSymbols": { + "Migrations": [ + 56 + ] + }, + "id": 57, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1, + "literals": [ + "solidity", + "^", + "0.4", + ".23" + ], + "nodeType": "PragmaDirective", + "src": "0:24: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": "50:20:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "50: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": "74:36:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "74:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "public" + }, + { + "body": { + "id": 13, + "nodeType": "Block", + "src": "136:29:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 11, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 8, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "142:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 9, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 264, + "src": "150:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 10, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "150:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "142:18:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 12, + "nodeType": "ExpressionStatement", + "src": "142:18:0" + } + ] + }, + "documentation": null, + "id": 14, + "implemented": true, + "isConstructor": true, + "isDeclaredConst": false, + "modifiers": [], + "name": "", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 6, + "nodeType": "ParameterList", + "parameters": [], + "src": "126:2:0" + }, + "payable": false, + "returnParameters": { + "id": 7, + "nodeType": "ParameterList", + "parameters": [], + "src": "136:0:0" + }, + "scope": 56, + "src": "115:50:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 22, + "nodeType": "Block", + "src": "191:37:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 19, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 16, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 264, + "src": "201:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 17, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "201:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 18, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "215:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "201:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 21, + "nodeType": "IfStatement", + "src": "197:26:0", + "trueBody": { + "id": 20, + "nodeType": "PlaceholderStatement", + "src": "222:1:0" + } + } + ] + }, + "documentation": null, + "id": 23, + "name": "restricted", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 15, + "nodeType": "ParameterList", + "parameters": [], + "src": "188:2:0" + }, + "src": "169:59:0", + "visibility": "internal" + }, + { + "body": { + "id": 34, + "nodeType": "Block", + "src": "288:47: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": "294:24:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 31, + "name": "completed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25, + "src": "321:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "294:36:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 33, + "nodeType": "ExpressionStatement", + "src": "294:36:0" + } + ] + }, + "documentation": null, + "id": 35, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [ + { + "arguments": null, + "id": 28, + "modifierName": { + "argumentTypes": null, + "id": 27, + "name": "restricted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "277:10:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "277:10:0" + } + ], + "name": "setCompleted", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 26, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 25, + "name": "completed", + "nodeType": "VariableDeclaration", + "scope": 35, + "src": "254:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 24, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "254:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "253:16:0" + }, + "payable": false, + "returnParameters": { + "id": 29, + "nodeType": "ParameterList", + "parameters": [], + "src": "288:0:0" + }, + "scope": 56, + "src": "232:103:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 54, + "nodeType": "Block", + "src": "395:109:0", + "statements": [ + { + "assignments": [ + 43 + ], + "declarations": [ + { + "constant": false, + "id": 43, + "name": "upgraded", + "nodeType": "VariableDeclaration", + "scope": 55, + "src": "401: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": "401: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": "new_address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 37, + "src": "434:11:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 44, + "name": "Migrations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 56, + "src": "423: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": "423:23:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Migrations_$56", + "typeString": "contract Migrations" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "401:45:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 51, + "name": "last_completed_migration", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5, + "src": "474: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": "452: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": "452: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": "452:47:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 53, + "nodeType": "ExpressionStatement", + "src": "452:47:0" + } + ] + }, + "documentation": null, + "id": 55, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [ + { + "arguments": null, + "id": 40, + "modifierName": { + "argumentTypes": null, + "id": 39, + "name": "restricted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "384:10:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "384:10:0" + } + ], + "name": "upgrade", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 38, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 37, + "name": "new_address", + "nodeType": "VariableDeclaration", + "scope": 55, + "src": "356:19:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 36, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "356:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "355:21:0" + }, + "payable": false, + "returnParameters": { + "id": 41, + "nodeType": "ParameterList", + "parameters": [], + "src": "395:0:0" + }, + "scope": 56, + "src": "339:165:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 57, + "src": "26:480:0" + } + ], + "src": "0:507:0" + }, + "legacyAST": { + "absolutePath": "/Users/gregmarkou/Jobs/Jobs/ChainSafe/shyftNetwork/shyft_go-ethereum/shyft-cli/web3/transfer-through-master/contracts/Migrations.sol", + "exportedSymbols": { + "Migrations": [ + 56 + ] + }, + "id": 57, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1, + "literals": [ + "solidity", + "^", + "0.4", + ".23" + ], + "nodeType": "PragmaDirective", + "src": "0:24: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": "50:20:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 2, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "50: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": "74:36:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 4, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "74:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "public" + }, + { + "body": { + "id": 13, + "nodeType": "Block", + "src": "136:29:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 11, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 8, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "142:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 9, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 264, + "src": "150:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 10, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "150:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "142:18:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 12, + "nodeType": "ExpressionStatement", + "src": "142:18:0" + } + ] + }, + "documentation": null, + "id": 14, + "implemented": true, + "isConstructor": true, + "isDeclaredConst": false, + "modifiers": [], + "name": "", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 6, + "nodeType": "ParameterList", + "parameters": [], + "src": "126:2:0" + }, + "payable": false, + "returnParameters": { + "id": 7, + "nodeType": "ParameterList", + "parameters": [], + "src": "136:0:0" + }, + "scope": 56, + "src": "115:50:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 22, + "nodeType": "Block", + "src": "191:37:0", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 19, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 16, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 264, + "src": "201:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 17, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "201:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 18, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "215:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "201:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 21, + "nodeType": "IfStatement", + "src": "197:26:0", + "trueBody": { + "id": 20, + "nodeType": "PlaceholderStatement", + "src": "222:1:0" + } + } + ] + }, + "documentation": null, + "id": 23, + "name": "restricted", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 15, + "nodeType": "ParameterList", + "parameters": [], + "src": "188:2:0" + }, + "src": "169:59:0", + "visibility": "internal" + }, + { + "body": { + "id": 34, + "nodeType": "Block", + "src": "288:47: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": "294:24:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 31, + "name": "completed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25, + "src": "321:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "294:36:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 33, + "nodeType": "ExpressionStatement", + "src": "294:36:0" + } + ] + }, + "documentation": null, + "id": 35, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [ + { + "arguments": null, + "id": 28, + "modifierName": { + "argumentTypes": null, + "id": 27, + "name": "restricted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "277:10:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "277:10:0" + } + ], + "name": "setCompleted", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 26, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 25, + "name": "completed", + "nodeType": "VariableDeclaration", + "scope": 35, + "src": "254:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 24, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "254:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "253:16:0" + }, + "payable": false, + "returnParameters": { + "id": 29, + "nodeType": "ParameterList", + "parameters": [], + "src": "288:0:0" + }, + "scope": 56, + "src": "232:103:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 54, + "nodeType": "Block", + "src": "395:109:0", + "statements": [ + { + "assignments": [ + 43 + ], + "declarations": [ + { + "constant": false, + "id": 43, + "name": "upgraded", + "nodeType": "VariableDeclaration", + "scope": 55, + "src": "401: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": "401: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": "new_address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 37, + "src": "434:11:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 44, + "name": "Migrations", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 56, + "src": "423: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": "423:23:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Migrations_$56", + "typeString": "contract Migrations" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "401:45:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 51, + "name": "last_completed_migration", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5, + "src": "474: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": "452: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": "452: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": "452:47:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 53, + "nodeType": "ExpressionStatement", + "src": "452:47:0" + } + ] + }, + "documentation": null, + "id": 55, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [ + { + "arguments": null, + "id": 40, + "modifierName": { + "argumentTypes": null, + "id": 39, + "name": "restricted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "384:10:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "384:10:0" + } + ], + "name": "upgrade", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 38, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 37, + "name": "new_address", + "nodeType": "VariableDeclaration", + "scope": 55, + "src": "356:19:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 36, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "356:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "355:21:0" + }, + "payable": false, + "returnParameters": { + "id": 41, + "nodeType": "ParameterList", + "parameters": [], + "src": "395:0:0" + }, + "scope": 56, + "src": "339:165:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 57, + "src": "26:480:0" + } + ], + "src": "0:507:0" + }, + "compiler": { + "name": "solc", + "version": "0.4.24+commit.e67f0147.Emscripten.clang" + }, + "networks": { + "1": { + "events": {}, + "links": {}, + "address": "0xfaeccae8c1af6bdfd71095e1b6a2f61c61c8a7e7", + "transactionHash": "0xeee5c7819e1a662e45a8244d02305b531d2c4e11e67383dace9b458dc76f22dc" + }, + "1528420224459": { + "events": {}, + "links": {}, + "address": "0x8887d2e7638bec1c9badc47beaeddc6dd261a095", + "transactionHash": "0x1d1b9f147f05f37206bbfa1143bb5ec43c8a1e193d17513471b6d6f58911779c" + } + }, + "schemaVersion": "2.0.0", + "updatedAt": "2018-06-08T15:58:27.900Z" +} \ No newline at end of file diff --git a/shyft-cli/web3/transfer-through-master/build/contracts/Transfers.json b/shyft-cli/web3/transfer-through-master/build/contracts/Transfers.json new file mode 100755 index 0000000000..cd9330c614 --- /dev/null +++ b/shyft-cli/web3/transfer-through-master/build/contracts/Transfers.json @@ -0,0 +1,4652 @@ +{ + "contractName": "Transfers", + "abi": [ + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "address" + } + ], + "name": "balance", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "constant": false, + "inputs": [ + { + "name": "_addr", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "myBalance", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "deposit", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_addr", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_addrs", + "type": "address[]" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "name": "withdrawMulti", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b506100196100de565b604051809103906000f080158015610035573d6000803e3d6000fd5b50600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506100ee565b60405161010c806107a683390190565b6106a9806100fd6000396000f300608060405260043610610078576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680636b557a221461007d578063a9059cbb146100ed578063c9116b691461013a578063d0e30db014610165578063e3d670d714610183578063f3fef3a3146101da575b600080fd5b34801561008957600080fd5b506100eb6004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190929190505050610227565b005b3480156100f957600080fd5b50610138600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610349565b005b34801561014657600080fd5b5061014f6104a9565b6040518082815260200191505060405180910390f35b61016d6104ef565b6040518082815260200191505060405180910390f35b34801561018f57600080fd5b506101c4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610581565b6040518082815260200191505060405180910390f35b3480156101e657600080fd5b50610225600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610599565b005b600080835191508183026000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561027d57600080fd5b8183026000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550600090505b818110156103435783818151811015156102e657fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f19350505050158015610335573d6000803e3d6000fd5b5080806001019150506102d0565b50505050565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561039857600080fd5b60405180807f7472616e73666572286164647265737329000000000000000000000000000000815250601101905060405180910390209050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682827c0100000000000000000000000000000000000000000000000000000000900490856040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060006040518083038185885af1935050505050505050565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905090565b6000346000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905090565b60006020528060005260406000206000915090505481565b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156105e657600080fd5b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610678573d6000803e3d6000fd5b5050505600a165627a7a7230582073b86b0504a0668c11a4b9525431c2c1eb1f06ba1b37ab7b422840967732027c0029608060405234801561001057600080fd5b5060ed8061001f6000396000f300608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631a695230146044575b600080fd5b6076600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506078565b005b8073ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f1935050505015801560bd573d6000803e3d6000fd5b50505600a165627a7a72305820e95f74106a3328ffadd8b0adb916d92497daab65998ee73cf40afff57dc4b29b0029", + "deployedBytecode": "0x608060405260043610610078576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680636b557a221461007d578063a9059cbb146100ed578063c9116b691461013a578063d0e30db014610165578063e3d670d714610183578063f3fef3a3146101da575b600080fd5b34801561008957600080fd5b506100eb6004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190929190505050610227565b005b3480156100f957600080fd5b50610138600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610349565b005b34801561014657600080fd5b5061014f6104a9565b6040518082815260200191505060405180910390f35b61016d6104ef565b6040518082815260200191505060405180910390f35b34801561018f57600080fd5b506101c4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610581565b6040518082815260200191505060405180910390f35b3480156101e657600080fd5b50610225600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610599565b005b600080835191508183026000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561027d57600080fd5b8183026000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550600090505b818110156103435783818151811015156102e657fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f19350505050158015610335573d6000803e3d6000fd5b5080806001019150506102d0565b50505050565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561039857600080fd5b60405180807f7472616e73666572286164647265737329000000000000000000000000000000815250601101905060405180910390209050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682827c0100000000000000000000000000000000000000000000000000000000900490856040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060006040518083038185885af1935050505050505050565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905090565b6000346000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905090565b60006020528060005260406000206000915090505481565b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156105e657600080fd5b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610678573d6000803e3d6000fd5b5050505600a165627a7a7230582073b86b0504a0668c11a4b9525431c2c1eb1f06ba1b37ab7b422840967732027c0029", + "sourceMap": "54:979:1:-;;;152:72;8:9:-1;5:2;;;30:1;27;20:12;5:2;152:72:1;181:16;;:::i;:::-;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;181:16:1;177:1;;:20;;;;;;;;;;;;;;;;;;218:1;;;;;;;;;;;201:6;;:19;;;;;;;;;;;;;;;;;;54:979;;;;;;;;;;;;:::o;:::-;;;;;;;", + "deployedSourceMap": "54:979:1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;790:241;;8:9:-1;5:2;;;30:1;27;20:12;5:2;790:241:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;227:197;;8:9:-1;5:2;;;30:1;27;20:12;5:2;227:197:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;427:77;;8:9:-1;5:2;;;30:1;27;20:12;5:2;427:77:1;;;;;;;;;;;;;;;;;;;;;;;507:119;;;;;;;;;;;;;;;;;;;;;;;76:40;;8:9:-1;5:2;;;30:1;27;20:12;5:2;76:40:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;629:158;;8:9:-1;5:2;;;30:1;27;20:12;5:2;629:158:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;790:241;855:6;969;864;:13;855:22;;921:1;912:6;:10;889:7;:19;897:10;889:19;;;;;;;;;;;;;;;;:33;;881:42;;;;;;;;959:1;950:6;:10;927:7;:19;935:10;927:19;;;;;;;;;;;;;;;;:33;;;;;;;;;;;978:1;969:10;;964:64;985:1;981;:5;964:64;;;997:6;1004:1;997:9;;;;;;;;;;;;;;;;;;:18;;:26;1016:6;997:26;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;997:26:1;988:3;;;;;;;964:64;;;790:241;;;;:::o;227:197::-;326:10;315:6;292:7;:19;300:10;292:19;;;;;;;;;;;;;;;;:29;;284:38;;;;;;;;346:30;;;;;;;;;;;;;;;;;;;326:51;;381:6;;;;;;;;;;;:11;;399:6;407:3;381:37;;;;412:5;381:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;227:197;;;:::o;427:77::-;464:4;481:7;:19;489:10;481:19;;;;;;;;;;;;;;;;474:26;;427:77;:::o;507:119::-;550:4;583:9;560:7;:19;568:10;560:19;;;;;;;;;;;;;;;;:32;;;;;;;;;;;603:7;:19;611:10;603:19;;;;;;;;;;;;;;;;596:26;;507:119;:::o;76:40::-;;;;;;;;;;;;;;;;;:::o;629:158::-;717:6;694:7;:19;702:10;694:19;;;;;;;;;;;;;;;;:29;;686:38;;;;;;;;751:6;728:7;:19;736:10;728:19;;;;;;;;;;;;;;;;:29;;;;;;;;;;;761:5;:14;;:22;776:6;761:22;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;761:22:1;629:158;;:::o", + "source": "pragma solidity ^0.4.19;\n\nimport \"./Transfers2.sol\";\n\ncontract Transfers {\n\tmapping (address => uint) public balance;\n\tTransfers2 t;\n\taddress t_addr;\n\n\tconstructor() public {\n\t\tt = new Transfers2();\n\t\tt_addr = address(t);\n\t}\n\n\tfunction transfer(address _addr, uint _value) public {\n\t\trequire(balance[msg.sender] >= _value);\n\t\tbytes4 sig = bytes4(keccak256(\"transfer(address)\"));\n\t\tt_addr.call.value(_value)(sig, _addr);\t\t\n\t}\n\n\tfunction myBalance() public returns (uint) {\n\t\treturn balance[msg.sender];\n\t}\n\n\tfunction deposit() public payable returns (uint) {\n\t\tbalance[msg.sender] += msg.value;\n\t\treturn balance[msg.sender];\n\t}\n\n\tfunction withdraw(address _addr, uint _value) public {\n\t\trequire(balance[msg.sender] >= _value);\n\t\tbalance[msg.sender] -= _value;\n\t\t_addr.transfer(_value);\n\t}\n\n\tfunction withdrawMulti(address[] _addrs, uint _value) public {\n\t\tuint l = _addrs.length;\n\t\trequire(balance[msg.sender] >= _value * l);\n\t\tbalance[msg.sender] -= _value * l;\n\t\tfor (uint i = 0; i < l; i++){\n\t\t\t_addrs[i].transfer(_value);\n\t\t}\n\t}\n}", + "sourcePath": "/Users/gregmarkou/Jobs/Jobs/ChainSafe/shyftNetwork/shyft_go-ethereum/shyft-cli/web3/transfer-through-master/contracts/Transfers.sol", + "ast": { + "absolutePath": "/Users/gregmarkou/Jobs/Jobs/ChainSafe/shyftNetwork/shyft_go-ethereum/shyft-cli/web3/transfer-through-master/contracts/Transfers.sol", + "exportedSymbols": { + "Transfers": [ + 233 + ] + }, + "id": 234, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 58, + "literals": [ + "solidity", + "^", + "0.4", + ".19" + ], + "nodeType": "PragmaDirective", + "src": "0:24:1" + }, + { + "absolutePath": "/Users/gregmarkou/Jobs/Jobs/ChainSafe/shyftNetwork/shyft_go-ethereum/shyft-cli/web3/transfer-through-master/contracts/Transfers2.sol", + "file": "./Transfers2.sol", + "id": 59, + "nodeType": "ImportDirective", + "scope": 234, + "sourceUnit": 250, + "src": "26:26:1", + "symbolAliases": [], + "unitAlias": "" + }, + { + "baseContracts": [], + "contractDependencies": [ + 249 + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 233, + "linearizedBaseContracts": [ + 233 + ], + "name": "Transfers", + "nodeType": "ContractDefinition", + "nodes": [ + { + "constant": false, + "id": 63, + "name": "balance", + "nodeType": "VariableDeclaration", + "scope": 233, + "src": "76:40:1", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + }, + "typeName": { + "id": 62, + "keyType": { + "id": 60, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "85:7:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "76:25:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + }, + "valueType": { + "id": 61, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "96:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 65, + "name": "t", + "nodeType": "VariableDeclaration", + "scope": 233, + "src": "119:12:1", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Transfers2_$249", + "typeString": "contract Transfers2" + }, + "typeName": { + "contractScope": null, + "id": 64, + "name": "Transfers2", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 249, + "src": "119:10:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Transfers2_$249", + "typeString": "contract Transfers2" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 67, + "name": "t_addr", + "nodeType": "VariableDeclaration", + "scope": 233, + "src": "134:14:1", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 66, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "134:7:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "body": { + "id": 82, + "nodeType": "Block", + "src": "173:51:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 74, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 70, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 65, + "src": "177:1:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Transfers2_$249", + "typeString": "contract Transfers2" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 72, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "NewExpression", + "src": "181:14:1", + "typeDescriptions": { + "typeIdentifier": "t_function_creation_nonpayable$__$returns$_t_contract$_Transfers2_$249_$", + "typeString": "function () returns (contract Transfers2)" + }, + "typeName": { + "contractScope": null, + "id": 71, + "name": "Transfers2", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 249, + "src": "185:10:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Transfers2_$249", + "typeString": "contract Transfers2" + } + } + }, + "id": 73, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "181:16:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Transfers2_$249", + "typeString": "contract Transfers2" + } + }, + "src": "177:20:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Transfers2_$249", + "typeString": "contract Transfers2" + } + }, + "id": 75, + "nodeType": "ExpressionStatement", + "src": "177:20:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 80, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 76, + "name": "t_addr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 67, + "src": "201:6:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 78, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 65, + "src": "218:1:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Transfers2_$249", + "typeString": "contract Transfers2" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_Transfers2_$249", + "typeString": "contract Transfers2" + } + ], + "id": 77, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "210:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 79, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "210:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "201:19:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 81, + "nodeType": "ExpressionStatement", + "src": "201:19:1" + } + ] + }, + "documentation": null, + "id": 83, + "implemented": true, + "isConstructor": true, + "isDeclaredConst": false, + "modifiers": [], + "name": "", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 68, + "nodeType": "ParameterList", + "parameters": [], + "src": "163:2:1" + }, + "payable": false, + "returnParameters": { + "id": 69, + "nodeType": "ParameterList", + "parameters": [], + "src": "173:0:1" + }, + "scope": 233, + "src": "152:72:1", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 118, + "nodeType": "Block", + "src": "280:144:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 96, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 91, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 63, + "src": "292:7:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 94, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 92, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 264, + "src": "300:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 93, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "300:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "292:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 95, + "name": "_value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 87, + "src": "315:6:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "292:29:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 90, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 267, + 268 + ], + "referencedDeclaration": 267, + "src": "284:7:1", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 97, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "284:38:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 98, + "nodeType": "ExpressionStatement", + "src": "284:38:1" + }, + { + "assignments": [ + 100 + ], + "declarations": [ + { + "constant": false, + "id": 100, + "name": "sig", + "nodeType": "VariableDeclaration", + "scope": 119, + "src": "326:10:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes4", + "typeString": "bytes4" + }, + "typeName": { + "id": 99, + "name": "bytes4", + "nodeType": "ElementaryTypeName", + "src": "326:6:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes4", + "typeString": "bytes4" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 106, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "7472616e73666572286164647265737329", + "id": 103, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "356:19:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_1a695230cbbb2b7dfd76397005587fe7ab9ee5f528dbc5a16361e8100dc2c499", + "typeString": "literal_string \"transfer(address)\"" + }, + "value": "transfer(address)" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_1a695230cbbb2b7dfd76397005587fe7ab9ee5f528dbc5a16361e8100dc2c499", + "typeString": "literal_string \"transfer(address)\"" + } + ], + "id": 102, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 258, + "src": "346:9:1", + "typeDescriptions": { + "typeIdentifier": "t_function_sha3_pure$__$returns$_t_bytes32_$", + "typeString": "function () pure returns (bytes32)" + } + }, + "id": 104, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "346:30:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 101, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "339:6:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes4_$", + "typeString": "type(bytes4)" + }, + "typeName": "bytes4" + }, + "id": 105, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "339:38:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes4", + "typeString": "bytes4" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "326:51:1" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 114, + "name": "sig", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 100, + "src": "407:3:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes4", + "typeString": "bytes4" + } + }, + { + "argumentTypes": null, + "id": 115, + "name": "_addr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 85, + "src": "412:5:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes4", + "typeString": "bytes4" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "arguments": [ + { + "argumentTypes": null, + "id": 112, + "name": "_value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 87, + "src": "399:6:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 107, + "name": "t_addr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 67, + "src": "381:6:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 110, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "call", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "381:11:1", + "typeDescriptions": { + "typeIdentifier": "t_function_barecall_payable$__$returns$_t_bool_$", + "typeString": "function () payable returns (bool)" + } + }, + "id": 111, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "value", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "381:17:1", + "typeDescriptions": { + "typeIdentifier": "t_function_setvalue_nonpayable$_t_uint256_$returns$_t_function_barecall_payable$__$returns$_t_bool_$value_$", + "typeString": "function (uint256) returns (function () payable returns (bool))" + } + }, + "id": 113, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "381:25:1", + "typeDescriptions": { + "typeIdentifier": "t_function_barecall_payable$__$returns$_t_bool_$value", + "typeString": "function () payable returns (bool)" + } + }, + "id": 116, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "381:37:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 117, + "nodeType": "ExpressionStatement", + "src": "381:37:1" + } + ] + }, + "documentation": null, + "id": 119, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [], + "name": "transfer", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 88, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 85, + "name": "_addr", + "nodeType": "VariableDeclaration", + "scope": 119, + "src": "245:13:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 84, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "245:7:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 87, + "name": "_value", + "nodeType": "VariableDeclaration", + "scope": 119, + "src": "260:11:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 86, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "260:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "244:28:1" + }, + "payable": false, + "returnParameters": { + "id": 89, + "nodeType": "ParameterList", + "parameters": [], + "src": "280:0:1" + }, + "scope": 233, + "src": "227:197:1", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 129, + "nodeType": "Block", + "src": "470:34:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 124, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 63, + "src": "481:7:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 127, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 125, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 264, + "src": "489:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 126, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "489:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "481:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 123, + "id": 128, + "nodeType": "Return", + "src": "474:26:1" + } + ] + }, + "documentation": null, + "id": 130, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [], + "name": "myBalance", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 120, + "nodeType": "ParameterList", + "parameters": [], + "src": "445:2:1" + }, + "payable": false, + "returnParameters": { + "id": 123, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 122, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 130, + "src": "464:4:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 121, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "464:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "463:6:1" + }, + "scope": 233, + "src": "427:77:1", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 148, + "nodeType": "Block", + "src": "556:70:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 141, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 135, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 63, + "src": "560:7:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 138, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 136, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 264, + "src": "568:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 137, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "568:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "560:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "+=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 139, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 264, + "src": "583:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 140, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "value", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "583:9:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "560:32:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 142, + "nodeType": "ExpressionStatement", + "src": "560:32:1" + }, + { + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 143, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 63, + "src": "603:7:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 146, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 144, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 264, + "src": "611:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 145, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "611:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "603:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 134, + "id": 147, + "nodeType": "Return", + "src": "596:26:1" + } + ] + }, + "documentation": null, + "id": 149, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [], + "name": "deposit", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 131, + "nodeType": "ParameterList", + "parameters": [], + "src": "523:2:1" + }, + "payable": true, + "returnParameters": { + "id": 134, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 133, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 149, + "src": "550:4:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 132, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "550:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "549:6:1" + }, + "scope": 233, + "src": "507:119:1", + "stateMutability": "payable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 178, + "nodeType": "Block", + "src": "682:105:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 162, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 157, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 63, + "src": "694:7:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 160, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 158, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 264, + "src": "702:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 159, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "702:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "694:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 161, + "name": "_value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 153, + "src": "717:6:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "694:29:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 156, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 267, + 268 + ], + "referencedDeclaration": 267, + "src": "686:7:1", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 163, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "686:38:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 164, + "nodeType": "ExpressionStatement", + "src": "686:38:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 170, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 165, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 63, + "src": "728:7:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 168, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 166, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 264, + "src": "736:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 167, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "736:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "728:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "-=", + "rightHandSide": { + "argumentTypes": null, + "id": 169, + "name": "_value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 153, + "src": "751:6:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "728:29:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 171, + "nodeType": "ExpressionStatement", + "src": "728:29:1" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 175, + "name": "_value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 153, + "src": "776:6:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 172, + "name": "_addr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 151, + "src": "761:5:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 174, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transfer", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "761:14:1", + "typeDescriptions": { + "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 176, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "761:22:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 177, + "nodeType": "ExpressionStatement", + "src": "761:22:1" + } + ] + }, + "documentation": null, + "id": 179, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [], + "name": "withdraw", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 154, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 151, + "name": "_addr", + "nodeType": "VariableDeclaration", + "scope": 179, + "src": "647:13:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 150, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "647:7:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 153, + "name": "_value", + "nodeType": "VariableDeclaration", + "scope": 179, + "src": "662:11:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 152, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "662:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "646:28:1" + }, + "payable": false, + "returnParameters": { + "id": 155, + "nodeType": "ParameterList", + "parameters": [], + "src": "682:0:1" + }, + "scope": 233, + "src": "629:158:1", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 231, + "nodeType": "Block", + "src": "851:180:1", + "statements": [ + { + "assignments": [ + 188 + ], + "declarations": [ + { + "constant": false, + "id": 188, + "name": "l", + "nodeType": "VariableDeclaration", + "scope": 232, + "src": "855:6:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 187, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "855:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 191, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 189, + "name": "_addrs", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 182, + "src": "864:6:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 190, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "864:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "855:22:1" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 200, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 193, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 63, + "src": "889:7:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 196, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 194, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 264, + "src": "897:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 195, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "897:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "889:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 199, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 197, + "name": "_value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 184, + "src": "912:6:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "argumentTypes": null, + "id": 198, + "name": "l", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 188, + "src": "921:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "912:10:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "889:33:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 192, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 267, + 268 + ], + "referencedDeclaration": 267, + "src": "881:7:1", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 201, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "881:42:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 202, + "nodeType": "ExpressionStatement", + "src": "881:42:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 210, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 203, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 63, + "src": "927:7:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 206, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 204, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 264, + "src": "935:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 205, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "935:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "927:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "-=", + "rightHandSide": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 209, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 207, + "name": "_value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 184, + "src": "950:6:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "argumentTypes": null, + "id": 208, + "name": "l", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 188, + "src": "959:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "950:10:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "927:33:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 211, + "nodeType": "ExpressionStatement", + "src": "927:33:1" + }, + { + "body": { + "id": 229, + "nodeType": "Block", + "src": "992:36:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 226, + "name": "_value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 184, + "src": "1016:6:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 222, + "name": "_addrs", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 182, + "src": "997:6:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 224, + "indexExpression": { + "argumentTypes": null, + "id": 223, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 213, + "src": "1004:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "997:9:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 225, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transfer", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "997:18:1", + "typeDescriptions": { + "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 227, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "997:26:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 228, + "nodeType": "ExpressionStatement", + "src": "997:26:1" + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 218, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 216, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 213, + "src": "981:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "id": 217, + "name": "l", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 188, + "src": "985:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "981:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 230, + "initializationExpression": { + "assignments": [ + 213 + ], + "declarations": [ + { + "constant": false, + "id": 213, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 232, + "src": "969:6:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 212, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "969:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 215, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 214, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "978:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "969:10:1" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 220, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "988:3:1", + "subExpression": { + "argumentTypes": null, + "id": 219, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 213, + "src": "988:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 221, + "nodeType": "ExpressionStatement", + "src": "988:3:1" + }, + "nodeType": "ForStatement", + "src": "964:64:1" + } + ] + }, + "documentation": null, + "id": 232, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [], + "name": "withdrawMulti", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 185, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 182, + "name": "_addrs", + "nodeType": "VariableDeclaration", + "scope": 232, + "src": "813:16:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 180, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "813:7:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 181, + "length": null, + "nodeType": "ArrayTypeName", + "src": "813:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 184, + "name": "_value", + "nodeType": "VariableDeclaration", + "scope": 232, + "src": "831:11:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 183, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "831:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "812:31:1" + }, + "payable": false, + "returnParameters": { + "id": 186, + "nodeType": "ParameterList", + "parameters": [], + "src": "851:0:1" + }, + "scope": 233, + "src": "790:241:1", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 234, + "src": "54:979:1" + } + ], + "src": "0:1033:1" + }, + "legacyAST": { + "absolutePath": "/Users/gregmarkou/Jobs/Jobs/ChainSafe/shyftNetwork/shyft_go-ethereum/shyft-cli/web3/transfer-through-master/contracts/Transfers.sol", + "exportedSymbols": { + "Transfers": [ + 233 + ] + }, + "id": 234, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 58, + "literals": [ + "solidity", + "^", + "0.4", + ".19" + ], + "nodeType": "PragmaDirective", + "src": "0:24:1" + }, + { + "absolutePath": "/Users/gregmarkou/Jobs/Jobs/ChainSafe/shyftNetwork/shyft_go-ethereum/shyft-cli/web3/transfer-through-master/contracts/Transfers2.sol", + "file": "./Transfers2.sol", + "id": 59, + "nodeType": "ImportDirective", + "scope": 234, + "sourceUnit": 250, + "src": "26:26:1", + "symbolAliases": [], + "unitAlias": "" + }, + { + "baseContracts": [], + "contractDependencies": [ + 249 + ], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 233, + "linearizedBaseContracts": [ + 233 + ], + "name": "Transfers", + "nodeType": "ContractDefinition", + "nodes": [ + { + "constant": false, + "id": 63, + "name": "balance", + "nodeType": "VariableDeclaration", + "scope": 233, + "src": "76:40:1", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + }, + "typeName": { + "id": 62, + "keyType": { + "id": 60, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "85:7:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "76:25:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + }, + "valueType": { + "id": 61, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "96:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "constant": false, + "id": 65, + "name": "t", + "nodeType": "VariableDeclaration", + "scope": 233, + "src": "119:12:1", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Transfers2_$249", + "typeString": "contract Transfers2" + }, + "typeName": { + "contractScope": null, + "id": 64, + "name": "Transfers2", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 249, + "src": "119:10:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Transfers2_$249", + "typeString": "contract Transfers2" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 67, + "name": "t_addr", + "nodeType": "VariableDeclaration", + "scope": 233, + "src": "134:14:1", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 66, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "134:7:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "body": { + "id": 82, + "nodeType": "Block", + "src": "173:51:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 74, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 70, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 65, + "src": "177:1:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Transfers2_$249", + "typeString": "contract Transfers2" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 72, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "NewExpression", + "src": "181:14:1", + "typeDescriptions": { + "typeIdentifier": "t_function_creation_nonpayable$__$returns$_t_contract$_Transfers2_$249_$", + "typeString": "function () returns (contract Transfers2)" + }, + "typeName": { + "contractScope": null, + "id": 71, + "name": "Transfers2", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 249, + "src": "185:10:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Transfers2_$249", + "typeString": "contract Transfers2" + } + } + }, + "id": 73, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "181:16:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Transfers2_$249", + "typeString": "contract Transfers2" + } + }, + "src": "177:20:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Transfers2_$249", + "typeString": "contract Transfers2" + } + }, + "id": 75, + "nodeType": "ExpressionStatement", + "src": "177:20:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 80, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 76, + "name": "t_addr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 67, + "src": "201:6:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 78, + "name": "t", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 65, + "src": "218:1:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Transfers2_$249", + "typeString": "contract Transfers2" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_Transfers2_$249", + "typeString": "contract Transfers2" + } + ], + "id": 77, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "210:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 79, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "210:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "201:19:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 81, + "nodeType": "ExpressionStatement", + "src": "201:19:1" + } + ] + }, + "documentation": null, + "id": 83, + "implemented": true, + "isConstructor": true, + "isDeclaredConst": false, + "modifiers": [], + "name": "", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 68, + "nodeType": "ParameterList", + "parameters": [], + "src": "163:2:1" + }, + "payable": false, + "returnParameters": { + "id": 69, + "nodeType": "ParameterList", + "parameters": [], + "src": "173:0:1" + }, + "scope": 233, + "src": "152:72:1", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 118, + "nodeType": "Block", + "src": "280:144:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 96, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 91, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 63, + "src": "292:7:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 94, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 92, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 264, + "src": "300:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 93, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "300:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "292:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 95, + "name": "_value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 87, + "src": "315:6:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "292:29:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 90, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 267, + 268 + ], + "referencedDeclaration": 267, + "src": "284:7:1", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 97, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "284:38:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 98, + "nodeType": "ExpressionStatement", + "src": "284:38:1" + }, + { + "assignments": [ + 100 + ], + "declarations": [ + { + "constant": false, + "id": 100, + "name": "sig", + "nodeType": "VariableDeclaration", + "scope": 119, + "src": "326:10:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes4", + "typeString": "bytes4" + }, + "typeName": { + "id": 99, + "name": "bytes4", + "nodeType": "ElementaryTypeName", + "src": "326:6:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes4", + "typeString": "bytes4" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 106, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "7472616e73666572286164647265737329", + "id": 103, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "356:19:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_1a695230cbbb2b7dfd76397005587fe7ab9ee5f528dbc5a16361e8100dc2c499", + "typeString": "literal_string \"transfer(address)\"" + }, + "value": "transfer(address)" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_1a695230cbbb2b7dfd76397005587fe7ab9ee5f528dbc5a16361e8100dc2c499", + "typeString": "literal_string \"transfer(address)\"" + } + ], + "id": 102, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 258, + "src": "346:9:1", + "typeDescriptions": { + "typeIdentifier": "t_function_sha3_pure$__$returns$_t_bytes32_$", + "typeString": "function () pure returns (bytes32)" + } + }, + "id": 104, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "346:30:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 101, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "339:6:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes4_$", + "typeString": "type(bytes4)" + }, + "typeName": "bytes4" + }, + "id": 105, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "339:38:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes4", + "typeString": "bytes4" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "326:51:1" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 114, + "name": "sig", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 100, + "src": "407:3:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes4", + "typeString": "bytes4" + } + }, + { + "argumentTypes": null, + "id": 115, + "name": "_addr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 85, + "src": "412:5:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes4", + "typeString": "bytes4" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "arguments": [ + { + "argumentTypes": null, + "id": 112, + "name": "_value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 87, + "src": "399:6:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 107, + "name": "t_addr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 67, + "src": "381:6:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 110, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "call", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "381:11:1", + "typeDescriptions": { + "typeIdentifier": "t_function_barecall_payable$__$returns$_t_bool_$", + "typeString": "function () payable returns (bool)" + } + }, + "id": 111, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "value", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "381:17:1", + "typeDescriptions": { + "typeIdentifier": "t_function_setvalue_nonpayable$_t_uint256_$returns$_t_function_barecall_payable$__$returns$_t_bool_$value_$", + "typeString": "function (uint256) returns (function () payable returns (bool))" + } + }, + "id": 113, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "381:25:1", + "typeDescriptions": { + "typeIdentifier": "t_function_barecall_payable$__$returns$_t_bool_$value", + "typeString": "function () payable returns (bool)" + } + }, + "id": 116, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "381:37:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 117, + "nodeType": "ExpressionStatement", + "src": "381:37:1" + } + ] + }, + "documentation": null, + "id": 119, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [], + "name": "transfer", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 88, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 85, + "name": "_addr", + "nodeType": "VariableDeclaration", + "scope": 119, + "src": "245:13:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 84, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "245:7:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 87, + "name": "_value", + "nodeType": "VariableDeclaration", + "scope": 119, + "src": "260:11:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 86, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "260:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "244:28:1" + }, + "payable": false, + "returnParameters": { + "id": 89, + "nodeType": "ParameterList", + "parameters": [], + "src": "280:0:1" + }, + "scope": 233, + "src": "227:197:1", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 129, + "nodeType": "Block", + "src": "470:34:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 124, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 63, + "src": "481:7:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 127, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 125, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 264, + "src": "489:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 126, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "489:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "481:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 123, + "id": 128, + "nodeType": "Return", + "src": "474:26:1" + } + ] + }, + "documentation": null, + "id": 130, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [], + "name": "myBalance", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 120, + "nodeType": "ParameterList", + "parameters": [], + "src": "445:2:1" + }, + "payable": false, + "returnParameters": { + "id": 123, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 122, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 130, + "src": "464:4:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 121, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "464:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "463:6:1" + }, + "scope": 233, + "src": "427:77:1", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 148, + "nodeType": "Block", + "src": "556:70:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 141, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 135, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 63, + "src": "560:7:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 138, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 136, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 264, + "src": "568:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 137, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "568:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "560:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "+=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 139, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 264, + "src": "583:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 140, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "value", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "583:9:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "560:32:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 142, + "nodeType": "ExpressionStatement", + "src": "560:32:1" + }, + { + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 143, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 63, + "src": "603:7:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 146, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 144, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 264, + "src": "611:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 145, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "611:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "603:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 134, + "id": 147, + "nodeType": "Return", + "src": "596:26:1" + } + ] + }, + "documentation": null, + "id": 149, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [], + "name": "deposit", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 131, + "nodeType": "ParameterList", + "parameters": [], + "src": "523:2:1" + }, + "payable": true, + "returnParameters": { + "id": 134, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 133, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 149, + "src": "550:4:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 132, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "550:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "549:6:1" + }, + "scope": 233, + "src": "507:119:1", + "stateMutability": "payable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 178, + "nodeType": "Block", + "src": "682:105:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 162, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 157, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 63, + "src": "694:7:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 160, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 158, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 264, + "src": "702:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 159, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "702:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "694:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 161, + "name": "_value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 153, + "src": "717:6:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "694:29:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 156, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 267, + 268 + ], + "referencedDeclaration": 267, + "src": "686:7:1", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 163, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "686:38:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 164, + "nodeType": "ExpressionStatement", + "src": "686:38:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 170, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 165, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 63, + "src": "728:7:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 168, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 166, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 264, + "src": "736:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 167, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "736:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "728:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "-=", + "rightHandSide": { + "argumentTypes": null, + "id": 169, + "name": "_value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 153, + "src": "751:6:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "728:29:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 171, + "nodeType": "ExpressionStatement", + "src": "728:29:1" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 175, + "name": "_value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 153, + "src": "776:6:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 172, + "name": "_addr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 151, + "src": "761:5:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 174, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transfer", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "761:14:1", + "typeDescriptions": { + "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 176, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "761:22:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 177, + "nodeType": "ExpressionStatement", + "src": "761:22:1" + } + ] + }, + "documentation": null, + "id": 179, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [], + "name": "withdraw", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 154, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 151, + "name": "_addr", + "nodeType": "VariableDeclaration", + "scope": 179, + "src": "647:13:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 150, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "647:7:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 153, + "name": "_value", + "nodeType": "VariableDeclaration", + "scope": 179, + "src": "662:11:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 152, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "662:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "646:28:1" + }, + "payable": false, + "returnParameters": { + "id": 155, + "nodeType": "ParameterList", + "parameters": [], + "src": "682:0:1" + }, + "scope": 233, + "src": "629:158:1", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 231, + "nodeType": "Block", + "src": "851:180:1", + "statements": [ + { + "assignments": [ + 188 + ], + "declarations": [ + { + "constant": false, + "id": 188, + "name": "l", + "nodeType": "VariableDeclaration", + "scope": 232, + "src": "855:6:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 187, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "855:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 191, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 189, + "name": "_addrs", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 182, + "src": "864:6:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 190, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "864:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "855:22:1" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 200, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 193, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 63, + "src": "889:7:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 196, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 194, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 264, + "src": "897:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 195, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "897:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "889:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 199, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 197, + "name": "_value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 184, + "src": "912:6:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "argumentTypes": null, + "id": 198, + "name": "l", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 188, + "src": "921:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "912:10:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "889:33:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 192, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 267, + 268 + ], + "referencedDeclaration": 267, + "src": "881:7:1", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 201, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "881:42:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 202, + "nodeType": "ExpressionStatement", + "src": "881:42:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 210, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 203, + "name": "balance", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 63, + "src": "927:7:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 206, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 204, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 264, + "src": "935:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 205, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "935:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "927:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "-=", + "rightHandSide": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 209, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 207, + "name": "_value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 184, + "src": "950:6:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "argumentTypes": null, + "id": 208, + "name": "l", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 188, + "src": "959:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "950:10:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "927:33:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 211, + "nodeType": "ExpressionStatement", + "src": "927:33:1" + }, + { + "body": { + "id": 229, + "nodeType": "Block", + "src": "992:36:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 226, + "name": "_value", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 184, + "src": "1016:6:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 222, + "name": "_addrs", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 182, + "src": "997:6:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 224, + "indexExpression": { + "argumentTypes": null, + "id": 223, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 213, + "src": "1004:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "997:9:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 225, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transfer", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "997:18:1", + "typeDescriptions": { + "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 227, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "997:26:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 228, + "nodeType": "ExpressionStatement", + "src": "997:26:1" + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 218, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 216, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 213, + "src": "981:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "id": 217, + "name": "l", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 188, + "src": "985:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "981:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 230, + "initializationExpression": { + "assignments": [ + 213 + ], + "declarations": [ + { + "constant": false, + "id": 213, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 232, + "src": "969:6:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 212, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "969:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 215, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 214, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "978:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "969:10:1" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 220, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "988:3:1", + "subExpression": { + "argumentTypes": null, + "id": 219, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 213, + "src": "988:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 221, + "nodeType": "ExpressionStatement", + "src": "988:3:1" + }, + "nodeType": "ForStatement", + "src": "964:64:1" + } + ] + }, + "documentation": null, + "id": 232, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [], + "name": "withdrawMulti", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 185, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 182, + "name": "_addrs", + "nodeType": "VariableDeclaration", + "scope": 232, + "src": "813:16:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 180, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "813:7:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 181, + "length": null, + "nodeType": "ArrayTypeName", + "src": "813:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 184, + "name": "_value", + "nodeType": "VariableDeclaration", + "scope": 232, + "src": "831:11:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 183, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "831:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "812:31:1" + }, + "payable": false, + "returnParameters": { + "id": 186, + "nodeType": "ParameterList", + "parameters": [], + "src": "851:0:1" + }, + "scope": 233, + "src": "790:241:1", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 234, + "src": "54:979:1" + } + ], + "src": "0:1033:1" + }, + "compiler": { + "name": "solc", + "version": "0.4.24+commit.e67f0147.Emscripten.clang" + }, + "networks": { + "1": { + "events": {}, + "links": {}, + "address": "0x9c2b479e15bbd956237c7ef33d31bfa2a576f007", + "transactionHash": "0x3213d366cc00423edfdf5683a4d26b3e93467c88cbd5f953864ec46edb7673d9" + }, + "1528420224459": { + "events": {}, + "links": {}, + "address": "0xebfa192f69d390707f8908e10ed274d6e38dc04f", + "transactionHash": "0x86a60b4cd8a9abab600debe01793dd76d05b65e4aa37c144e51c7f42a9d4d93b" + } + }, + "schemaVersion": "2.0.0", + "updatedAt": "2018-06-08T15:58:27.902Z" +} \ No newline at end of file diff --git a/shyft-cli/web3/transfer-through-master/build/contracts/Transfers2.json b/shyft-cli/web3/transfer-through-master/build/contracts/Transfers2.json new file mode 100755 index 0000000000..765962721b --- /dev/null +++ b/shyft-cli/web3/transfer-through-master/build/contracts/Transfers2.json @@ -0,0 +1,423 @@ +{ + "contractName": "Transfers2", + "abi": [ + { + "constant": false, + "inputs": [ + { + "name": "_addr", + "type": "address" + } + ], + "name": "transfer", + "outputs": [], + "payable": true, + "stateMutability": "payable", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b5060ed8061001f6000396000f300608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631a695230146044575b600080fd5b6076600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506078565b005b8073ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f1935050505015801560bd573d6000803e3d6000fd5b50505600a165627a7a72305820e95f74106a3328ffadd8b0adb916d92497daab65998ee73cf40afff57dc4b29b0029", + "deployedBytecode": "0x608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631a695230146044575b600080fd5b6076600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506078565b005b8073ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f1935050505015801560bd573d6000803e3d6000fd5b50505600a165627a7a72305820e95f74106a3328ffadd8b0adb916d92497daab65998ee73cf40afff57dc4b29b0029", + "sourceMap": "26:106:2:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;26:106:2;;;;;;;", + "deployedSourceMap": "26:106:2:-;;;;;;;;;;;;;;;;;;;;;;;;49:81;;;;;;;;;;;;;;;;;;;;;;;;;;;;;101:5;:14;;:25;116:9;101:25;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;101:25:2;49:81;:::o", + "source": "pragma solidity ^0.4.19;\n\ncontract Transfers2 {\n\tfunction transfer(address _addr) public payable {\n\t\t_addr.transfer(msg.value);\n\t}\n}", + "sourcePath": "/Users/gregmarkou/Jobs/Jobs/ChainSafe/shyftNetwork/shyft_go-ethereum/shyft-cli/web3/transfer-through-master/contracts/Transfers2.sol", + "ast": { + "absolutePath": "/Users/gregmarkou/Jobs/Jobs/ChainSafe/shyftNetwork/shyft_go-ethereum/shyft-cli/web3/transfer-through-master/contracts/Transfers2.sol", + "exportedSymbols": { + "Transfers2": [ + 249 + ] + }, + "id": 250, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 235, + "literals": [ + "solidity", + "^", + "0.4", + ".19" + ], + "nodeType": "PragmaDirective", + "src": "0:24:2" + }, + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 249, + "linearizedBaseContracts": [ + 249 + ], + "name": "Transfers2", + "nodeType": "ContractDefinition", + "nodes": [ + { + "body": { + "id": 247, + "nodeType": "Block", + "src": "97:33:2", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 243, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 264, + "src": "116:3:2", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 244, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "value", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "116:9:2", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 240, + "name": "_addr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 237, + "src": "101:5:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 242, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transfer", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "101:14:2", + "typeDescriptions": { + "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 245, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "101:25:2", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 246, + "nodeType": "ExpressionStatement", + "src": "101:25:2" + } + ] + }, + "documentation": null, + "id": 248, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [], + "name": "transfer", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 238, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 237, + "name": "_addr", + "nodeType": "VariableDeclaration", + "scope": 248, + "src": "67:13:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 236, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "67:7:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "66:15:2" + }, + "payable": true, + "returnParameters": { + "id": 239, + "nodeType": "ParameterList", + "parameters": [], + "src": "97:0:2" + }, + "scope": 249, + "src": "49:81:2", + "stateMutability": "payable", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 250, + "src": "26:106:2" + } + ], + "src": "0:132:2" + }, + "legacyAST": { + "absolutePath": "/Users/gregmarkou/Jobs/Jobs/ChainSafe/shyftNetwork/shyft_go-ethereum/shyft-cli/web3/transfer-through-master/contracts/Transfers2.sol", + "exportedSymbols": { + "Transfers2": [ + 249 + ] + }, + "id": 250, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 235, + "literals": [ + "solidity", + "^", + "0.4", + ".19" + ], + "nodeType": "PragmaDirective", + "src": "0:24:2" + }, + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 249, + "linearizedBaseContracts": [ + 249 + ], + "name": "Transfers2", + "nodeType": "ContractDefinition", + "nodes": [ + { + "body": { + "id": 247, + "nodeType": "Block", + "src": "97:33:2", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 243, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 264, + "src": "116:3:2", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 244, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "value", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "116:9:2", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 240, + "name": "_addr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 237, + "src": "101:5:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 242, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transfer", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "101:14:2", + "typeDescriptions": { + "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 245, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "101:25:2", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 246, + "nodeType": "ExpressionStatement", + "src": "101:25:2" + } + ] + }, + "documentation": null, + "id": 248, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [], + "name": "transfer", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 238, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 237, + "name": "_addr", + "nodeType": "VariableDeclaration", + "scope": 248, + "src": "67:13:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 236, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "67:7:2", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "66:15:2" + }, + "payable": true, + "returnParameters": { + "id": 239, + "nodeType": "ParameterList", + "parameters": [], + "src": "97:0:2" + }, + "scope": 249, + "src": "49:81:2", + "stateMutability": "payable", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 250, + "src": "26:106:2" + } + ], + "src": "0:132:2" + }, + "compiler": { + "name": "solc", + "version": "0.4.24+commit.e67f0147.Emscripten.clang" + }, + "networks": { + "1": { + "events": {}, + "links": {}, + "address": "0xa863f8203ad95e9078f6300e7857a4cca4fb4c60", + "transactionHash": "0xb836110657221cb8ac728c0345ae03da1cb4313cfa0bb61285f31b780907af50" + }, + "1528420224459": { + "events": {}, + "links": {}, + "address": "0x411410538c50b116663acd654e34dc6bed601cf0", + "transactionHash": "0x43f3fed1df72adfe12dd0c2432f0625b4b50b0c151f9583a166722ed74786ce3" + } + }, + "schemaVersion": "2.0.0", + "updatedAt": "2018-06-08T15:58:27.899Z" +} \ No newline at end of file diff --git a/shyft-cli/web3/transfer-through-master/contracts/Migrations.sol b/shyft-cli/web3/transfer-through-master/contracts/Migrations.sol new file mode 100755 index 0000000000..c4efb65e21 --- /dev/null +++ b/shyft-cli/web3/transfer-through-master/contracts/Migrations.sol @@ -0,0 +1,23 @@ +pragma solidity ^0.4.23; + +contract Migrations { + address public owner; + uint public last_completed_migration; + + constructor() public { + owner = msg.sender; + } + + modifier restricted() { + if (msg.sender == owner) _; + } + + function setCompleted(uint completed) public restricted { + last_completed_migration = completed; + } + + function upgrade(address new_address) public restricted { + Migrations upgraded = Migrations(new_address); + upgraded.setCompleted(last_completed_migration); + } +} diff --git a/shyft-cli/web3/transfer-through-master/contracts/Transfers.sol b/shyft-cli/web3/transfer-through-master/contracts/Transfers.sol new file mode 100755 index 0000000000..9e7fbeef05 --- /dev/null +++ b/shyft-cli/web3/transfer-through-master/contracts/Transfers.sol @@ -0,0 +1,44 @@ +pragma solidity ^0.4.19; + +import "./Transfers2.sol"; + +contract Transfers { + mapping (address => uint) public balance; + Transfers2 t; + address t_addr; + + constructor() public { + t = new Transfers2(); + t_addr = address(t); + } + + function transfer(address _addr, uint _value) public { + require(balance[msg.sender] >= _value); + bytes4 sig = bytes4(keccak256("transfer(address)")); + t_addr.call.value(_value)(sig, _addr); + } + + function myBalance() public returns (uint) { + return balance[msg.sender]; + } + + function deposit() public payable returns (uint) { + balance[msg.sender] += msg.value; + return balance[msg.sender]; + } + + function withdraw(address _addr, uint _value) public { + require(balance[msg.sender] >= _value); + balance[msg.sender] -= _value; + _addr.transfer(_value); + } + + function withdrawMulti(address[] _addrs, uint _value) public { + uint l = _addrs.length; + require(balance[msg.sender] >= _value * l); + balance[msg.sender] -= _value * l; + for (uint i = 0; i < l; i++){ + _addrs[i].transfer(_value); + } + } +} \ No newline at end of file diff --git a/shyft-cli/web3/transfer-through-master/contracts/Transfers2.sol b/shyft-cli/web3/transfer-through-master/contracts/Transfers2.sol new file mode 100755 index 0000000000..2e6c7c2e75 --- /dev/null +++ b/shyft-cli/web3/transfer-through-master/contracts/Transfers2.sol @@ -0,0 +1,7 @@ +pragma solidity ^0.4.19; + +contract Transfers2 { + function transfer(address _addr) public payable { + _addr.transfer(msg.value); + } +} \ No newline at end of file diff --git a/shyft-cli/web3/transfer-through-master/migrations/1_initial_migration.js b/shyft-cli/web3/transfer-through-master/migrations/1_initial_migration.js new file mode 100755 index 0000000000..4d5f3f9b02 --- /dev/null +++ b/shyft-cli/web3/transfer-through-master/migrations/1_initial_migration.js @@ -0,0 +1,5 @@ +var Migrations = artifacts.require("./Migrations.sol"); + +module.exports = function(deployer) { + deployer.deploy(Migrations); +}; diff --git a/shyft-cli/web3/transfer-through-master/migrations/2_migrate.js b/shyft-cli/web3/transfer-through-master/migrations/2_migrate.js new file mode 100755 index 0000000000..b1067351fd --- /dev/null +++ b/shyft-cli/web3/transfer-through-master/migrations/2_migrate.js @@ -0,0 +1,7 @@ +var Transfers = artifacts.require('./Transfers.sol') +var Transfers2 = artifacts.require('./Transfers2.sol') + +module.exports = function (deployer) { + deployer.deploy(Transfers) + deployer.deploy(Transfers2) +} diff --git a/shyft-cli/web3/transfer-through-master/package-lock.json b/shyft-cli/web3/transfer-through-master/package-lock.json new file mode 100755 index 0000000000..326563a8c6 --- /dev/null +++ b/shyft-cli/web3/transfer-through-master/package-lock.json @@ -0,0 +1,5 @@ +{ + "name": "transfers", + "version": "1.0.0", + "lockfileVersion": 1 +} diff --git a/shyft-cli/web3/transfer-through-master/package.json b/shyft-cli/web3/transfer-through-master/package.json new file mode 100755 index 0000000000..df745f4570 --- /dev/null +++ b/shyft-cli/web3/transfer-through-master/package.json @@ -0,0 +1,15 @@ +{ + "name": "transfers", + "version": "1.0.0", + "description": "", + "main": "truffle-config.js", + "directories": { + "test": "test" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC" +} diff --git a/shyft-cli/web3/transfer-through-master/test/test.js b/shyft-cli/web3/transfer-through-master/test/test.js new file mode 100755 index 0000000000..6153da25c4 --- /dev/null +++ b/shyft-cli/web3/transfer-through-master/test/test.js @@ -0,0 +1,41 @@ +var Transfers = artifacts.require("Transfers"); +var Transfers2 = artifacts.require("Transfers2"); + +contract('Transfers', function(accounts) { + var addressA = web3.eth.accounts[0]; + var addressB = web3.eth.accounts[1]; + var transfers; + web3.eth.defaultAccount = web3.eth.accounts[0]; + + it("should initialize", async() => { + transfers = await Transfers.new(); + transfers2 = await Transfers2.new(); + assert(transfers !== undefined, ""); + assert(transfers2 !== undefined, ""); + }) + + it("should deposit", async() => { + let hash = await transfers.deposit({from: addressA, value: web3.toWei(4, "ether")}); + let bal = await transfers.deposit.call({from: addressA}); + console.log("\t\t[DEPOSIT TX]", hash.tx) + //console.log(bal); + }) + + it("should withdraw", async() => { + let prevB = await web3.eth.getBalance(addressB); + let hash = await transfers.withdraw(addressB, web3.toWei(1, "ether"), {from: addressA}); + let postB = await web3.eth.getBalance(addressB); + console.log("\t\t[WITHDRAW TX]", hash.tx) + //assert(postB - prevB == val, ""); + }) + + it("should transfer through other contract", async() => { + let val = 10; + let prevB = await web3.eth.getBalance(addressB); + + let hash = await transfers.transfer(addressB, web3.toWei(1, "ether"), {from: addressA}); + let postB = await web3.eth.getBalance(addressB); + console.log("\t\t[TRANSFER THROUGH TX]", hash.tx) + // assert(web3.fromWei(prevB,'wei') - web3.fromWei(postB,'wei') == val, ""); + }) +}) \ No newline at end of file diff --git a/shyft-cli/web3/transfer-through-master/truffle-config.js b/shyft-cli/web3/transfer-through-master/truffle-config.js new file mode 100755 index 0000000000..99b7dcd694 --- /dev/null +++ b/shyft-cli/web3/transfer-through-master/truffle-config.js @@ -0,0 +1,12 @@ +module.exports = { + // See + // to customize your Truffle configuration! + + networks: { + geth_testnet: { + host: "127.0.0.1", + port: 8545, + netword_id: "*" + } + } +}; diff --git a/shyft-cli/web3/transfer-through-master/truffle.js b/shyft-cli/web3/transfer-through-master/truffle.js new file mode 100755 index 0000000000..5b5f1104f8 --- /dev/null +++ b/shyft-cli/web3/transfer-through-master/truffle.js @@ -0,0 +1,10 @@ +module.exports = { + networks: { + development: { + host: 'localhost', + port: 8545, + network_id: '*', + //gasLimit: 6.7e6 + } + } +}; From 3f957e6ad167b6f35f24c6e2546055f0afc764ca Mon Sep 17 00:00:00 2001 From: greg Date: Fri, 8 Jun 2018 14:08:04 -0400 Subject: [PATCH 3/3] Add tracer logs --- eth/api_tracer.go | 8 ++++++++ eth/tracers/tracer.go | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/eth/api_tracer.go b/eth/api_tracer.go index 07c4457bc3..e639bba33a 100644 --- a/eth/api_tracer.go +++ b/eth/api_tracer.go @@ -532,6 +532,11 @@ func (api *PrivateDebugAPI) computeStateDB(block *types.Block, reexec uint64) (* // TraceTransaction returns the structured logs created during the execution of EVM // and returns them as a JSON object. func (api *PrivateDebugAPI) TraceTransaction(ctx context.Context, hash common.Hash, config *TraceConfig) (interface{}, error) { + fmt.Println("\n\n\t[API LOG]", api, "\n") + fmt.Printf("%+v\n", api.config) + fmt.Println("\n") + fmt.Printf("%+v\n", api.eth) + fmt.Println("\n") // Retrieve the transaction and assemble its EVM context tx, blockHash, _, index := core.GetTransaction(api.eth.ChainDb(), hash) if tx == nil { @@ -546,6 +551,9 @@ func (api *PrivateDebugAPI) TraceTransaction(ctx context.Context, hash common.Ha return nil, err } // Trace the transaction and return + //fmt.Println("\n\n\t\tRETURN") + //fmt.Println(api.traceTx(ctx, msg, vmctx, statedb, config)) + //fmt.Println("RETURN FINISHED") return api.traceTx(ctx, msg, vmctx, statedb, config) } diff --git a/eth/tracers/tracer.go b/eth/tracers/tracer.go index 4cec9e633c..f0afeab6cb 100644 --- a/eth/tracers/tracer.go +++ b/eth/tracers/tracer.go @@ -496,6 +496,9 @@ func wrapError(context string, err error) error { // CaptureStart implements the Tracer interface to initialize the tracing operation. func (jst *Tracer) CaptureStart(from common.Address, to common.Address, create bool, input []byte, gas uint64, value *big.Int) error { + //fmt.Println("\n\n\t\t type: ", reflect.TypeOf(input)) + fmt.Println("\t\t [TRACER INPUT]:", input) + fmt.Println("\t\t [TRACER INPUT STRING]:", string(input[:len(input)]), "\n\n") jst.ctx["type"] = "CALL" if create { jst.ctx["type"] = "CREATE" @@ -564,6 +567,9 @@ func (jst *Tracer) CaptureFault(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost // CaptureEnd is called after the call finishes to finalize the tracing. func (jst *Tracer) CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error) error { + //fmt.Println("\n\n\t\t", reflect.TypeOf(output)) + fmt.Println("\t\t [TRACER OUTPUT]:", output[:len(output)]) + fmt.Println("\t\t [TRACER OUTPUT STRING]:", string(output[:len(output)]), "\n\n") jst.ctx["output"] = output jst.ctx["gasUsed"] = gasUsed jst.ctx["time"] = t.String()