├── test ├── testpassword ├── 00_runGethNoInit.sh ├── 00_runGethNoInitIPC.sh ├── settings.txt ├── 00_runGeth.sh ├── testchain │ └── keystore │ │ ├── UTC--2017-05-20T02-37-30.360937280Z--a00af22d07c87d96eeeb0ed583f8f6ac7812827e │ │ ├── UTC--2017-05-20T02-37-58.104082316Z--a11aae29840fbb5c86e6fd4cf809eba183aef433 │ │ ├── UTC--2017-05-20T02-38-21.169063367Z--a22ab8a9d641ce77e06d98b7d7065d324d3d6976 │ │ ├── UTC--2017-05-20T02-38-41.707647638Z--a33a6c312d9ad0e0f2e95541beed0cc081621fd0 │ │ ├── UTC--2017-05-20T02-39-04.584040707Z--a44a08d3f6933c69212114bb66e2df1813651844 │ │ ├── UTC--2017-05-20T02-42-01.013666678Z--a55a151eb00fded1634d27d1127b4be4627079ea │ │ ├── UTC--2017-05-20T02-42-37.426191216Z--a66a85ede0cbe03694aa9d9de0bb19c99ff55bd9 │ │ ├── UTC--2017-05-20T02-42-58.899396047Z--a77a2b9d4b1c010a22a7c565dc418cef683dbcec │ │ ├── UTC--2017-05-20T02-47-09.150580614Z--a88a05d2b88283ce84c8325760b72a64591279a2 │ │ ├── UTC--2017-05-20T02-47-34.770098207Z--a99a0ae3354c06b1459fd441a32a3f71005d7da0 │ │ ├── UTC--2017-05-20T02-58-17.400859858Z--aaaa9de1e6c564446ebca0fd102d8bd92093c756 │ │ ├── UTC--2017-05-20T02-58-35.122799190Z--abba43e7594e3b76afb157989e93c6621497fd4b │ │ ├── UTC--2017-05-20T02-58-51.178332229Z--acca534c9f62ab495bd986e002ddf0f054caae4f │ │ ├── UTC--2017-05-20T02-59-14.034178720Z--adda9b762a00ff12711113bfdc36958b73d7f915 │ │ ├── UTC--2017-05-20T02-59-33.471449656Z--aeea63b5479b50f79583ec49dacdcf86ddeff392 │ │ └── UTC--2017-05-20T02-59-51.697690594Z--affa4d3a80add8ce4018540e056dacb649589394 ├── README.md ├── genesis.json ├── deploymentData.txt ├── 01_test1.sh ├── functions.js ├── test1results.txt ├── EncryptoTelToken.js └── test1output.txt ├── images ├── INC.png ├── ParityINCTransfer.png ├── EtherScanERC20Found.png ├── EtherScanERC20View.png ├── ParityINCWatchToken.png ├── EtherScanERC20Search.png ├── ParityINCMoveToWaves.png ├── ParityINCWatchContract.png ├── EthereumWalletINCTransfer.png ├── EthereumWalletINCWatchToken.png ├── MyEtherWalletINCMoveToWaves.png ├── MyEtherWalletINCWatchToken.png ├── EtherScanERC20AccountBalance.png ├── EthereumWalletINCMoveToWaves.png ├── MyEtherWalletINCWatchContract.png ├── ParityINCAccountTokenBalance.png ├── EthereumWalletINCWatchContract.png ├── MyEtherWalletINCTransferTokens.png ├── MyEtherWalletSendEtherAndTokens.png ├── EthereumWalletAccountTokenBalance.png ├── MyEtherWalletINCWatchContractFunctions.png ├── MyEtherWalletINCWatchTokenAccountBalance.png └── EthereumWalletINCWatchContractBalanceOfAndFunctions.png ├── .gitignore ├── README.md ├── LICENSE ├── contracts ├── Waves.sol ├── Incent.sol ├── RiptoBux.sol ├── WavesBitcoinToken.sol ├── WavesCommunityToken.sol └── EncryptoTelToken.sol └── EncryptoTelTokenSecurityAudit.md /test/testpassword: -------------------------------------------------------------------------------- 1 | testtest 2 | -------------------------------------------------------------------------------- /images/INC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bokkypoobah/Blockswap/HEAD/images/INC.png -------------------------------------------------------------------------------- /images/ParityINCTransfer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bokkypoobah/Blockswap/HEAD/images/ParityINCTransfer.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .project 3 | private 4 | private/* 5 | test/testchain/geth* 6 | test/testchain/history* 7 | -------------------------------------------------------------------------------- /images/EtherScanERC20Found.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bokkypoobah/Blockswap/HEAD/images/EtherScanERC20Found.png -------------------------------------------------------------------------------- /images/EtherScanERC20View.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bokkypoobah/Blockswap/HEAD/images/EtherScanERC20View.png -------------------------------------------------------------------------------- /images/ParityINCWatchToken.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bokkypoobah/Blockswap/HEAD/images/ParityINCWatchToken.png -------------------------------------------------------------------------------- /images/EtherScanERC20Search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bokkypoobah/Blockswap/HEAD/images/EtherScanERC20Search.png -------------------------------------------------------------------------------- /images/ParityINCMoveToWaves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bokkypoobah/Blockswap/HEAD/images/ParityINCMoveToWaves.png -------------------------------------------------------------------------------- /images/ParityINCWatchContract.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bokkypoobah/Blockswap/HEAD/images/ParityINCWatchContract.png -------------------------------------------------------------------------------- /images/EthereumWalletINCTransfer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bokkypoobah/Blockswap/HEAD/images/EthereumWalletINCTransfer.png -------------------------------------------------------------------------------- /images/EthereumWalletINCWatchToken.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bokkypoobah/Blockswap/HEAD/images/EthereumWalletINCWatchToken.png -------------------------------------------------------------------------------- /images/MyEtherWalletINCMoveToWaves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bokkypoobah/Blockswap/HEAD/images/MyEtherWalletINCMoveToWaves.png -------------------------------------------------------------------------------- /images/MyEtherWalletINCWatchToken.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bokkypoobah/Blockswap/HEAD/images/MyEtherWalletINCWatchToken.png -------------------------------------------------------------------------------- /images/EtherScanERC20AccountBalance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bokkypoobah/Blockswap/HEAD/images/EtherScanERC20AccountBalance.png -------------------------------------------------------------------------------- /images/EthereumWalletINCMoveToWaves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bokkypoobah/Blockswap/HEAD/images/EthereumWalletINCMoveToWaves.png -------------------------------------------------------------------------------- /images/MyEtherWalletINCWatchContract.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bokkypoobah/Blockswap/HEAD/images/MyEtherWalletINCWatchContract.png -------------------------------------------------------------------------------- /images/ParityINCAccountTokenBalance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bokkypoobah/Blockswap/HEAD/images/ParityINCAccountTokenBalance.png -------------------------------------------------------------------------------- /images/EthereumWalletINCWatchContract.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bokkypoobah/Blockswap/HEAD/images/EthereumWalletINCWatchContract.png -------------------------------------------------------------------------------- /images/MyEtherWalletINCTransferTokens.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bokkypoobah/Blockswap/HEAD/images/MyEtherWalletINCTransferTokens.png -------------------------------------------------------------------------------- /images/MyEtherWalletSendEtherAndTokens.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bokkypoobah/Blockswap/HEAD/images/MyEtherWalletSendEtherAndTokens.png -------------------------------------------------------------------------------- /images/EthereumWalletAccountTokenBalance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bokkypoobah/Blockswap/HEAD/images/EthereumWalletAccountTokenBalance.png -------------------------------------------------------------------------------- /images/MyEtherWalletINCWatchContractFunctions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bokkypoobah/Blockswap/HEAD/images/MyEtherWalletINCWatchContractFunctions.png -------------------------------------------------------------------------------- /images/MyEtherWalletINCWatchTokenAccountBalance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bokkypoobah/Blockswap/HEAD/images/MyEtherWalletINCWatchTokenAccountBalance.png -------------------------------------------------------------------------------- /images/EthereumWalletINCWatchContractBalanceOfAndFunctions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bokkypoobah/Blockswap/HEAD/images/EthereumWalletINCWatchContractBalanceOfAndFunctions.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Blockswap 2 | Swapping of tokens from Waves to Ethereum and back. 3 | 4 | See the [wiki](https://github.com/bokkypoobah/Blockswap/wiki) for more information. 5 | 6 |
7 | 8 | (c) Incent Loyalty Pty Ltd and Bok Consulting Pty Ltd 2017 9 | -------------------------------------------------------------------------------- /test/00_runGethNoInit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | geth --datadir ./testchain --unlock 0 --password ./testpassword --rpc --rpcapi "eth,net,web3,debug" --rpccorsdomain '*' --rpcport 8646 --port 32323 --mine --minerthreads 1 --maxpeers 0 --cache 1024 --targetgaslimit 994712388 console 4 | 5 | -------------------------------------------------------------------------------- /test/00_runGethNoInitIPC.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | geth --datadir ./testchain --unlock 0 --password ./testpassword --rpc --rpccorsdomain '*' --rpcport 8646 --port 32323 --mine --minerthreads 1 --maxpeers 0 --ipcpath /Users/bok/Library/Ethereum/geth.ipc --targetgaslimit 994712388 console 4 | 5 | -------------------------------------------------------------------------------- /test/settings.txt: -------------------------------------------------------------------------------- 1 | IPCFILE=ipc:./testchain/geth.ipc 2 | PASSWORD=testtest 3 | 4 | TOKENSOL=../contracts/EncryptoTelToken.sol 5 | TOKENJS=EncryptoTelToken.js 6 | 7 | DEPLOYMENTDATA=deploymentData.txt 8 | 9 | INCLUDEJS=./include.js 10 | TEST1OUTPUT=test1output.txt 11 | TEST1RESULTS=test1results.txt -------------------------------------------------------------------------------- /test/00_runGeth.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | rm -f ./testchain/geth/chaindata/* 4 | 5 | geth --datadir ./testchain init genesis.json 6 | 7 | geth --datadir ./testchain --unlock 0 --password ./testpassword --rpc --rpccorsdomain '*' --rpcport 8646 --rpcapi "eth,net,web3,debug" --port 32323 --mine --minerthreads 1 --maxpeers 0 --targetgaslimit 994712388 console 8 | 9 | -------------------------------------------------------------------------------- /test/testchain/keystore/UTC--2017-05-20T02-37-30.360937280Z--a00af22d07c87d96eeeb0ed583f8f6ac7812827e: -------------------------------------------------------------------------------- 1 | {"address":"a00af22d07c87d96eeeb0ed583f8f6ac7812827e","crypto":{"cipher":"aes-128-ctr","ciphertext":"beaef6b3628c1acf80877369d1dacdfb7f2faeab7d3f42a4de23260a804e0888","cipherparams":{"iv":"80a37ffc267761f99c868a66bb9c1db7"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"807a4ca34e14b5916400fbe53c3c1c6ce862b16dffb6bd4efa53ea582f88a6e1"},"mac":"d51a3264971d95448048670d83f76a5d070eaaafceb4cbb83434d1f9d2d0bdcc"},"id":"e3f0faf2-6ec2-4f29-a14e-c48d2d751b94","version":3} -------------------------------------------------------------------------------- /test/testchain/keystore/UTC--2017-05-20T02-37-58.104082316Z--a11aae29840fbb5c86e6fd4cf809eba183aef433: -------------------------------------------------------------------------------- 1 | {"address":"a11aae29840fbb5c86e6fd4cf809eba183aef433","crypto":{"cipher":"aes-128-ctr","ciphertext":"3f764510b47491063a67abf19f2d169e18292174000f9d31a7e66f6e0f09fdf0","cipherparams":{"iv":"49642a5e48f18cc96eb5d710c1f4edd4"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"c7c9cb821a91da4571397d6c9dacb879059038d82b80048599f59c4825816367"},"mac":"7e829480c58972bb4403b332a1bdf3e8ed05d80b817a3c4126673e377bd87255"},"id":"f1b73a4b-8229-4c3b-8844-f59f398087b0","version":3} -------------------------------------------------------------------------------- /test/testchain/keystore/UTC--2017-05-20T02-38-21.169063367Z--a22ab8a9d641ce77e06d98b7d7065d324d3d6976: -------------------------------------------------------------------------------- 1 | {"address":"a22ab8a9d641ce77e06d98b7d7065d324d3d6976","crypto":{"cipher":"aes-128-ctr","ciphertext":"16c725aff83d80ec865546cf647e9c19fd0a203d5095c6b9fbf4bfd4e80defc1","cipherparams":{"iv":"2b683eed143011528c8e4b6ccccdf2a9"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"4895b93d546ac49b1dbb5bbde462b0a7ee6edca1c7548ddcc3abbc332a1c9ea6"},"mac":"88d98792f510c7db3f3339352c3a368634bf67bfcfc7c724d4f855a09daac9b4"},"id":"baa6c875-74cf-4c02-ace7-c8c6aa32765f","version":3} -------------------------------------------------------------------------------- /test/testchain/keystore/UTC--2017-05-20T02-38-41.707647638Z--a33a6c312d9ad0e0f2e95541beed0cc081621fd0: -------------------------------------------------------------------------------- 1 | {"address":"a33a6c312d9ad0e0f2e95541beed0cc081621fd0","crypto":{"cipher":"aes-128-ctr","ciphertext":"1178ff5250ac5d55af191d0d01d19ee66ec650004bca969b3518571073435197","cipherparams":{"iv":"a785a27c1ea95e8bcdf13c4d4fb130a5"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"87ab24da9fc7f4420fba7d57eb684f07cd2b18882360dc9d8cdde5b8312a551c"},"mac":"aeef485337dc9062f94249a83e61ec0a96c811efddf5d61ec69f74f920e265b0"},"id":"7ab0d4a9-c6b5-426f-9445-1604929628c2","version":3} -------------------------------------------------------------------------------- /test/testchain/keystore/UTC--2017-05-20T02-39-04.584040707Z--a44a08d3f6933c69212114bb66e2df1813651844: -------------------------------------------------------------------------------- 1 | {"address":"a44a08d3f6933c69212114bb66e2df1813651844","crypto":{"cipher":"aes-128-ctr","ciphertext":"b8a8948cf419bde53ff3de97af0907fb10d5de7f945bf29ae08fd22b62b69c7a","cipherparams":{"iv":"9e6cb5ec4c4a27a3650e2b6521f49ca4"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"500e2951d0c3dc0d8499ced102b96e101e70228a13fd950f2900534feffc04b6"},"mac":"c2e95a9e9fbe604f0e779bc776070dfc65527e20d473aef83a9d1078b8dc840a"},"id":"356880ad-1c9d-4bd1-92ce-48de1a668c8f","version":3} -------------------------------------------------------------------------------- /test/testchain/keystore/UTC--2017-05-20T02-42-01.013666678Z--a55a151eb00fded1634d27d1127b4be4627079ea: -------------------------------------------------------------------------------- 1 | {"address":"a55a151eb00fded1634d27d1127b4be4627079ea","crypto":{"cipher":"aes-128-ctr","ciphertext":"9fc73c394da6d80a9154f3b85b62685d9798306008d6298fe838183e0ddbd37e","cipherparams":{"iv":"43de6ac066de8bc6a6890c764c3f3b59"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"ce145ac99bc65b15a1284a1daa4ec852334277cfd67063b9f656098837cb52f1"},"mac":"79e641b1e9b9d8e0ee19b63c54bbad9a17efcdcc26ae0aa46154cd2c37c52ed8"},"id":"47bfbb81-5b55-4cf4-9289-80e2fe0fbd9c","version":3} -------------------------------------------------------------------------------- /test/testchain/keystore/UTC--2017-05-20T02-42-37.426191216Z--a66a85ede0cbe03694aa9d9de0bb19c99ff55bd9: -------------------------------------------------------------------------------- 1 | {"address":"a66a85ede0cbe03694aa9d9de0bb19c99ff55bd9","crypto":{"cipher":"aes-128-ctr","ciphertext":"eb554404102ed496717838cbfbd6130d374abf0729f4f4e3f1e4ca3f128dbf88","cipherparams":{"iv":"b6ba2e970b40c9f679d25e1568614e92"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"530bf5db5d6ea5e0b3a6ef6fbe20040584bba9820ed99c2f8ff7935b9f75e760"},"mac":"acd41fff725d190b7e2d722180f637c5c57c0b923642bf9dca3b601ae4c9e2a2"},"id":"396c5807-24e8-4a78-a76e-5dfcd0e2dfe4","version":3} -------------------------------------------------------------------------------- /test/testchain/keystore/UTC--2017-05-20T02-42-58.899396047Z--a77a2b9d4b1c010a22a7c565dc418cef683dbcec: -------------------------------------------------------------------------------- 1 | {"address":"a77a2b9d4b1c010a22a7c565dc418cef683dbcec","crypto":{"cipher":"aes-128-ctr","ciphertext":"47a7bded5ad5be47b4926df495839157e106efeb07297e544324de67484a4634","cipherparams":{"iv":"f4c6ca1d4e20e4bc301c125f55215559"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"c2fe20e92bfb4de1b3687884a5377563b39ce434e0825dbd6f50ad62ec60f77b"},"mac":"048deb6bb3fbf078b55f1242fcdfd6b7ca240b89df6789c88b3295b2da0743d4"},"id":"46a2e757-d4e9-40ba-aec4-6640d7b74347","version":3} -------------------------------------------------------------------------------- /test/testchain/keystore/UTC--2017-05-20T02-47-09.150580614Z--a88a05d2b88283ce84c8325760b72a64591279a2: -------------------------------------------------------------------------------- 1 | {"address":"a88a05d2b88283ce84c8325760b72a64591279a2","crypto":{"cipher":"aes-128-ctr","ciphertext":"13eaaf2bc741112428b479e577ca6d31d94fe1dbf757ae4cf6489f82ea3d9d2e","cipherparams":{"iv":"00a52fd7e30c9b10e0d3a9be02e6efa5"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"86edf79626c1eed5ea7570bfa3fb964a219ea19e74aeabec53631922dd283474"},"mac":"3fc1ea0270c373fbd7c505f97e6f6de7e7df54aa9f84b1746aad298664b78d59"},"id":"5083b6d1-3059-457f-bdae-6a413a222428","version":3} -------------------------------------------------------------------------------- /test/testchain/keystore/UTC--2017-05-20T02-47-34.770098207Z--a99a0ae3354c06b1459fd441a32a3f71005d7da0: -------------------------------------------------------------------------------- 1 | {"address":"a99a0ae3354c06b1459fd441a32a3f71005d7da0","crypto":{"cipher":"aes-128-ctr","ciphertext":"44b634314e512dcb94d89df97489d763de2d40de303c9dbf05b73808cf5fc251","cipherparams":{"iv":"dba264a6e7ae77499d724beed1cd3e17"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"d89197404b33e64bb02f1cbddf7d2236fbddac047681b0744eedd26a5a07a1b1"},"mac":"1b9c130c652bb02f47313a24efe15363a69761a81afb0eff6baec6dce3a4db6d"},"id":"47cc9299-fea0-46c6-88e8-452fb714ca4c","version":3} -------------------------------------------------------------------------------- /test/testchain/keystore/UTC--2017-05-20T02-58-17.400859858Z--aaaa9de1e6c564446ebca0fd102d8bd92093c756: -------------------------------------------------------------------------------- 1 | {"address":"aaaa9de1e6c564446ebca0fd102d8bd92093c756","crypto":{"cipher":"aes-128-ctr","ciphertext":"2aa64a851aac3841c67f9108b8c69db08b458691ddfa6ee8c463eb3e4516a6f4","cipherparams":{"iv":"2f8362a6189ba7f73659fb9ea2fe186f"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"30cd1ce601b8925b46fb4d64fdb1d04d97efc8ba38788b285940cf0189ae6ea7"},"mac":"b49a521a1281ecba5e70a5f121e4472c80e669a0ab27b417023ab89178f4bfc7"},"id":"9ae73070-0b07-472c-bfe5-e07cbe66f289","version":3} -------------------------------------------------------------------------------- /test/testchain/keystore/UTC--2017-05-20T02-58-35.122799190Z--abba43e7594e3b76afb157989e93c6621497fd4b: -------------------------------------------------------------------------------- 1 | {"address":"abba43e7594e3b76afb157989e93c6621497fd4b","crypto":{"cipher":"aes-128-ctr","ciphertext":"18d4959c00b52dbeb67a78956e60667fb37c82f8b26f8991a2b53386fd5819d8","cipherparams":{"iv":"3dfd2e5245fe28ad8572ddad27e869d9"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"518e58f54d75f20171611129dc7d04a94e5f56324964904d2c393409de8284ee"},"mac":"149669967b7f3cf6cacb395e57e0b8d48e11fa58f557c044cf9aea6c82a9a60f"},"id":"be47d6a6-f747-4741-bdfd-33182d2f674d","version":3} -------------------------------------------------------------------------------- /test/testchain/keystore/UTC--2017-05-20T02-58-51.178332229Z--acca534c9f62ab495bd986e002ddf0f054caae4f: -------------------------------------------------------------------------------- 1 | {"address":"acca534c9f62ab495bd986e002ddf0f054caae4f","crypto":{"cipher":"aes-128-ctr","ciphertext":"b240ff5186c18714ff791124bd15a755adc371b7967e619e892f4af96e7bdba1","cipherparams":{"iv":"52da035b0fec4ca386cbd03b03ccad0d"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"6de8376d2b00d63704cc6fceda260f276c878c28dfde8d7bd090f22238aa7304"},"mac":"f4b1409d40bdb0dc593f8d0303abd59ca4739185aa0cce2b09645de37c7b86a2"},"id":"3cae58b4-bdd3-43ee-929c-b1eff57e10ad","version":3} -------------------------------------------------------------------------------- /test/testchain/keystore/UTC--2017-05-20T02-59-14.034178720Z--adda9b762a00ff12711113bfdc36958b73d7f915: -------------------------------------------------------------------------------- 1 | {"address":"adda9b762a00ff12711113bfdc36958b73d7f915","crypto":{"cipher":"aes-128-ctr","ciphertext":"477bfaef18a1c182af1c6bd05579f1aed334b218bb52d2349dec39b8894af897","cipherparams":{"iv":"78e45d798cacecff6c6899c283b57b0d"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"f76550251e7b02fbe099f9996681b17dfe0d318559080778308be7983b7d43cf"},"mac":"dcb9c3e48e4ce95fc3eac9a75661fb3071c01a1c23ee70eb273b24f30ee2810b"},"id":"b6b3a3ab-35fe-48aa-a74a-681a08cfea36","version":3} -------------------------------------------------------------------------------- /test/testchain/keystore/UTC--2017-05-20T02-59-33.471449656Z--aeea63b5479b50f79583ec49dacdcf86ddeff392: -------------------------------------------------------------------------------- 1 | {"address":"aeea63b5479b50f79583ec49dacdcf86ddeff392","crypto":{"cipher":"aes-128-ctr","ciphertext":"89ffb39f14534c36902a6c2b4b8cb22074b0a0910d81fb794f1c2b3811719991","cipherparams":{"iv":"1e3ac8bc6fa20515b8d62fee8053b777"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"183ceaf9806607298919b141012c589ba5b4a8c98015505e3b008fa5b3b09e68"},"mac":"5f08180c70ab20ec9c6d69ca933f025987ceb095c5f3997a40256843ed44d3bf"},"id":"b6dcecff-9bbb-40c5-bcea-501e3d610c7b","version":3} -------------------------------------------------------------------------------- /test/testchain/keystore/UTC--2017-05-20T02-59-51.697690594Z--affa4d3a80add8ce4018540e056dacb649589394: -------------------------------------------------------------------------------- 1 | {"address":"affa4d3a80add8ce4018540e056dacb649589394","crypto":{"cipher":"aes-128-ctr","ciphertext":"72b01c60d2a2fc2c3665375ef270733913cb6abbbc9a678888e6341e54dd1f72","cipherparams":{"iv":"4ef77b53a633b0300208001698ec8b40"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"a214816a6067f9d4b4835ccec8d9a685b14133861d14c32d2f9fd08ac9c59ec7"},"mac":"aeffd474ce26ee99e49938e0360e7e94728c5bfc2ec498baab7eae45b923ca1f"},"id":"8af80842-e108-4256-b33f-9fa5fb5f6de5","version":3} -------------------------------------------------------------------------------- /test/README.md: -------------------------------------------------------------------------------- 1 | # Blockswap Token - Testing 2 | 3 | Note that this recent testing only covers the EncryptoTel token 4 | 5 | ## Requirements 6 | 7 | * The tests works on OS/X. Should work in Linux. May work in Windows with Cygwin 8 | * Geth/v1.6.1-stable-021c3c28/darwin-amd64/go1.8.1 9 | * Solc 0.4.11+commit.68ef5810.Darwin.appleclang 10 | 11 |
12 | 13 |
14 | 15 | ## Executing The Tests 16 | 17 | * Run `geth` in dev mode 18 | 19 | ./00_runGeth.sh 20 | 21 | * Run the test in [01_test1.sh](01_test1.sh) 22 | 23 | ./01_test1.sh 24 | 25 | * See [test1results.txt](test1results.txt) for the results and [test1output.txt](test1output.txt) for the full output. 26 | 27 |
28 | 29 |
30 | 31 | ## Note 32 | 33 | These smart contract tests have been tested with the Mainnet `geth` client, using a Dev blockchain. 34 | This is to reduce the chances of any side effects from testing against Truffle or other testing frameworks. -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 BokkyPooBah 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /test/genesis.json: -------------------------------------------------------------------------------- 1 | { 2 | "config": { 3 | "homesteadBlock": 1 4 | }, 5 | "nonce": "0", 6 | "difficulty": "0x400", 7 | "mixhash": "0x00000000000000000000000000000000000000647572616c65787365646c6578", 8 | "coinbase": "0x0000000000000000000000000000000000000000", 9 | "timestamp": "0x00", 10 | "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", 11 | "extraData": "0x", 12 | "gasLimit": "0x3B4A1B44", 13 | "alloc": { 14 | "0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e": { 15 | "balance": "100000000000000000000000" 16 | }, 17 | "0xa11aae29840fbb5c86e6fd4cf809eba183aef433": { 18 | "balance": "100000000000000000000000" 19 | }, 20 | "0xa22ab8a9d641ce77e06d98b7d7065d324d3d6976": { 21 | "balance": "100000000000000000000000" 22 | }, 23 | "0xa33a6c312d9ad0e0f2e95541beed0cc081621fd0": { 24 | "balance": "100000000000000000000000" 25 | }, 26 | "0xa44a08d3f6933c69212114bb66e2df1813651844": { 27 | "balance": "100000000000000000000000" 28 | }, 29 | "0xa55a151eb00fded1634d27d1127b4be4627079ea": { 30 | "balance": "100000000000000000000000" 31 | }, 32 | "0xa66a85ede0cbe03694aa9d9de0bb19c99ff55bd9": { 33 | "balance": "100000000000000000000000" 34 | }, 35 | "0xa77a2b9d4b1c010a22a7c565dc418cef683dbcec": { 36 | "balance": "100000000000000000000000" 37 | }, 38 | "0xa88a05d2b88283ce84c8325760b72a64591279a2": { 39 | "balance": "100000000000000000000000" 40 | }, 41 | "0xa99a0ae3354c06b1459fd441a32a3f71005d7da0": { 42 | "balance": "100000000000000000000000" 43 | }, 44 | "0xaaaa9de1e6c564446ebca0fd102d8bd92093c756": { 45 | "balance": "100000000000000000000000" 46 | }, 47 | "0xabba43e7594e3b76afb157989e93c6621497fd4b": { 48 | "balance": "100000000000000000000000" 49 | }, 50 | "0xacca534c9f62ab495bd986e002ddf0f054caae4f": { 51 | "balance": "100000000000000000000000" 52 | }, 53 | "0xadda9b762a00ff12711113bfdc36958b73d7f915": { 54 | "balance": "100000000000000000000000" 55 | }, 56 | "0xaeea63b5479b50f79583ec49dacdcf86ddeff392": { 57 | "balance": "100000000000000000000000" 58 | }, 59 | "0xaffa4d3a80add8ce4018540e056dacb649589394": { 60 | "balance": "100000000000000000000000" 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /test/deploymentData.txt: -------------------------------------------------------------------------------- 1 | tokenABI=[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_amount","type":"uint256"}],"name":"approve","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_amount","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"wavesAddress","type":"string"},{"name":"amount","type":"uint256"}],"name":"moveToWaves","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"TOTALSUPPLY","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_amount","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"newOwner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"tokenAddress","type":"address"},{"name":"amount","type":"uint256"}],"name":"transferAnyERC20Token","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"type":"function"},{"inputs":[],"payable":false,"type":"constructor"},{"payable":false,"type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":false,"name":"wavesAddress","type":"string"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"WavesTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_owner","type":"address"},{"indexed":true,"name":"_spender","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"}],"name":"OwnershipTransferred","type":"event"}] 2 | tokenAddress=0x90d8927407c79c4a28ee879b821c76fc9bcc2688 3 | -------------------------------------------------------------------------------- /contracts/Waves.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.8; 2 | 3 | // ---------------------------------------------------------------------------------------------- 4 | // The Waves / ETH smart contract - to find out more, join the Incent Slack; http://incentinvites.herokuapp.com/ 5 | // A collaboration between Incent and Bok :) 6 | // Enjoy. (c) Incent Loyalty Pty Ltd and Bok Consulting Pty Ltd 2017. The MIT Licence. 7 | // ---------------------------------------------------------------------------------------------- 8 | 9 | // Contract configuration 10 | contract TokenConfig { 11 | string public constant symbol = "WAV"; 12 | string public constant name = "Waves"; 13 | uint8 public constant decimals = 8; // 8 decimal places, the same as tokens on Wave 14 | uint256 _totalSupply = 10000000000000000; 15 | } 16 | 17 | // ERC Token Standard #20 Interface 18 | // https://github.com/ethereum/EIPs/issues/20 19 | contract ERC20Interface { 20 | // Get the total token supply 21 | function totalSupply() constant returns (uint256 totalSupply); 22 | 23 | // Get the account balance of another account with address _owner 24 | function balanceOf(address _owner) constant returns (uint256 balance); 25 | 26 | // Send _value amount of tokens to address _to 27 | function transfer(address _to, uint256 _value) returns (bool success); 28 | 29 | // Send _value amount of tokens from address _from to address _to 30 | function transferFrom(address _from, address _to, uint256 _value) returns (bool success); 31 | 32 | // Allow _spender to withdraw from your account, multiple times, up to the _value amount. 33 | // If this function is called again it overwrites the current allowance with _value. 34 | // this function is required for some DEX functionality 35 | function approve(address _spender, uint256 _value) returns (bool success); 36 | 37 | // Returns the amount which _spender is still allowed to withdraw from _owner 38 | function allowance(address _owner, address _spender) constant returns (uint256 remaining); 39 | 40 | // Triggered when tokens are transferred. 41 | event Transfer(address indexed _from, address indexed _to, uint256 _value); 42 | 43 | // Triggered whenever approve(address _spender, uint256 _value) is called. 44 | event Approval(address indexed _owner, address indexed _spender, uint256 _value); 45 | } 46 | 47 | contract WavesToken is ERC20Interface, TokenConfig { 48 | // Owner of this contract 49 | address public owner; 50 | 51 | // Balances for each account 52 | mapping(address => uint256) balances; 53 | 54 | // Owner of account approves the transfer of an amount to another account 55 | mapping(address => mapping (address => uint256)) allowed; 56 | 57 | // Functions with this modifier can only be executed by the owner 58 | modifier onlyOwner() { 59 | if (msg.sender != owner) { 60 | throw; 61 | } 62 | _; 63 | } 64 | 65 | // Constructor 66 | function WavesToken() { 67 | owner = msg.sender; 68 | balances[owner] = _totalSupply; 69 | } 70 | 71 | function totalSupply() constant returns (uint256 totalSupply) { 72 | totalSupply = _totalSupply; 73 | } 74 | 75 | // What is the balance of a particular account? 76 | function balanceOf(address _owner) constant returns (uint256 balance) { 77 | return balances[_owner]; 78 | } 79 | 80 | // Transfer the balance from owner's account to another account 81 | function transfer(address _to, uint256 _amount) returns (bool success) { 82 | if (balances[msg.sender] >= _amount 83 | && _amount > 0 84 | && balances[_to] + _amount > balances[_to]) { 85 | balances[msg.sender] -= _amount; 86 | balances[_to] += _amount; 87 | Transfer(msg.sender, _to, _amount); 88 | return true; 89 | } else { 90 | return false; 91 | } 92 | } 93 | 94 | // Send _value amount of tokens from address _from to address _to 95 | // The transferFrom method is used for a withdraw workflow, allowing contracts to send 96 | // tokens on your behalf, for example to "deposit" to a contract address and/or to charge 97 | // fees in sub-currencies; the command should fail unless the _from account has 98 | // deliberately authorized the sender of the message via some mechanism; we propose 99 | // these standardized APIs for approval: 100 | function transferFrom( 101 | address _from, 102 | address _to, 103 | uint256 _amount 104 | ) returns (bool success) { 105 | if (balances[_from] >= _amount 106 | && allowed[_from][msg.sender] >= _amount 107 | && _amount > 0 108 | && balances[_to] + _amount > balances[_to]) { 109 | balances[_from] -= _amount; 110 | allowed[_from][msg.sender] -= _amount; 111 | balances[_to] += _amount; 112 | Transfer(_from, _to, _amount); 113 | return true; 114 | } else { 115 | return false; 116 | } 117 | } 118 | 119 | // Allow _spender to withdraw from your account, multiple times, up to the _value amount. 120 | // If this function is called again it overwrites the current allowance with _value. 121 | function approve(address _spender, uint256 _amount) returns (bool success) { 122 | allowed[msg.sender][_spender] = _amount; 123 | Approval(msg.sender, _spender, _amount); 124 | return true; 125 | } 126 | 127 | function allowance(address _owner, address _spender) constant returns (uint256 remaining) { 128 | return allowed[_owner][_spender]; 129 | } 130 | } 131 | 132 | contract WavesEthereumSwap is WavesToken { 133 | event WavesTransfer(address indexed _from, string wavesAddress, uint256 amount); 134 | 135 | function moveToWaves(string wavesAddress, uint256 amount) { 136 | if (!transfer(owner, amount)) throw; 137 | WavesTransfer(msg.sender, wavesAddress, amount); 138 | } 139 | } -------------------------------------------------------------------------------- /contracts/Incent.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.8; 2 | 3 | // ---------------------------------------------------------------------------------------------- 4 | // The Incent / ETH smart contract - to find out more, join the Incent Slack; http://incentinvites.herokuapp.com/ 5 | // A collaboration between Incent and Bok :) 6 | // Enjoy. (c) Incent Loyalty Pty Ltd and Bok Consulting Pty Ltd 2017. The MIT Licence. 7 | // ---------------------------------------------------------------------------------------------- 8 | 9 | // Contract configuration 10 | contract TokenConfig { 11 | string public constant symbol = "INC"; 12 | string public constant name = "Incent"; 13 | uint8 public constant decimals = 8; // 8 decimal places, the same as tokens on Wave 14 | uint256 _totalSupply = 4601662500000000; 15 | } 16 | 17 | // ERC Token Standard #20 Interface 18 | // https://github.com/ethereum/EIPs/issues/20 19 | contract ERC20Interface { 20 | // Get the total token supply 21 | function totalSupply() constant returns (uint256 totalSupply); 22 | 23 | // Get the account balance of another account with address _owner 24 | function balanceOf(address _owner) constant returns (uint256 balance); 25 | 26 | // Send _value amount of tokens to address _to 27 | function transfer(address _to, uint256 _value) returns (bool success); 28 | 29 | // Send _value amount of tokens from address _from to address _to 30 | function transferFrom(address _from, address _to, uint256 _value) returns (bool success); 31 | 32 | // Allow _spender to withdraw from your account, multiple times, up to the _value amount. 33 | // If this function is called again it overwrites the current allowance with _value. 34 | // this function is required for some DEX functionality 35 | function approve(address _spender, uint256 _value) returns (bool success); 36 | 37 | // Returns the amount which _spender is still allowed to withdraw from _owner 38 | function allowance(address _owner, address _spender) constant returns (uint256 remaining); 39 | 40 | // Triggered when tokens are transferred. 41 | event Transfer(address indexed _from, address indexed _to, uint256 _value); 42 | 43 | // Triggered whenever approve(address _spender, uint256 _value) is called. 44 | event Approval(address indexed _owner, address indexed _spender, uint256 _value); 45 | } 46 | 47 | contract IncentToken is ERC20Interface, TokenConfig { 48 | // Owner of this contract 49 | address public owner; 50 | 51 | // Balances for each account 52 | mapping(address => uint256) balances; 53 | 54 | // Owner of account approves the transfer of an amount to another account 55 | mapping(address => mapping (address => uint256)) allowed; 56 | 57 | // Functions with this modifier can only be executed by the owner 58 | modifier onlyOwner() { 59 | if (msg.sender != owner) { 60 | throw; 61 | } 62 | _; 63 | } 64 | 65 | // Constructor 66 | function IncentToken() { 67 | owner = msg.sender; 68 | balances[owner] = _totalSupply; 69 | } 70 | 71 | function totalSupply() constant returns (uint256 totalSupply) { 72 | totalSupply = _totalSupply; 73 | } 74 | 75 | // What is the balance of a particular account? 76 | function balanceOf(address _owner) constant returns (uint256 balance) { 77 | return balances[_owner]; 78 | } 79 | 80 | // Transfer the balance from owner's account to another account 81 | function transfer(address _to, uint256 _amount) returns (bool success) { 82 | if (balances[msg.sender] >= _amount 83 | && _amount > 0 84 | && balances[_to] + _amount > balances[_to]) { 85 | balances[msg.sender] -= _amount; 86 | balances[_to] += _amount; 87 | Transfer(msg.sender, _to, _amount); 88 | return true; 89 | } else { 90 | return false; 91 | } 92 | } 93 | 94 | // Send _value amount of tokens from address _from to address _to 95 | // The transferFrom method is used for a withdraw workflow, allowing contracts to send 96 | // tokens on your behalf, for example to "deposit" to a contract address and/or to charge 97 | // fees in sub-currencies; the command should fail unless the _from account has 98 | // deliberately authorized the sender of the message via some mechanism; we propose 99 | // these standardized APIs for approval: 100 | function transferFrom( 101 | address _from, 102 | address _to, 103 | uint256 _amount 104 | ) returns (bool success) { 105 | if (balances[_from] >= _amount 106 | && allowed[_from][msg.sender] >= _amount 107 | && _amount > 0 108 | && balances[_to] + _amount > balances[_to]) { 109 | balances[_from] -= _amount; 110 | allowed[_from][msg.sender] -= _amount; 111 | balances[_to] += _amount; 112 | Transfer(_from, _to, _amount); 113 | return true; 114 | } else { 115 | return false; 116 | } 117 | } 118 | 119 | // Allow _spender to withdraw from your account, multiple times, up to the _value amount. 120 | // If this function is called again it overwrites the current allowance with _value. 121 | function approve(address _spender, uint256 _amount) returns (bool success) { 122 | allowed[msg.sender][_spender] = _amount; 123 | Approval(msg.sender, _spender, _amount); 124 | return true; 125 | } 126 | 127 | function allowance(address _owner, address _spender) constant returns (uint256 remaining) { 128 | return allowed[_owner][_spender]; 129 | } 130 | } 131 | 132 | contract WavesEthereumSwap is IncentToken { 133 | event WavesTransfer(address indexed _from, string wavesAddress, uint256 amount); 134 | 135 | function moveToWaves(string wavesAddress, uint256 amount) { 136 | if (!transfer(owner, amount)) throw; 137 | WavesTransfer(msg.sender, wavesAddress, amount); 138 | } 139 | } -------------------------------------------------------------------------------- /contracts/RiptoBux.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.8; 2 | 3 | // ---------------------------------------------------------------------------------------------- 4 | // The Ripto Bux smart contract - to find out more, join the Incent Slack; http://incentinvites.herokuapp.com/ 5 | // A collaboration between Incent and Bok :) 6 | // Enjoy. (c) Incent Loyalty Pty Ltd and Bok Consulting Pty Ltd 2017. The MIT Licence. 7 | // ---------------------------------------------------------------------------------------------- 8 | 9 | // Contract configuration 10 | contract TokenConfig { 11 | string public constant symbol = "RBX"; 12 | string public constant name = "Ripto Bux"; 13 | uint8 public constant decimals = 8; // 8 decimal places, the same as tokens on Wave 14 | uint256 _totalSupply = 100000000000000000; 15 | } 16 | 17 | // ERC Token Standard #20 Interface 18 | // https://github.com/ethereum/EIPs/issues/20 19 | contract ERC20Interface { 20 | // Get the total token supply 21 | function totalSupply() constant returns (uint256 totalSupply); 22 | 23 | // Get the account balance of another account with address _owner 24 | function balanceOf(address _owner) constant returns (uint256 balance); 25 | 26 | // Send _value amount of tokens to address _to 27 | function transfer(address _to, uint256 _value) returns (bool success); 28 | 29 | // Send _value amount of tokens from address _from to address _to 30 | function transferFrom(address _from, address _to, uint256 _value) returns (bool success); 31 | 32 | // Allow _spender to withdraw from your account, multiple times, up to the _value amount. 33 | // If this function is called again it overwrites the current allowance with _value. 34 | // this function is required for some DEX functionality 35 | function approve(address _spender, uint256 _value) returns (bool success); 36 | 37 | // Returns the amount which _spender is still allowed to withdraw from _owner 38 | function allowance(address _owner, address _spender) constant returns (uint256 remaining); 39 | 40 | // Triggered when tokens are transferred. 41 | event Transfer(address indexed _from, address indexed _to, uint256 _value); 42 | 43 | // Triggered whenever approve(address _spender, uint256 _value) is called. 44 | event Approval(address indexed _owner, address indexed _spender, uint256 _value); 45 | } 46 | 47 | contract RiptoBuxToken is ERC20Interface, TokenConfig { 48 | // Owner of this contract 49 | address public owner; 50 | 51 | // Balances for each account 52 | mapping(address => uint256) balances; 53 | 54 | // Owner of account approves the transfer of an amount to another account 55 | mapping(address => mapping (address => uint256)) allowed; 56 | 57 | // Functions with this modifier can only be executed by the owner 58 | modifier onlyOwner() { 59 | if (msg.sender != owner) { 60 | throw; 61 | } 62 | _; 63 | } 64 | 65 | // Constructor 66 | function RiptoBuxToken() { 67 | owner = msg.sender; 68 | balances[owner] = _totalSupply; 69 | } 70 | 71 | function totalSupply() constant returns (uint256 totalSupply) { 72 | totalSupply = _totalSupply; 73 | } 74 | 75 | // What is the balance of a particular account? 76 | function balanceOf(address _owner) constant returns (uint256 balance) { 77 | return balances[_owner]; 78 | } 79 | 80 | // Transfer the balance from owner's account to another account 81 | function transfer(address _to, uint256 _amount) returns (bool success) { 82 | if (balances[msg.sender] >= _amount 83 | && _amount > 0 84 | && balances[_to] + _amount > balances[_to]) { 85 | balances[msg.sender] -= _amount; 86 | balances[_to] += _amount; 87 | Transfer(msg.sender, _to, _amount); 88 | return true; 89 | } else { 90 | return false; 91 | } 92 | } 93 | 94 | // Send _value amount of tokens from address _from to address _to 95 | // The transferFrom method is used for a withdraw workflow, allowing contracts to send 96 | // tokens on your behalf, for example to "deposit" to a contract address and/or to charge 97 | // fees in sub-currencies; the command should fail unless the _from account has 98 | // deliberately authorized the sender of the message via some mechanism; we propose 99 | // these standardized APIs for approval: 100 | function transferFrom( 101 | address _from, 102 | address _to, 103 | uint256 _amount 104 | ) returns (bool success) { 105 | if (balances[_from] >= _amount 106 | && allowed[_from][msg.sender] >= _amount 107 | && _amount > 0 108 | && balances[_to] + _amount > balances[_to]) { 109 | balances[_from] -= _amount; 110 | allowed[_from][msg.sender] -= _amount; 111 | balances[_to] += _amount; 112 | Transfer(_from, _to, _amount); 113 | return true; 114 | } else { 115 | return false; 116 | } 117 | } 118 | 119 | // Allow _spender to withdraw from your account, multiple times, up to the _value amount. 120 | // If this function is called again it overwrites the current allowance with _value. 121 | function approve(address _spender, uint256 _amount) returns (bool success) { 122 | allowed[msg.sender][_spender] = _amount; 123 | Approval(msg.sender, _spender, _amount); 124 | return true; 125 | } 126 | 127 | function allowance(address _owner, address _spender) constant returns (uint256 remaining) { 128 | return allowed[_owner][_spender]; 129 | } 130 | } 131 | 132 | contract WavesEthereumSwap is RiptoBuxToken { 133 | event WavesTransfer(address indexed _from, string wavesAddress, uint256 amount); 134 | 135 | function moveToWaves(string wavesAddress, uint256 amount) { 136 | if (!transfer(owner, amount)) throw; 137 | WavesTransfer(msg.sender, wavesAddress, amount); 138 | } 139 | } -------------------------------------------------------------------------------- /contracts/WavesBitcoinToken.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.8; 2 | 3 | // ---------------------------------------------------------------------------------------------- 4 | // The Waves Community token smart contract - to find out more, join the Incent Slack; http://incentinvites.herokuapp.com/ 5 | // A collaboration between Incent and Bok :) 6 | // Enjoy. (c) Incent Loyalty Pty Ltd and Bok Consulting Pty Ltd 2017. The MIT Licence. 7 | // ---------------------------------------------------------------------------------------------- 8 | 9 | // Contract configuration 10 | contract TokenConfig { 11 | string public constant symbol = "WBC"; 12 | string public constant name = "Waves Bitcoin Token"; 13 | uint8 public constant decimals = 8; // 8 decimal places, the same as tokens on Wave 14 | uint256 _totalSupply = 2100000000000000; 15 | } 16 | 17 | // ERC Token Standard #20 Interface 18 | // https://github.com/ethereum/EIPs/issues/20 19 | contract ERC20Interface { 20 | // Get the total token supply 21 | function totalSupply() constant returns (uint256 totalSupply); 22 | 23 | // Get the account balance of another account with address _owner 24 | function balanceOf(address _owner) constant returns (uint256 balance); 25 | 26 | // Send _value amount of tokens to address _to 27 | function transfer(address _to, uint256 _value) returns (bool success); 28 | 29 | // Send _value amount of tokens from address _from to address _to 30 | function transferFrom(address _from, address _to, uint256 _value) returns (bool success); 31 | 32 | // Allow _spender to withdraw from your account, multiple times, up to the _value amount. 33 | // If this function is called again it overwrites the current allowance with _value. 34 | // this function is required for some DEX functionality 35 | function approve(address _spender, uint256 _value) returns (bool success); 36 | 37 | // Returns the amount which _spender is still allowed to withdraw from _owner 38 | function allowance(address _owner, address _spender) constant returns (uint256 remaining); 39 | 40 | // Triggered when tokens are transferred. 41 | event Transfer(address indexed _from, address indexed _to, uint256 _value); 42 | 43 | // Triggered whenever approve(address _spender, uint256 _value) is called. 44 | event Approval(address indexed _owner, address indexed _spender, uint256 _value); 45 | } 46 | 47 | contract WavesBitcoinToken is ERC20Interface, TokenConfig { 48 | // Owner of this contract 49 | address public owner; 50 | 51 | // Balances for each account 52 | mapping(address => uint256) balances; 53 | 54 | // Owner of account approves the transfer of an amount to another account 55 | mapping(address => mapping (address => uint256)) allowed; 56 | 57 | // Functions with this modifier can only be executed by the owner 58 | modifier onlyOwner() { 59 | if (msg.sender != owner) { 60 | throw; 61 | } 62 | _; 63 | } 64 | 65 | // Constructor 66 | function WavesBitcoinToken() { 67 | owner = msg.sender; 68 | balances[owner] = _totalSupply; 69 | } 70 | 71 | function totalSupply() constant returns (uint256 totalSupply) { 72 | totalSupply = _totalSupply; 73 | } 74 | 75 | // What is the balance of a particular account? 76 | function balanceOf(address _owner) constant returns (uint256 balance) { 77 | return balances[_owner]; 78 | } 79 | 80 | // Transfer the balance from owner's account to another account 81 | function transfer(address _to, uint256 _amount) returns (bool success) { 82 | if (balances[msg.sender] >= _amount 83 | && _amount > 0 84 | && balances[_to] + _amount > balances[_to]) { 85 | balances[msg.sender] -= _amount; 86 | balances[_to] += _amount; 87 | Transfer(msg.sender, _to, _amount); 88 | return true; 89 | } else { 90 | return false; 91 | } 92 | } 93 | 94 | // Send _value amount of tokens from address _from to address _to 95 | // The transferFrom method is used for a withdraw workflow, allowing contracts to send 96 | // tokens on your behalf, for example to "deposit" to a contract address and/or to charge 97 | // fees in sub-currencies; the command should fail unless the _from account has 98 | // deliberately authorized the sender of the message via some mechanism; we propose 99 | // these standardized APIs for approval: 100 | function transferFrom( 101 | address _from, 102 | address _to, 103 | uint256 _amount 104 | ) returns (bool success) { 105 | if (balances[_from] >= _amount 106 | && allowed[_from][msg.sender] >= _amount 107 | && _amount > 0 108 | && balances[_to] + _amount > balances[_to]) { 109 | balances[_from] -= _amount; 110 | allowed[_from][msg.sender] -= _amount; 111 | balances[_to] += _amount; 112 | Transfer(_from, _to, _amount); 113 | return true; 114 | } else { 115 | return false; 116 | } 117 | } 118 | 119 | // Allow _spender to withdraw from your account, multiple times, up to the _value amount. 120 | // If this function is called again it overwrites the current allowance with _value. 121 | function approve(address _spender, uint256 _amount) returns (bool success) { 122 | allowed[msg.sender][_spender] = _amount; 123 | Approval(msg.sender, _spender, _amount); 124 | return true; 125 | } 126 | 127 | function allowance(address _owner, address _spender) constant returns (uint256 remaining) { 128 | return allowed[_owner][_spender]; 129 | } 130 | } 131 | 132 | contract WavesEthereumSwap is WavesBitcoinToken { 133 | event WavesTransfer(address indexed _from, string wavesAddress, uint256 amount); 134 | 135 | function moveToWaves(string wavesAddress, uint256 amount) { 136 | if (!transfer(owner, amount)) throw; 137 | WavesTransfer(msg.sender, wavesAddress, amount); 138 | } 139 | } -------------------------------------------------------------------------------- /contracts/WavesCommunityToken.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.8; 2 | 3 | // ---------------------------------------------------------------------------------------------- 4 | // The Waves Community token smart contract - to find out more, join the Incent Slack; http://incentinvites.herokuapp.com/ 5 | // A collaboration between Incent and Bok :) 6 | // Enjoy. (c) Incent Loyalty Pty Ltd and Bok Consulting Pty Ltd 2017. The MIT Licence. 7 | // ---------------------------------------------------------------------------------------------- 8 | 9 | // Contract configuration 10 | contract TokenConfig { 11 | string public constant symbol = "WCT"; 12 | string public constant name = "Waves Community Token"; 13 | uint8 public constant decimals = 2; // 2 decimal places, the same as tokens on Wave 14 | uint256 _totalSupply = 1000000000; 15 | } 16 | 17 | // ERC Token Standard #20 Interface 18 | // https://github.com/ethereum/EIPs/issues/20 19 | contract ERC20Interface { 20 | // Get the total token supply 21 | function totalSupply() constant returns (uint256 totalSupply); 22 | 23 | // Get the account balance of another account with address _owner 24 | function balanceOf(address _owner) constant returns (uint256 balance); 25 | 26 | // Send _value amount of tokens to address _to 27 | function transfer(address _to, uint256 _value) returns (bool success); 28 | 29 | // Send _value amount of tokens from address _from to address _to 30 | function transferFrom(address _from, address _to, uint256 _value) returns (bool success); 31 | 32 | // Allow _spender to withdraw from your account, multiple times, up to the _value amount. 33 | // If this function is called again it overwrites the current allowance with _value. 34 | // this function is required for some DEX functionality 35 | function approve(address _spender, uint256 _value) returns (bool success); 36 | 37 | // Returns the amount which _spender is still allowed to withdraw from _owner 38 | function allowance(address _owner, address _spender) constant returns (uint256 remaining); 39 | 40 | // Triggered when tokens are transferred. 41 | event Transfer(address indexed _from, address indexed _to, uint256 _value); 42 | 43 | // Triggered whenever approve(address _spender, uint256 _value) is called. 44 | event Approval(address indexed _owner, address indexed _spender, uint256 _value); 45 | } 46 | 47 | contract WavesCommunityToken is ERC20Interface, TokenConfig { 48 | // Owner of this contract 49 | address public owner; 50 | 51 | // Balances for each account 52 | mapping(address => uint256) balances; 53 | 54 | // Owner of account approves the transfer of an amount to another account 55 | mapping(address => mapping (address => uint256)) allowed; 56 | 57 | // Functions with this modifier can only be executed by the owner 58 | modifier onlyOwner() { 59 | if (msg.sender != owner) { 60 | throw; 61 | } 62 | _; 63 | } 64 | 65 | // Constructor 66 | function WavesCommunityToken() { 67 | owner = msg.sender; 68 | balances[owner] = _totalSupply; 69 | } 70 | 71 | function totalSupply() constant returns (uint256 totalSupply) { 72 | totalSupply = _totalSupply; 73 | } 74 | 75 | // What is the balance of a particular account? 76 | function balanceOf(address _owner) constant returns (uint256 balance) { 77 | return balances[_owner]; 78 | } 79 | 80 | // Transfer the balance from owner's account to another account 81 | function transfer(address _to, uint256 _amount) returns (bool success) { 82 | if (balances[msg.sender] >= _amount 83 | && _amount > 0 84 | && balances[_to] + _amount > balances[_to]) { 85 | balances[msg.sender] -= _amount; 86 | balances[_to] += _amount; 87 | Transfer(msg.sender, _to, _amount); 88 | return true; 89 | } else { 90 | return false; 91 | } 92 | } 93 | 94 | // Send _value amount of tokens from address _from to address _to 95 | // The transferFrom method is used for a withdraw workflow, allowing contracts to send 96 | // tokens on your behalf, for example to "deposit" to a contract address and/or to charge 97 | // fees in sub-currencies; the command should fail unless the _from account has 98 | // deliberately authorized the sender of the message via some mechanism; we propose 99 | // these standardized APIs for approval: 100 | function transferFrom( 101 | address _from, 102 | address _to, 103 | uint256 _amount 104 | ) returns (bool success) { 105 | if (balances[_from] >= _amount 106 | && allowed[_from][msg.sender] >= _amount 107 | && _amount > 0 108 | && balances[_to] + _amount > balances[_to]) { 109 | balances[_from] -= _amount; 110 | allowed[_from][msg.sender] -= _amount; 111 | balances[_to] += _amount; 112 | Transfer(_from, _to, _amount); 113 | return true; 114 | } else { 115 | return false; 116 | } 117 | } 118 | 119 | // Allow _spender to withdraw from your account, multiple times, up to the _value amount. 120 | // If this function is called again it overwrites the current allowance with _value. 121 | function approve(address _spender, uint256 _amount) returns (bool success) { 122 | allowed[msg.sender][_spender] = _amount; 123 | Approval(msg.sender, _spender, _amount); 124 | return true; 125 | } 126 | 127 | function allowance(address _owner, address _spender) constant returns (uint256 remaining) { 128 | return allowed[_owner][_spender]; 129 | } 130 | } 131 | 132 | contract WavesEthereumSwap is WavesCommunityToken { 133 | event WavesTransfer(address indexed _from, string wavesAddress, uint256 amount); 134 | 135 | function moveToWaves(string wavesAddress, uint256 amount) { 136 | if (!transfer(owner, amount)) throw; 137 | WavesTransfer(msg.sender, wavesAddress, amount); 138 | } 139 | } -------------------------------------------------------------------------------- /test/01_test1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # ---------------------------------------------------------------------------------------------- 3 | # Testing the smart contract 4 | # 5 | # Enjoy. (c) BokkyPooBah / Bok Consulting Pty Ltd 2017. The MIT Licence. 6 | # ---------------------------------------------------------------------------------------------- 7 | 8 | MODE=${1:-test} 9 | 10 | GETHATTACHPOINT=`grep ^IPCFILE= settings.txt | sed "s/^.*=//"` 11 | PASSWORD=`grep ^PASSWORD= settings.txt | sed "s/^.*=//"` 12 | TOKENSOL=`grep ^TOKENSOL= settings.txt | sed "s/^.*=//"` 13 | TOKENJS=`grep ^TOKENJS= settings.txt | sed "s/^.*=//"` 14 | DEPLOYMENTDATA=`grep ^DEPLOYMENTDATA= settings.txt | sed "s/^.*=//"` 15 | 16 | INCLUDEJS=`grep ^INCLUDEJS= settings.txt | sed "s/^.*=//"` 17 | TEST1OUTPUT=`grep ^TEST1OUTPUT= settings.txt | sed "s/^.*=//"` 18 | TEST1RESULTS=`grep ^TEST1RESULTS= settings.txt | sed "s/^.*=//"` 19 | 20 | #if [ "$MODE" == "dev" ]; then 21 | #else 22 | #fi 23 | 24 | printf "MODE = '$MODE'\n" 25 | printf "GETHATTACHPOINT = '$GETHATTACHPOINT'\n" 26 | printf "PASSWORD = '$PASSWORD'\n" 27 | printf "TOKENSOL = '$TOKENSOL'\n" 28 | printf "TOKENJS = '$TOKENJS'\n" 29 | printf "DEPLOYMENTDATA = '$DEPLOYMENTDATA'\n" 30 | printf "INCLUDEJS = '$INCLUDEJS'\n" 31 | printf "TEST1OUTPUT = '$TEST1OUTPUT'\n" 32 | printf "TEST1RESULTS = '$TEST1RESULTS'\n" 33 | 34 | echo "var tokenOutput=`solc --optimize --combined-json abi,bin,interface $TOKENSOL`;" > $TOKENJS 35 | 36 | geth --verbosity 3 attach $GETHATTACHPOINT << EOF | tee $TEST1OUTPUT 37 | loadScript("$TOKENJS"); 38 | loadScript("functions.js"); 39 | 40 | var tokenAbi = JSON.parse(tokenOutput.contracts["$TOKENSOL:EncryptoTelToken"].abi); 41 | var tokenBin = "0x" + tokenOutput.contracts["$TOKENSOL:EncryptoTelToken"].bin; 42 | 43 | console.log("DATA: tokenABI=" + JSON.stringify(tokenAbi)); 44 | 45 | unlockAccounts("$PASSWORD"); 46 | printBalances(); 47 | console.log("RESULT: "); 48 | 49 | 50 | // ----------------------------------------------------------------------------- 51 | var testMessage = "Test 1.1 Deploy Token Contract"; 52 | console.log("RESULT: " + testMessage); 53 | var tokenContract = web3.eth.contract(tokenAbi); 54 | console.log(JSON.stringify(tokenContract)); 55 | var tokenTx = null; 56 | var tokenAddress = null; 57 | var token = tokenContract.new({from: tokenOwnerAccount, data: tokenBin, gas: 4000000}, 58 | function(e, contract) { 59 | if (!e) { 60 | if (!contract.address) { 61 | tokenTx = contract.transactionHash; 62 | } else { 63 | tokenAddress = contract.address; 64 | addAccount(tokenAddress, "TOKEN"); 65 | addTokenContractAddressAndAbi(tokenAddress, tokenAbi); 66 | console.log("DATA: tokenAddress=" + tokenAddress); 67 | printTxData("tokenAddress=" + tokenAddress, tokenTx); 68 | } 69 | } 70 | } 71 | ); 72 | while (txpool.status.pending > 0) { 73 | } 74 | printBalances(); 75 | failIfGasEqualsGasUsed(tokenTx, testMessage); 76 | printTokenContractStaticDetails(); 77 | printTokenContractDynamicDetails(); 78 | console.log("RESULT: "); 79 | console.log(JSON.stringify(token)); 80 | 81 | 82 | // ----------------------------------------------------------------------------- 83 | var testMessage = "Test 1.2 Attempt to send ethers to the token contract - expecting to fail"; 84 | console.log("RESULT: " + testMessage); 85 | var tx1_2_1 = eth.sendTransaction({from: account2, to: tokenAddress, gas: 400000, value: web3.toWei("123.456789", "ether")}); 86 | while (txpool.status.pending > 0) { 87 | } 88 | printBalances(); 89 | passIfGasEqualsGasUsed(tx1_2_1, testMessage); 90 | printTokenContractDynamicDetails(); 91 | console.log("RESULT: "); 92 | 93 | 94 | // ----------------------------------------------------------------------------- 95 | var testMessage = "Test 1.3 Token owner transfer 10,000 tokens to account2 and account3"; 96 | console.log("RESULT: " + testMessage); 97 | var tx1_3_1 = token.transfer(account2, "1000000000000", {from: tokenOwnerAccount, gas: 100000}); 98 | var tx1_3_2 = token.transfer(account3, "1000000000000", {from: tokenOwnerAccount, gas: 100000}); 99 | while (txpool.status.pending > 0) { 100 | } 101 | printBalances(); 102 | failIfGasEqualsGasUsed(tx1_3_1, testMessage + " - account2"); 103 | failIfGasEqualsGasUsed(tx1_3_2, testMessage + " - account3"); 104 | printTokenContractDynamicDetails(); 105 | console.log("RESULT: "); 106 | 107 | 108 | // ----------------------------------------------------------------------------- 109 | var testMessage = "Test 1.4 Account2 transfers 50,000 tokens to account4 - expecting to fail without errors"; 110 | console.log("RESULT: " + testMessage); 111 | var tx1_4_1 = token.transfer(account4, "5000000000000", {from: account2, gas: 100000}); 112 | while (txpool.status.pending > 0) { 113 | } 114 | printBalances(); 115 | failIfGasEqualsGasUsed(tx1_4_1, testMessage); 116 | printTokenContractDynamicDetails(); 117 | console.log("RESULT: "); 118 | 119 | 120 | // ----------------------------------------------------------------------------- 121 | var testMessage = "Test 1.5 Account2 approves transfer of 2,000 tokens to account3 and account3 transfers"; 122 | console.log("RESULT: " + testMessage); 123 | var tx1_5_1 = token.approve(account3, "200000000000", {from: account2, gas: 100000}); 124 | while (txpool.status.pending > 0) { 125 | } 126 | var tx1_5_2 = token.transferFrom(account2, account3, "200000000000", {from: account3, gas: 100000}); 127 | while (txpool.status.pending > 0) { 128 | } 129 | printBalances(); 130 | failIfGasEqualsGasUsed(tx1_5_1, testMessage + " - account2 approves"); 131 | failIfGasEqualsGasUsed(tx1_5_2, testMessage + " - account3 transferFrom"); 132 | printTokenContractDynamicDetails(); 133 | console.log("RESULT: "); 134 | 135 | 136 | // ----------------------------------------------------------------------------- 137 | var testMessage = "Test 1.6 Change Ownership"; 138 | console.log("RESULT: " + testMessage); 139 | var tx1_6_1 = token.transferOwnership(minerAccount, {from: tokenOwnerAccount, gas: 100000}); 140 | while (txpool.status.pending > 0) { 141 | } 142 | var tx1_6_2 = token.acceptOwnership({from: minerAccount, gas: 100000}); 143 | while (txpool.status.pending > 0) { 144 | } 145 | printTxData("tx1_6_1", tx1_6_1); 146 | printTxData("tx1_6_2", tx1_6_2); 147 | printBalances(); 148 | failIfGasEqualsGasUsed(tx1_6_1, testMessage + " - Change owner"); 149 | failIfGasEqualsGasUsed(tx1_6_2, testMessage + " - Accept ownership"); 150 | printTokenContractDynamicDetails(); 151 | console.log("RESULT: "); 152 | 153 | 154 | // ----------------------------------------------------------------------------- 155 | var testMessage = "Test 1.6 Account2 blockswaps to Waves account 3PBcRZBV38UBWQXmmnXNkVf7VZLBQgGZ9DM"; 156 | console.log("RESULT: " + testMessage); 157 | var tx1_6_1 = token.moveToWaves("3PBcRZBV38UBWQXmmnXNkVf7VZLBQgGZ9DM", "200000000000", {from: account2, gas: 100000}); 158 | while (txpool.status.pending > 0) { 159 | } 160 | printBalances(); 161 | failIfGasEqualsGasUsed(tx1_6_1, testMessage); 162 | printTokenContractDynamicDetails(); 163 | console.log("RESULT: "); 164 | 165 | EOF 166 | grep "DATA: " $TEST1OUTPUT | sed "s/DATA: //" > $DEPLOYMENTDATA 167 | cat $DEPLOYMENTDATA 168 | grep "RESULT: " $TEST1OUTPUT | sed "s/RESULT: //" > $TEST1RESULTS 169 | cat $TEST1RESULTS 170 | -------------------------------------------------------------------------------- /contracts/EncryptoTelToken.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.10; 2 | 3 | // ---------------------------------------------------------------------------- 4 | // The EncryptoTel smart contract - provided by Incent - join us on slack; 5 | // http://incentinvites.herokuapp.com/ 6 | // 7 | // A collaboration between Incent, Bok and EncryptoTel :) 8 | // 9 | // Enjoy. (c) Incent Loyalty Pty Ltd and Bok Consulting Pty Ltd 2017. 10 | // The MIT Licence. 11 | // ---------------------------------------------------------------------------- 12 | 13 | // ---------------------------------------------------------------------------- 14 | // Contract configuration 15 | // ---------------------------------------------------------------------------- 16 | contract TokenConfig { 17 | string public constant symbol = "ETT"; 18 | string public constant name = "EncyptoTel Token"; 19 | uint8 public constant decimals = 8; // 8 decimals, same as tokens on Waves 20 | uint256 public constant TOTALSUPPLY = 5436479500000000; 21 | } 22 | 23 | 24 | // ---------------------------------------------------------------------------- 25 | // ERC Token Standard #20 Interface 26 | // https://github.com/ethereum/EIPs/issues/20 27 | // ---------------------------------------------------------------------------- 28 | contract ERC20Interface { 29 | uint256 public totalSupply; 30 | function balanceOf(address _owner) constant returns (uint256 balance); 31 | function transfer(address _to, uint256 _value) returns (bool success); 32 | function transferFrom(address _from, address _to, uint256 _value) 33 | returns (bool success); 34 | function approve(address _spender, uint256 _value) returns (bool success); 35 | function allowance(address _owner, address _spender) constant 36 | returns (uint256 remaining); 37 | event Transfer(address indexed _from, address indexed _to, uint256 _value); 38 | event Approval(address indexed _owner, address indexed _spender, 39 | uint256 _value); 40 | } 41 | 42 | 43 | // ---------------------------------------------------------------------------- 44 | // Owned contract 45 | // ---------------------------------------------------------------------------- 46 | contract Owned { 47 | address public owner; 48 | address public newOwner; 49 | event OwnershipTransferred(address indexed _from, address indexed _to); 50 | 51 | function Owned() { 52 | owner = msg.sender; 53 | } 54 | 55 | modifier onlyOwner { 56 | if (msg.sender != owner) throw; 57 | _; 58 | } 59 | 60 | function transferOwnership(address _newOwner) onlyOwner { 61 | newOwner = _newOwner; 62 | } 63 | 64 | function acceptOwnership() { 65 | if (msg.sender != newOwner) throw; 66 | OwnershipTransferred(owner, newOwner); 67 | owner = newOwner; 68 | } 69 | } 70 | 71 | 72 | // ---------------------------------------------------------------------------- 73 | // WavesEthereumSwap functionality 74 | // ---------------------------------------------------------------------------- 75 | contract WavesEthereumSwap is Owned, ERC20Interface { 76 | event WavesTransfer(address indexed _from, string wavesAddress, 77 | uint256 amount); 78 | 79 | function moveToWaves(string wavesAddress, uint256 amount) { 80 | if (!transfer(owner, amount)) throw; 81 | WavesTransfer(msg.sender, wavesAddress, amount); 82 | } 83 | } 84 | 85 | 86 | // ---------------------------------------------------------------------------- 87 | // ERC Token Standard #20 Interface 88 | // https://github.com/ethereum/EIPs/issues/20 89 | // ---------------------------------------------------------------------------- 90 | contract EncryptoTelToken is TokenConfig, WavesEthereumSwap { 91 | 92 | // ------------------------------------------------------------------------ 93 | // Balances for each account 94 | // ------------------------------------------------------------------------ 95 | mapping(address => uint256) balances; 96 | 97 | // ------------------------------------------------------------------------ 98 | // Owner of account approves the transfer of an amount to another account 99 | // ------------------------------------------------------------------------ 100 | mapping(address => mapping (address => uint256)) allowed; 101 | 102 | // ------------------------------------------------------------------------ 103 | // Constructor 104 | // ------------------------------------------------------------------------ 105 | function EncryptoTelToken() Owned() TokenConfig() { 106 | totalSupply = TOTALSUPPLY; 107 | balances[owner] = TOTALSUPPLY; 108 | } 109 | 110 | // ------------------------------------------------------------------------ 111 | // Get the account balance of another account with address _owner 112 | // ------------------------------------------------------------------------ 113 | function balanceOf(address _owner) constant returns (uint256 balance) { 114 | return balances[_owner]; 115 | } 116 | 117 | // ------------------------------------------------------------------------ 118 | // Transfer the balance from owner's account to another account 119 | // ------------------------------------------------------------------------ 120 | function transfer( 121 | address _to, 122 | uint256 _amount 123 | ) returns (bool success) { 124 | if (balances[msg.sender] >= _amount // User has balance 125 | && _amount > 0 // Non-zero transfer 126 | && balances[_to] + _amount > balances[_to] // Overflow check 127 | ) { 128 | balances[msg.sender] -= _amount; 129 | balances[_to] += _amount; 130 | Transfer(msg.sender, _to, _amount); 131 | return true; 132 | } else { 133 | return false; 134 | } 135 | } 136 | 137 | // ------------------------------------------------------------------------ 138 | // Allow _spender to withdraw from your account, multiple times, up to the 139 | // _value amount. If this function is called again it overwrites the 140 | // current allowance with _value. 141 | // ------------------------------------------------------------------------ 142 | function approve( 143 | address _spender, 144 | uint256 _amount 145 | ) returns (bool success) { 146 | allowed[msg.sender][_spender] = _amount; 147 | Approval(msg.sender, _spender, _amount); 148 | return true; 149 | } 150 | 151 | // ------------------------------------------------------------------------ 152 | // Spender of tokens transfer an amount of tokens from the token owner's 153 | // balance to another account. The owner of the tokens must already 154 | // have approve(...)-d this transfer 155 | // ------------------------------------------------------------------------ 156 | function transferFrom( 157 | address _from, 158 | address _to, 159 | uint256 _amount 160 | ) returns (bool success) { 161 | if (balances[_from] >= _amount // From a/c has balance 162 | && allowed[_from][msg.sender] >= _amount // Transfer approved 163 | && _amount > 0 // Non-zero transfer 164 | && balances[_to] + _amount > balances[_to] // Overflow check 165 | ) { 166 | balances[_from] -= _amount; 167 | allowed[_from][msg.sender] -= _amount; 168 | balances[_to] += _amount; 169 | Transfer(_from, _to, _amount); 170 | return true; 171 | } else { 172 | return false; 173 | } 174 | } 175 | 176 | // ------------------------------------------------------------------------ 177 | // Returns the amount of tokens approved by the owner that can be 178 | // transferred to the spender's account 179 | // ------------------------------------------------------------------------ 180 | function allowance( 181 | address _owner, 182 | address _spender 183 | ) constant returns (uint256 remaining) { 184 | return allowed[_owner][_spender]; 185 | } 186 | 187 | // ------------------------------------------------------------------------ 188 | // Transfer out any accidentally sent ERC20 tokens 189 | // ------------------------------------------------------------------------ 190 | function transferAnyERC20Token( 191 | address tokenAddress, 192 | uint256 amount 193 | ) onlyOwner returns (bool success) { 194 | return ERC20Interface(tokenAddress).transfer(owner, amount); 195 | } 196 | 197 | // ------------------------------------------------------------------------ 198 | // Don't accept ethers 199 | // ------------------------------------------------------------------------ 200 | function () { 201 | throw; 202 | } 203 | } -------------------------------------------------------------------------------- /test/functions.js: -------------------------------------------------------------------------------- 1 | // May 20 2017 2 | var ethPriceUSD = 127.2; 3 | 4 | // ----------------------------------------------------------------------------- 5 | // Accounts 6 | // ----------------------------------------------------------------------------- 7 | var accounts = []; 8 | var accountNames = {}; 9 | 10 | addAccount(eth.accounts[0], "Account #0 - Miner"); 11 | addAccount(eth.accounts[1], "Account #1 - Token Owner"); 12 | addAccount(eth.accounts[2], "Account #2"); 13 | addAccount(eth.accounts[3], "Account #3"); 14 | addAccount(eth.accounts[4], "Account #4"); 15 | addAccount(eth.accounts[5], "Account #5"); 16 | addAccount(eth.accounts[6], "Account #6"); 17 | 18 | var minerAccount = eth.accounts[0]; 19 | var tokenOwnerAccount = eth.accounts[1]; 20 | var account2 = eth.accounts[2]; 21 | var account3 = eth.accounts[3]; 22 | var account4 = eth.accounts[4]; 23 | var account5 = eth.accounts[5]; 24 | var account6 = eth.accounts[6]; 25 | 26 | var baseBlock = eth.blockNumber; 27 | 28 | function unlockAccounts(password) { 29 | for (var i = 0; i < 7; i++) { 30 | personal.unlockAccount(eth.accounts[i], password, 100000); 31 | } 32 | } 33 | 34 | function addAccount(account, accountName) { 35 | accounts.push(account); 36 | accountNames[account] = accountName; 37 | } 38 | 39 | 40 | // ----------------------------------------------------------------------------- 41 | // Token Contract 42 | // ----------------------------------------------------------------------------- 43 | var tokenContractAddress = null; 44 | var tokenContractAbi = null; 45 | 46 | function addTokenContractAddressAndAbi(address, abi) { 47 | tokenContractAddress = address; 48 | tokenContractAbi = abi; 49 | } 50 | 51 | 52 | // ----------------------------------------------------------------------------- 53 | // Account ETH and token balances 54 | // ----------------------------------------------------------------------------- 55 | function printBalances() { 56 | var token = tokenContractAddress == null || tokenContractAbi == null ? null : web3.eth.contract(tokenContractAbi).at(tokenContractAddress); 57 | var decimals = token == null ? 0 : token.decimals(); 58 | var i = 0; 59 | console.log("RESULT: # Account EtherBalanceChange Token Name"); 60 | accounts.forEach(function(e) { 61 | i++; 62 | var etherBalanceBaseBlock = eth.getBalance(e, baseBlock); 63 | var etherBalance = web3.fromWei(eth.getBalance(e).minus(etherBalanceBaseBlock), "ether"); 64 | var tokenBalance = token == null ? new BigNumber(0) : token.balanceOf(e).shift(-decimals); 65 | console.log("RESULT: " + pad2(i) + " " + e + " " + pad(etherBalance) + " " + padToken(tokenBalance, decimals) + " " + accountNames[e]); 66 | }); 67 | } 68 | 69 | function pad2(s) { 70 | var o = s.toFixed(0); 71 | while (o.length < 2) { 72 | o = " " + o; 73 | } 74 | return o; 75 | } 76 | 77 | function pad(s) { 78 | var o = s.toFixed(18); 79 | while (o.length < 27) { 80 | o = " " + o; 81 | } 82 | return o; 83 | } 84 | 85 | function padToken(s, decimals) { 86 | var o = s.toFixed(decimals); 87 | var l = parseInt(decimals)+12; 88 | while (o.length < l) { 89 | o = " " + o; 90 | } 91 | return o; 92 | } 93 | 94 | 95 | // ----------------------------------------------------------------------------- 96 | // Transaction status 97 | // ----------------------------------------------------------------------------- 98 | function printTxData(name, txId) { 99 | var tx = eth.getTransaction(txId); 100 | var txReceipt = eth.getTransactionReceipt(txId); 101 | var gasPrice = tx.gasPrice; 102 | var gasCostETH = tx.gasPrice.mul(txReceipt.gasUsed).div(1e18); 103 | var gasCostUSD = gasCostETH.mul(ethPriceUSD); 104 | console.log("RESULT: " + name + " gas=" + tx.gas + " gasUsed=" + txReceipt.gasUsed + " costETH=" + gasCostETH + 105 | " costUSD=" + gasCostUSD + " @ ETH/USD=" + ethPriceUSD + " gasPrice=" + gasPrice + " block=" + 106 | txReceipt.blockNumber + " txId=" + txId); 107 | } 108 | 109 | function assertEtherBalance(account, expectedBalance) { 110 | var etherBalance = web3.fromWei(eth.getBalance(account), "ether"); 111 | if (etherBalance == expectedBalance) { 112 | console.log("RESULT: OK " + account + " has expected balance " + expectedBalance); 113 | } else { 114 | console.log("RESULT: FAILURE " + account + " has balance " + etherBalance + " <> expected " + expectedBalance); 115 | } 116 | } 117 | 118 | function gasEqualsGasUsed(tx) { 119 | var gas = eth.getTransaction(tx).gas; 120 | var gasUsed = eth.getTransactionReceipt(tx).gasUsed; 121 | return (gas == gasUsed); 122 | } 123 | 124 | function failIfGasEqualsGasUsed(tx, msg) { 125 | var gas = eth.getTransaction(tx).gas; 126 | var gasUsed = eth.getTransactionReceipt(tx).gasUsed; 127 | if (gas == gasUsed) { 128 | console.log("RESULT: FAIL " + msg); 129 | return 0; 130 | } else { 131 | console.log("RESULT: PASS " + msg); 132 | return 1; 133 | } 134 | } 135 | 136 | function passIfGasEqualsGasUsed(tx, msg) { 137 | var gas = eth.getTransaction(tx).gas; 138 | var gasUsed = eth.getTransactionReceipt(tx).gasUsed; 139 | if (gas == gasUsed) { 140 | console.log("RESULT: PASS " + msg); 141 | return 1; 142 | } else { 143 | console.log("RESULT: FAIL " + msg); 144 | return 0; 145 | } 146 | } 147 | 148 | function failIfGasEqualsGasUsedOrContractAddressNull(contractAddress, tx, msg) { 149 | if (contractAddress == null) { 150 | console.log("RESULT: FAIL " + msg); 151 | return 0; 152 | } else { 153 | var gas = eth.getTransaction(tx).gas; 154 | var gasUsed = eth.getTransactionReceipt(tx).gasUsed; 155 | if (gas == gasUsed) { 156 | console.log("RESULT: FAIL " + msg); 157 | return 0; 158 | } else { 159 | console.log("RESULT: PASS " + msg); 160 | return 1; 161 | } 162 | } 163 | } 164 | 165 | 166 | // ----------------------------------------------------------------------------- 167 | // Token Contract details 168 | // ----------------------------------------------------------------------------- 169 | function printTokenContractStaticDetails() { 170 | if (tokenContractAddress != null && tokenContractAbi != null) { 171 | var contract = eth.contract(tokenContractAbi).at(tokenContractAddress); 172 | console.log("RESULT: token.symbol=" + contract.symbol()); 173 | console.log("RESULT: token.name=" + contract.name()); 174 | console.log("RESULT: token.decimals=" + contract.decimals()); 175 | } 176 | } 177 | 178 | var dynamicDetailsFromBlock = 0; 179 | function printTokenContractDynamicDetails() { 180 | if (tokenContractAddress != null && tokenContractAbi != null) { 181 | var contract = eth.contract(tokenContractAbi).at(tokenContractAddress); 182 | var decimals = contract.decimals(); 183 | console.log("RESULT: token.totalSupply=" + contract.totalSupply().shift(-decimals)); 184 | console.log("RESULT: token.owner=" + contract.owner()); 185 | console.log("RESULT: token.newOwner=" + contract.newOwner()); 186 | 187 | var latestBlock = eth.blockNumber; 188 | var i; 189 | 190 | var ownershipTransferredEvent = contract.OwnershipTransferred({}, { fromBlock: dynamicDetailsFromBlock, toBlock: latestBlock }); 191 | i = 0; 192 | ownershipTransferredEvent.watch(function (error, result) { 193 | console.log("RESULT: OwnershipTransferred Event " + i++ + ": from=" + result.args._from + " to=" + result.args._to + " " + 194 | result.blockNumber); 195 | }); 196 | ownershipTransferredEvent.stopWatching(); 197 | 198 | var wavesTransferEvent = contract.WavesTransfer({}, { fromBlock: dynamicDetailsFromBlock, toBlock: latestBlock }); 199 | i = 0; 200 | wavesTransferEvent.watch(function (error, result) { 201 | console.log("RESULT: WavesTransfer Event " + i++ + ": from=" + result.args._from + " wavesAddress=" + result.args.wavesAddress + 202 | " amount=" + result.args.amount.shift(-decimals) + " block="+ result.blockNumber); 203 | }); 204 | wavesTransferEvent.stopWatching(); 205 | 206 | var approvalEvent = contract.Approval({}, { fromBlock: dynamicDetailsFromBlock, toBlock: latestBlock }); 207 | i = 0; 208 | approvalEvent.watch(function (error, result) { 209 | console.log("RESULT: Approval Event " + i++ + ": owner=" + result.args._owner + " spender=" + result.args._spender + " " + 210 | result.args._value.shift(-decimals) + " block=" + result.blockNumber); 211 | }); 212 | approvalEvent.stopWatching(); 213 | 214 | var transferEvent = contract.Transfer({}, { fromBlock: dynamicDetailsFromBlock, toBlock: latestBlock }); 215 | i = 0; 216 | transferEvent.watch(function (error, result) { 217 | console.log("RESULT: Transfer Event " + i++ + ": from=" + result.args._from + " to=" + result.args._to + 218 | " value=" + result.args._value.shift(-decimals) + " block=" + result.blockNumber); 219 | }); 220 | transferEvent.stopWatching(); 221 | dynamicDetailsFromBlock = latestBlock + 1; 222 | } 223 | } 224 | -------------------------------------------------------------------------------- /test/test1results.txt: -------------------------------------------------------------------------------- 1 | # Account EtherBalanceChange Token Name 2 | 1 0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e 0.000000000000000000 0 Account #0 - Miner 3 | 2 0xa11aae29840fbb5c86e6fd4cf809eba183aef433 0.000000000000000000 0 Account #1 - Token Owner 4 | 3 0xa22ab8a9d641ce77e06d98b7d7065d324d3d6976 0.000000000000000000 0 Account #2 5 | 4 0xa33a6c312d9ad0e0f2e95541beed0cc081621fd0 0.000000000000000000 0 Account #3 6 | 5 0xa44a08d3f6933c69212114bb66e2df1813651844 0.000000000000000000 0 Account #4 7 | 6 0xa55a151eb00fded1634d27d1127b4be4627079ea 0.000000000000000000 0 Account #5 8 | 7 0xa66a85ede0cbe03694aa9d9de0bb19c99ff55bd9 0.000000000000000000 0 Account #6 9 | 10 | Test 1.1 Deploy Token Contract 11 | tokenAddress=0x90d8927407c79c4a28ee879b821c76fc9bcc2688 gas=4000000 gasUsed=824983 costETH=0.01649966 costUSD=2.098756752 @ ETH/USD=127.2 gasPrice=20000000000 block=2 txId=0x7fc6acacee898ae87f94b5dc414621e234c478d5af9077dcf083ea14d5b15f8a 12 | # Account EtherBalanceChange Token Name 13 | 1 0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e 15.016499660000000000 0.00000000 Account #0 - Miner 14 | 2 0xa11aae29840fbb5c86e6fd4cf809eba183aef433 -0.016499660000000000 54364795.00000000 Account #1 - Token Owner 15 | 3 0xa22ab8a9d641ce77e06d98b7d7065d324d3d6976 0.000000000000000000 0.00000000 Account #2 16 | 4 0xa33a6c312d9ad0e0f2e95541beed0cc081621fd0 0.000000000000000000 0.00000000 Account #3 17 | 5 0xa44a08d3f6933c69212114bb66e2df1813651844 0.000000000000000000 0.00000000 Account #4 18 | 6 0xa55a151eb00fded1634d27d1127b4be4627079ea 0.000000000000000000 0.00000000 Account #5 19 | 7 0xa66a85ede0cbe03694aa9d9de0bb19c99ff55bd9 0.000000000000000000 0.00000000 Account #6 20 | 8 0x90d8927407c79c4a28ee879b821c76fc9bcc2688 0.000000000000000000 0.00000000 TOKEN 21 | PASS Test 1.1 Deploy Token Contract 22 | token.symbol=ETT 23 | token.name=EncyptoTel Token 24 | token.decimals=8 25 | token.totalSupply=54364795 26 | token.owner=0xa11aae29840fbb5c86e6fd4cf809eba183aef433 27 | token.newOwner=0x0000000000000000000000000000000000000000 28 | 29 | Test 1.2 Attempt to send ethers to the token contract - expecting to fail 30 | # Account EtherBalanceChange Token Name 31 | 1 0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e 25.024499660000000000 0.00000000 Account #0 - Miner 32 | 2 0xa11aae29840fbb5c86e6fd4cf809eba183aef433 -0.016499660000000000 54364795.00000000 Account #1 - Token Owner 33 | 3 0xa22ab8a9d641ce77e06d98b7d7065d324d3d6976 -0.008000000000000000 0.00000000 Account #2 34 | 4 0xa33a6c312d9ad0e0f2e95541beed0cc081621fd0 0.000000000000000000 0.00000000 Account #3 35 | 5 0xa44a08d3f6933c69212114bb66e2df1813651844 0.000000000000000000 0.00000000 Account #4 36 | 6 0xa55a151eb00fded1634d27d1127b4be4627079ea 0.000000000000000000 0.00000000 Account #5 37 | 7 0xa66a85ede0cbe03694aa9d9de0bb19c99ff55bd9 0.000000000000000000 0.00000000 Account #6 38 | 8 0x90d8927407c79c4a28ee879b821c76fc9bcc2688 0.000000000000000000 0.00000000 TOKEN 39 | PASS Test 1.2 Attempt to send ethers to the token contract - expecting to fail 40 | token.totalSupply=54364795 41 | token.owner=0xa11aae29840fbb5c86e6fd4cf809eba183aef433 42 | token.newOwner=0x0000000000000000000000000000000000000000 43 | 44 | Test 1.3 Token owner transfer 10,000 tokens to account2 and account3 45 | # Account EtherBalanceChange Token Name 46 | 1 0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e 40.026543100000000000 0.00000000 Account #0 - Miner 47 | 2 0xa11aae29840fbb5c86e6fd4cf809eba183aef433 -0.018543100000000000 54344795.00000000 Account #1 - Token Owner 48 | 3 0xa22ab8a9d641ce77e06d98b7d7065d324d3d6976 -0.008000000000000000 10000.00000000 Account #2 49 | 4 0xa33a6c312d9ad0e0f2e95541beed0cc081621fd0 0.000000000000000000 10000.00000000 Account #3 50 | 5 0xa44a08d3f6933c69212114bb66e2df1813651844 0.000000000000000000 0.00000000 Account #4 51 | 6 0xa55a151eb00fded1634d27d1127b4be4627079ea 0.000000000000000000 0.00000000 Account #5 52 | 7 0xa66a85ede0cbe03694aa9d9de0bb19c99ff55bd9 0.000000000000000000 0.00000000 Account #6 53 | 8 0x90d8927407c79c4a28ee879b821c76fc9bcc2688 0.000000000000000000 0.00000000 TOKEN 54 | PASS Test 1.3 Token owner transfer 10,000 tokens to account2 and account3 - account2 55 | PASS Test 1.3 Token owner transfer 10,000 tokens to account2 and account3 - account3 56 | token.totalSupply=54364795 57 | token.owner=0xa11aae29840fbb5c86e6fd4cf809eba183aef433 58 | token.newOwner=0x0000000000000000000000000000000000000000 59 | Transfer Event 0: from=0xa11aae29840fbb5c86e6fd4cf809eba183aef433 to=0xa22ab8a9d641ce77e06d98b7d7065d324d3d6976 value=10000 block=7 60 | Transfer Event 1: from=0xa11aae29840fbb5c86e6fd4cf809eba183aef433 to=0xa33a6c312d9ad0e0f2e95541beed0cc081621fd0 value=10000 block=7 61 | 62 | Test 1.4 Account2 transfers 50,000 tokens to account4 - expecting to fail without errors 63 | # Account EtherBalanceChange Token Name 64 | 1 0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e 50.027019940000000000 0.00000000 Account #0 - Miner 65 | 2 0xa11aae29840fbb5c86e6fd4cf809eba183aef433 -0.018543100000000000 54344795.00000000 Account #1 - Token Owner 66 | 3 0xa22ab8a9d641ce77e06d98b7d7065d324d3d6976 -0.008476840000000000 10000.00000000 Account #2 67 | 4 0xa33a6c312d9ad0e0f2e95541beed0cc081621fd0 0.000000000000000000 10000.00000000 Account #3 68 | 5 0xa44a08d3f6933c69212114bb66e2df1813651844 0.000000000000000000 0.00000000 Account #4 69 | 6 0xa55a151eb00fded1634d27d1127b4be4627079ea 0.000000000000000000 0.00000000 Account #5 70 | 7 0xa66a85ede0cbe03694aa9d9de0bb19c99ff55bd9 0.000000000000000000 0.00000000 Account #6 71 | 8 0x90d8927407c79c4a28ee879b821c76fc9bcc2688 0.000000000000000000 0.00000000 TOKEN 72 | PASS Test 1.4 Account2 transfers 50,000 tokens to account4 - expecting to fail without errors 73 | token.totalSupply=54364795 74 | token.owner=0xa11aae29840fbb5c86e6fd4cf809eba183aef433 75 | token.newOwner=0x0000000000000000000000000000000000000000 76 | 77 | Test 1.5 Account2 approves transfer of 2,000 tokens to account3 and account3 transfers 78 | # Account EtherBalanceChange Token Name 79 | 1 0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e 70.028482780000000000 0.00000000 Account #0 - Miner 80 | 2 0xa11aae29840fbb5c86e6fd4cf809eba183aef433 -0.018543100000000000 54344795.00000000 Account #1 - Token Owner 81 | 3 0xa22ab8a9d641ce77e06d98b7d7065d324d3d6976 -0.009383640000000000 8000.00000000 Account #2 82 | 4 0xa33a6c312d9ad0e0f2e95541beed0cc081621fd0 -0.000556040000000000 12000.00000000 Account #3 83 | 5 0xa44a08d3f6933c69212114bb66e2df1813651844 0.000000000000000000 0.00000000 Account #4 84 | 6 0xa55a151eb00fded1634d27d1127b4be4627079ea 0.000000000000000000 0.00000000 Account #5 85 | 7 0xa66a85ede0cbe03694aa9d9de0bb19c99ff55bd9 0.000000000000000000 0.00000000 Account #6 86 | 8 0x90d8927407c79c4a28ee879b821c76fc9bcc2688 0.000000000000000000 0.00000000 TOKEN 87 | PASS Test 1.5 Account2 approves transfer of 2,000 tokens to account3 and account3 transfers - account2 approves 88 | PASS Test 1.5 Account2 approves transfer of 2,000 tokens to account3 and account3 transfers - account3 transferFrom 89 | token.totalSupply=54364795 90 | token.owner=0xa11aae29840fbb5c86e6fd4cf809eba183aef433 91 | token.newOwner=0x0000000000000000000000000000000000000000 92 | Approval Event 0: owner=0xa22ab8a9d641ce77e06d98b7d7065d324d3d6976 spender=0xa33a6c312d9ad0e0f2e95541beed0cc081621fd0 2000 block=12 93 | Transfer Event 0: from=0xa22ab8a9d641ce77e06d98b7d7065d324d3d6976 to=0xa33a6c312d9ad0e0f2e95541beed0cc081621fd0 value=2000 block=14 94 | 95 | Test 1.6 Change Ownership 96 | tx1_6_1 gas=100000 gasUsed=43405 costETH=0.0008681 costUSD=0.11042232 @ ETH/USD=127.2 gasPrice=20000000000 block=16 txId=0x70a0b53505c77671dd1266c5655721099eeae7565d652722f4f5d9f37b6dbc49 97 | tx1_6_2 gas=100000 gasUsed=28497 costETH=0.00056994 costUSD=0.072496368 @ ETH/USD=127.2 gasPrice=20000000000 block=18 txId=0xf5622930ec91af48befb11d768330553afde352c942fd198ebc933e39b3f30f8 98 | # Account EtherBalanceChange Token Name 99 | 1 0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e 90.029350880000000000 0.00000000 Account #0 - Miner 100 | 2 0xa11aae29840fbb5c86e6fd4cf809eba183aef433 -0.019411200000000000 54344795.00000000 Account #1 - Token Owner 101 | 3 0xa22ab8a9d641ce77e06d98b7d7065d324d3d6976 -0.009383640000000000 8000.00000000 Account #2 102 | 4 0xa33a6c312d9ad0e0f2e95541beed0cc081621fd0 -0.000556040000000000 12000.00000000 Account #3 103 | 5 0xa44a08d3f6933c69212114bb66e2df1813651844 0.000000000000000000 0.00000000 Account #4 104 | 6 0xa55a151eb00fded1634d27d1127b4be4627079ea 0.000000000000000000 0.00000000 Account #5 105 | 7 0xa66a85ede0cbe03694aa9d9de0bb19c99ff55bd9 0.000000000000000000 0.00000000 Account #6 106 | 8 0x90d8927407c79c4a28ee879b821c76fc9bcc2688 0.000000000000000000 0.00000000 TOKEN 107 | PASS Test 1.6 Change Ownership - Change owner 108 | PASS Test 1.6 Change Ownership - Accept ownership 109 | token.totalSupply=54364795 110 | token.owner=0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e 111 | token.newOwner=0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e 112 | OwnershipTransferred Event 0: from=0xa11aae29840fbb5c86e6fd4cf809eba183aef433 to=0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e 18 113 | 114 | Test 1.6 Account2 blockswaps to Waves account 3PBcRZBV38UBWQXmmnXNkVf7VZLBQgGZ9DM 115 | # Account EtherBalanceChange Token Name 116 | 1 0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e 100.030462640000000000 2000.00000000 Account #0 - Miner 117 | 2 0xa11aae29840fbb5c86e6fd4cf809eba183aef433 -0.019411200000000000 54344795.00000000 Account #1 - Token Owner 118 | 3 0xa22ab8a9d641ce77e06d98b7d7065d324d3d6976 -0.010495400000000000 6000.00000000 Account #2 119 | 4 0xa33a6c312d9ad0e0f2e95541beed0cc081621fd0 -0.000556040000000000 12000.00000000 Account #3 120 | 5 0xa44a08d3f6933c69212114bb66e2df1813651844 0.000000000000000000 0.00000000 Account #4 121 | 6 0xa55a151eb00fded1634d27d1127b4be4627079ea 0.000000000000000000 0.00000000 Account #5 122 | 7 0xa66a85ede0cbe03694aa9d9de0bb19c99ff55bd9 0.000000000000000000 0.00000000 Account #6 123 | 8 0x90d8927407c79c4a28ee879b821c76fc9bcc2688 0.000000000000000000 0.00000000 TOKEN 124 | PASS Test 1.6 Account2 blockswaps to Waves account 3PBcRZBV38UBWQXmmnXNkVf7VZLBQgGZ9DM 125 | token.totalSupply=54364795 126 | token.owner=0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e 127 | token.newOwner=0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e 128 | WavesTransfer Event 0: from=0xa22ab8a9d641ce77e06d98b7d7065d324d3d6976 wavesAddress=3PBcRZBV38UBWQXmmnXNkVf7VZLBQgGZ9DM amount=2000 block=20 129 | Transfer Event 0: from=0xa22ab8a9d641ce77e06d98b7d7065d324d3d6976 to=0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e value=2000 block=20 130 | 131 | -------------------------------------------------------------------------------- /EncryptoTelTokenSecurityAudit.md: -------------------------------------------------------------------------------- 1 | # EncryptoTel Token Audit 2 | 3 | EncryptoTel has recently had a [crowdsale](http://ico.encryptotel.com/) between Apr 24 2017 and May 31 2017. 4 | This crowdsale raised over USD 4,429,211.94 consisting of BTC 851.84, ETH 3,742.16, WAVES 2,071,053.30, ETC 5,944.01 . 5 | 6 | The EncryptoTel token ETT will be a dual Waves and Ethereum blockchain token. 7 | 8 |
9 | 10 |
11 | 12 | **Table of contents** 13 | * [Background And History](#background-and-history) 14 | * [Security Overview Of The Smart Contract](#security-overview-of-the-smart-contract) 15 | * [Risks](#risks) 16 | * * [Other Notes](#other-notes) 17 | [Comments On The Source Code](#comments-on-the-source-code) 18 | * [References](#references) 19 | 20 |
21 | 22 |
23 | 24 | ## Background And History 25 | 26 | See description above. 27 | 28 |
29 | 30 |
31 | 32 | ## Security Overview Of The Smart Contract 33 | * [x] The smart contract has been kept relatively simple 34 | * [x] The code has been tested for the normal [ERC20](https://github.com/ethereum/EIPs/issues/20) use cases, and around some of the boundary cases 35 | * [x] Deployment, with correct `symbol()`, `name()`, `decimals()` and `totalSupply()` 36 | * [x] Block for ethers being sent to this contract 37 | * [x] `transfer(...)` from one account to another 38 | * [x] `approve(...)` and `transferFrom(...)` from one account to another 39 | * [x] `transferOwnership(...)` and `acceptOwnership()` of the token contract 40 | * [x] `moveToWaves(...)` with the Waves address where the `WavesTransfer(...)` event is logged 41 | * [x] The testing has been done using geth v1.6.1-stable-021c3c28/darwin-amd64/go1.8.1 and solc 0.4.11+commit.68ef5810.Darwin.appleclang instead of one of the testing frameworks and JavaScript VMs to simulate the live environment as closely as possible 42 | * [x] The `approveAndCall(...)` function has been omitted from this token smart contract as the side effects of this function has not been evaluated fully 43 | * [x] There is no logic with potential division by zero errors 44 | * [x] All numbers used are uint256 (with the exception of `decimals`), reducing the risk of errors from type conversions 45 | * [x] Areas with potential overflow errors in `transfer(...)` and `transferFrom(...)` have the logic to prevent overflows 46 | * [x] Areas with potential underflow errors in `transfer(...)` and `transferFrom(...)` have the logic to prevent underflows 47 | * [x] Function and event names are differentiated by case - function names begin with a lowercase character and event names begin with an uppercase character 48 | * [x] A default constructor has been added to reject any ethers being received by this smart contract 49 | * [x] The function `transferAnyERC20Token(...)` has been added in case the owner has to free any accidentally trapped ERC20 tokens 50 | * [x] The test results can be found in [test/test1results.txt](test/test1results.txt) for the results and [test/test1output.txt](test/test1output.txt) for the full output 51 | 52 |
53 | 54 | ### Risks 55 | 56 | * This token contract will not hold any ethers 57 | * In the case where a security vulnerability in this contract is discovered or exploited, a new token contract can be deployed to a new address with the correct(ed) balances transferred over from the old contract to the new contract 58 | * This token contract suffers from the same ERC20 double spend issue with the `approve(...)` and `transferFrom(...)` workflow, but this is a low risk exploit where: 59 | * Account1 approves for account2 to spend `x` 60 | * Account1 changes the approval limit to `y`. Account2 waits for the second approval transaction to be broadcasted and sends a `transferFrom(...)` to spend up to `x` before the second approval is mined 61 | * Account2 spends up to `y` after the second approval is mined. Account2 can therefore spend up to `x` + `y`, instead of `x` or `y` 62 | * To avoid this double spend, account1 has to set the approval limit to `0`, checking the `allowance(...)` and then setting the approval limit to `y` if account2 has not spent `x` 63 | 64 |
65 | 66 |
67 | 68 | ### Other Notes 69 | 70 | * This token contract has been developed and self-security audited - independent checks should be conducted before deployment 71 | * Remember to update TOTALSUPPLY to the finalised and reconciled ICO total supply 72 | 73 |
74 | 75 |
76 | 77 | ## Comments On The Source Code 78 | 79 | My comments in the following code are market in the lines beginning with `// NOTE: `. In this case there is nothing to note in the source code below. 80 | 81 | Following is the source code for [contracts/EncryptoTelToken.sol](https://github.com/bokkypoobah/Blockswap/blob/ca87455c4650e20cf44bb3e1a3a5378104b33921/contracts/EncryptoTelToken.sol): 82 | 83 | ```javascript 84 | pragma solidity ^0.4.10; 85 | 86 | // ---------------------------------------------------------------------------- 87 | // The EncryptoTel smart contract - provided by Incent - join us on slack; 88 | // http://incentinvites.herokuapp.com/ 89 | // 90 | // A collaboration between Incent, Bok and EncryptoTel :) 91 | // 92 | // Enjoy. (c) Incent Loyalty Pty Ltd and Bok Consulting Pty Ltd 2017. 93 | // The MIT Licence. 94 | // ---------------------------------------------------------------------------- 95 | 96 | // ---------------------------------------------------------------------------- 97 | // Contract configuration 98 | // ---------------------------------------------------------------------------- 99 | contract TokenConfig { 100 | string public constant symbol = "ETT"; 101 | string public constant name = "EncyptoTel Token"; 102 | uint8 public constant decimals = 8; // 8 decimals, same as tokens on Waves 103 | uint256 public constant TOTALSUPPLY = 5436479500000000; 104 | } 105 | 106 | 107 | // ---------------------------------------------------------------------------- 108 | // ERC Token Standard #20 Interface 109 | // https://github.com/ethereum/EIPs/issues/20 110 | // ---------------------------------------------------------------------------- 111 | contract ERC20Interface { 112 | uint256 public totalSupply; 113 | function balanceOf(address _owner) constant returns (uint256 balance); 114 | function transfer(address _to, uint256 _value) returns (bool success); 115 | function transferFrom(address _from, address _to, uint256 _value) 116 | returns (bool success); 117 | function approve(address _spender, uint256 _value) returns (bool success); 118 | function allowance(address _owner, address _spender) constant 119 | returns (uint256 remaining); 120 | event Transfer(address indexed _from, address indexed _to, uint256 _value); 121 | event Approval(address indexed _owner, address indexed _spender, 122 | uint256 _value); 123 | } 124 | 125 | 126 | // ---------------------------------------------------------------------------- 127 | // Owned contract 128 | // ---------------------------------------------------------------------------- 129 | contract Owned { 130 | address public owner; 131 | address public newOwner; 132 | event OwnershipTransferred(address indexed _from, address indexed _to); 133 | 134 | function Owned() { 135 | owner = msg.sender; 136 | } 137 | 138 | modifier onlyOwner { 139 | if (msg.sender != owner) throw; 140 | _; 141 | } 142 | 143 | function transferOwnership(address _newOwner) onlyOwner { 144 | newOwner = _newOwner; 145 | } 146 | 147 | function acceptOwnership() { 148 | if (msg.sender == newOwner) { 149 | OwnershipTransferred(owner, newOwner); 150 | owner = newOwner; 151 | } 152 | } 153 | } 154 | 155 | 156 | // ---------------------------------------------------------------------------- 157 | // WavesEthereumSwap functionality 158 | // ---------------------------------------------------------------------------- 159 | contract WavesEthereumSwap is Owned, ERC20Interface { 160 | event WavesTransfer(address indexed _from, string wavesAddress, 161 | uint256 amount); 162 | 163 | function moveToWaves(string wavesAddress, uint256 amount) { 164 | if (!transfer(owner, amount)) throw; 165 | WavesTransfer(msg.sender, wavesAddress, amount); 166 | } 167 | } 168 | 169 | 170 | // ---------------------------------------------------------------------------- 171 | // ERC Token Standard #20 Interface 172 | // https://github.com/ethereum/EIPs/issues/20 173 | // ---------------------------------------------------------------------------- 174 | contract EncryptoTelToken is TokenConfig, WavesEthereumSwap { 175 | 176 | // ------------------------------------------------------------------------ 177 | // Balances for each account 178 | // ------------------------------------------------------------------------ 179 | mapping(address => uint256) balances; 180 | 181 | // ------------------------------------------------------------------------ 182 | // Owner of account approves the transfer of an amount to another account 183 | // ------------------------------------------------------------------------ 184 | mapping(address => mapping (address => uint256)) allowed; 185 | 186 | // ------------------------------------------------------------------------ 187 | // Constructor 188 | // ------------------------------------------------------------------------ 189 | function EncryptoTelToken() Owned() TokenConfig() { 190 | totalSupply = TOTALSUPPLY; 191 | balances[owner] = TOTALSUPPLY; 192 | } 193 | 194 | // ------------------------------------------------------------------------ 195 | // Get the account balance of another account with address _owner 196 | // ------------------------------------------------------------------------ 197 | function balanceOf(address _owner) constant returns (uint256 balance) { 198 | return balances[_owner]; 199 | } 200 | 201 | // ------------------------------------------------------------------------ 202 | // Transfer the balance from owner's account to another account 203 | // ------------------------------------------------------------------------ 204 | function transfer( 205 | address _to, 206 | uint256 _amount 207 | ) returns (bool success) { 208 | if (balances[msg.sender] >= _amount // User has balance 209 | && _amount > 0 // Non-zero transfer 210 | && balances[_to] + _amount > balances[_to] // Overflow check 211 | ) { 212 | balances[msg.sender] -= _amount; 213 | balances[_to] += _amount; 214 | Transfer(msg.sender, _to, _amount); 215 | return true; 216 | } else { 217 | return false; 218 | } 219 | } 220 | 221 | // ------------------------------------------------------------------------ 222 | // Allow _spender to withdraw from your account, multiple times, up to the 223 | // _value amount. If this function is called again it overwrites the 224 | // current allowance with _value. 225 | // ------------------------------------------------------------------------ 226 | function approve( 227 | address _spender, 228 | uint256 _amount 229 | ) returns (bool success) { 230 | allowed[msg.sender][_spender] = _amount; 231 | Approval(msg.sender, _spender, _amount); 232 | return true; 233 | } 234 | 235 | // ------------------------------------------------------------------------ 236 | // Spender of tokens transfer an amount of tokens from the token owner's 237 | // balance to another account. The owner of the tokens must already 238 | // have approve(...)-d this transfer 239 | // ------------------------------------------------------------------------ 240 | function transferFrom( 241 | address _from, 242 | address _to, 243 | uint256 _amount 244 | ) returns (bool success) { 245 | if (balances[_from] >= _amount // From a/c has balance 246 | && allowed[_from][msg.sender] >= _amount // Transfer approved 247 | && _amount > 0 // Non-zero transfer 248 | && balances[_to] + _amount > balances[_to] // Overflow check 249 | ) { 250 | balances[_from] -= _amount; 251 | allowed[_from][msg.sender] -= _amount; 252 | balances[_to] += _amount; 253 | Transfer(_from, _to, _amount); 254 | return true; 255 | } else { 256 | return false; 257 | } 258 | } 259 | 260 | // ------------------------------------------------------------------------ 261 | // Returns the amount of tokens approved by the owner that can be 262 | // transferred to the spender's account 263 | // ------------------------------------------------------------------------ 264 | function allowance( 265 | address _owner, 266 | address _spender 267 | ) constant returns (uint256 remaining) { 268 | return allowed[_owner][_spender]; 269 | } 270 | 271 | // ------------------------------------------------------------------------ 272 | // Transfer out any accidentally sent ERC20 tokens 273 | // ------------------------------------------------------------------------ 274 | function transferAnyERC20Token( 275 | address tokenAddress, 276 | uint256 amount 277 | ) onlyOwner returns (bool success) { 278 | return ERC20Interface(tokenAddress).transfer(owner, amount); 279 | } 280 | 281 | // ------------------------------------------------------------------------ 282 | // Don't accept ethers 283 | // ------------------------------------------------------------------------ 284 | function () { 285 | throw; 286 | } 287 | } 288 | ``` 289 | 290 |
291 | 292 |
293 | 294 | ## References 295 | 296 | * [Ethereum Contract Security Techniques and Tips](https://github.com/ConsenSys/smart-contract-best-practices) 297 | * Solidity [bugs.json](https://github.com/ethereum/solidity/blob/develop/docs/bugs.json) and [bugs_by_version.json](https://github.com/ethereum/solidity/blob/develop/docs/bugs_by_version.json). 298 | 299 |
300 | 301 | (c) BokkyPooBah / Bok Consulting Pty Ltd - May 27 2017 302 | -------------------------------------------------------------------------------- /test/EncryptoTelToken.js: -------------------------------------------------------------------------------- 1 | var tokenOutput={"contracts":{"../contracts/EncryptoTelToken.sol:ERC20Interface":{"abi":"[{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_from\",\"type\":\"address\"},{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"balance\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"name\":\"remaining\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_owner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_spender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"}]","bin":""},"../contracts/EncryptoTelToken.sol:EncryptoTelToken":{"abi":"[{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_from\",\"type\":\"address\"},{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"balance\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"wavesAddress\",\"type\":\"string\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"moveToWaves\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"TOTALSUPPLY\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"newOwner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"tokenAddress\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferAnyERC20Token\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"name\":\"remaining\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"type\":\"constructor\"},{\"payable\":false,\"type\":\"fallback\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"wavesAddress\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"WavesTransfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_owner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_spender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"}]","bin":"6060604052341561000c57fe5b5b5b60008054600160a060020a03191633600160a060020a03161790555b66135073056d1b00600281905560008054600160a060020a03168152600360205260409020555b5b610a6b806100616000396000f300606060405236156100e35763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100f9578063095ea7b31461018957806318160ddd146101bc57806323b872dd146101de578063313ce5671461021757806370a082311461023d57806379ba50971461026b5780637f09beca1461027d5780638da5cb5b146102d757806394a08c691461030357806395d89b4114610325578063a9059cbb146103b5578063d4ee1d90146103e8578063dc39d06d14610414578063dd62ed3e14610447578063f2fde38b1461047b575b34156100eb57fe5b6100f75b60006000fd5b565b005b341561010157fe5b610109610499565b60408051602080825283518183015283519192839290830191850190808383821561014f575b80518252602083111561014f57601f19909201916020918201910161012f565b505050905090810190601f16801561017b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561019157fe5b6101a8600160a060020a03600435166024356104d0565b604080519115158252519081900360200190f35b34156101c457fe5b6101cc61053b565b60408051918252519081900360200190f35b34156101e657fe5b6101a8600160a060020a0360043581169060243516604435610541565b604080519115158252519081900360200190f35b341561021f57fe5b61022761065b565b6040805160ff9092168252519081900360200190f35b341561024557fe5b6101cc600160a060020a0360043516610660565b60408051918252519081900360200190f35b341561027357fe5b6100f761067f565b005b341561028557fe5b6100f7600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843750949650509335935061070a92505050565b005b34156102df57fe5b6102e76107e9565b60408051600160a060020a039092168252519081900360200190f35b341561030b57fe5b6101cc6107f8565b60408051918252519081900360200190f35b341561032d57fe5b610109610803565b60408051602080825283518183015283519192839290830191850190808383821561014f575b80518252602083111561014f57601f19909201916020918201910161012f565b505050905090810190601f16801561017b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103bd57fe5b6101a8600160a060020a036004351660243561083a565b604080519115158252519081900360200190f35b34156103f057fe5b6102e761090b565b60408051600160a060020a039092168252519081900360200190f35b341561041c57fe5b6101a8600160a060020a036004351660243561091a565b604080519115158252519081900360200190f35b341561044f57fe5b6101cc600160a060020a03600435811690602435166109c9565b60408051918252519081900360200190f35b341561048357fe5b6100f7600160a060020a03600435166109f6565b005b60408051808201909152601081527f456e637970746f54656c20546f6b656e00000000000000000000000000000000602082015281565b600160a060020a03338116600081815260046020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60025481565b600160a060020a0383166000908152600360205260408120548290108015906105915750600160a060020a0380851660009081526004602090815260408083203390941683529290522054829010155b801561059d5750600082115b80156105c25750600160a060020a038316600090815260036020526040902054828101115b1561064f57600160a060020a03808516600081815260036020818152604080842080548990039055600482528084203387168552825280842080548990039055948816808452918152918490208054870190558351868152935190937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92908290030190a3506001610653565b5060005b5b9392505050565b600881565b600160a060020a0381166000908152600360205260409020545b919050565b60015433600160a060020a0390811691161461069b5760006000fd5b60015460008054604051600160a060020a0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36001546000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790555b565b60005461072090600160a060020a03168261083a565b151561072c5760006000fd5b33600160a060020a03167f14bb4dd9d9205a00acda8bc9cfb299741c7cd8c25305c6d97e940c13e2a64cbf838360405180806020018381526020018281038252848181518152602001915080519060200190808383600083146107aa575b8051825260208311156107aa57601f19909201916020918201910161078a565b505050905090810190601f1680156107d65780820380516001836020036101000a031916815260200191505b50935050505060405180910390a25b5050565b600054600160a060020a031681565b66135073056d1b0081565b60408051808201909152600381527f4554540000000000000000000000000000000000000000000000000000000000602082015281565b600160a060020a0333166000908152600360205260408120548290108015906108635750600082115b80156108885750600160a060020a038316600090815260036020526040902054828101115b156108fc57600160a060020a03338116600081815260036020908152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3506001610535565b506000610535565b5b92915050565b600154600160a060020a031681565b6000805433600160a060020a039081169116146109375760006000fd5b6000805460408051602090810184905281517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0393841660048201526024810187905291519287169363a9059cbb936044808501949192918390030190829087803b15156109aa57fe5b6102c65a03f115156109b857fe5b5050604051519150505b5b92915050565b600160a060020a038083166000908152600460209081526040808320938516835292905220545b92915050565b60005433600160a060020a03908116911614610a125760006000fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b505600a165627a7a723058207659fc14bb082668d192a50ce02eeac0efd1cf7f674bbe8c32202abd6f19712d0029"},"../contracts/EncryptoTelToken.sol:Owned":{"abi":"[{\"constant\":false,\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"newOwner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"}]","bin":"6060604052341561000c57fe5b5b60008054600160a060020a03191633600160a060020a03161790555b5b610201806100396000396000f300606060405263ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166379ba5097811461005b5780638da5cb5b1461006d578063d4ee1d9014610099578063f2fde38b146100c5575bfe5b341561006357fe5b61006b6100e3565b005b341561007557fe5b61007d61016e565b60408051600160a060020a039092168252519081900360200190f35b34156100a157fe5b61007d61017d565b60408051600160a060020a039092168252519081900360200190f35b34156100cd57fe5b61006b600160a060020a036004351661018c565b005b60015433600160a060020a039081169116146100ff5760006000fd5b60015460008054604051600160a060020a0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36001546000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790555b565b600054600160a060020a031681565b600154600160a060020a031681565b60005433600160a060020a039081169116146101a85760006000fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b505600a165627a7a72305820f7c623eebb62a31e41183ca91036c3b350aa21d85e1241127805ae6088737cec0029"},"../contracts/EncryptoTelToken.sol:TokenConfig":{"abi":"[{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"TOTALSUPPLY\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"type\":\"function\"}]","bin":"6060604052341561000c57fe5b5b61026d8061001c6000396000f300606060405263ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461005b578063313ce567146100eb57806394a08c691461011157806395d89b4114610133575bfe5b341561006357fe5b61006b6101c3565b6040805160208082528351818301528351919283929083019185019080838382156100b1575b8051825260208311156100b157601f199092019160209182019101610091565b505050905090810190601f1680156100dd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156100f357fe5b6100fb6101fa565b6040805160ff9092168252519081900360200190f35b341561011957fe5b6101216101ff565b60408051918252519081900360200190f35b341561013b57fe5b61006b61020a565b6040805160208082528351818301528351919283929083019185019080838382156100b1575b8051825260208311156100b157601f199092019160209182019101610091565b505050905090810190601f1680156100dd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60408051808201909152601081527f456e637970746f54656c20546f6b656e00000000000000000000000000000000602082015281565b600881565b66135073056d1b0081565b60408051808201909152600381527f45545400000000000000000000000000000000000000000000000000000000006020820152815600a165627a7a72305820b41e8e9c5b79eb9d758b34ec8ca8b66c761789bc59c8408c71474c5812c1c9520029"},"../contracts/EncryptoTelToken.sol:WavesEthereumSwap":{"abi":"[{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_from\",\"type\":\"address\"},{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"balance\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"wavesAddress\",\"type\":\"string\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"moveToWaves\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"newOwner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"name\":\"remaining\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"wavesAddress\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"WavesTransfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_owner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_spender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"}]","bin":""}},"version":"0.4.11+commit.68ef5810.Darwin.appleclang"}; 2 | -------------------------------------------------------------------------------- /test/test1output.txt: -------------------------------------------------------------------------------- 1 | Welcome to the Geth JavaScript console! 2 | 3 | instance: Geth/v1.6.1-stable-021c3c28/darwin-amd64/go1.8.1 4 | coinbase: 0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e 5 | at block: 0 (Thu, 01 Jan 1970 10:00:00 AEST) 6 | datadir: /Users/bok/Projects/Blockswap/test/testchain 7 | modules: admin:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0 8 | 9 | > 10 | true 11 | > 12 | true 13 | > 14 | > 15 | undefined 16 | > 17 | undefined 18 | > 19 | > 20 | DATA: tokenABI=[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_amount","type":"uint256"}],"name":"approve","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_amount","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"wavesAddress","type":"string"},{"name":"amount","type":"uint256"}],"name":"moveToWaves","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"TOTALSUPPLY","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_amount","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"newOwner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"tokenAddress","type":"address"},{"name":"amount","type":"uint256"}],"name":"transferAnyERC20Token","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"type":"function"},{"inputs":[],"payable":false,"type":"constructor"},{"payable":false,"type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":false,"name":"wavesAddress","type":"string"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"WavesTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_owner","type":"address"},{"indexed":true,"name":"_spender","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"}],"name":"OwnershipTransferred","type":"event"}] 21 | undefined 22 | > 23 | > 24 | undefined 25 | > 26 | RESULT: # Account EtherBalanceChange Token Name 27 | RESULT: 1 0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e 0.000000000000000000 0 Account #0 - Miner 28 | RESULT: 2 0xa11aae29840fbb5c86e6fd4cf809eba183aef433 0.000000000000000000 0 Account #1 - Token Owner 29 | RESULT: 3 0xa22ab8a9d641ce77e06d98b7d7065d324d3d6976 0.000000000000000000 0 Account #2 30 | RESULT: 4 0xa33a6c312d9ad0e0f2e95541beed0cc081621fd0 0.000000000000000000 0 Account #3 31 | RESULT: 5 0xa44a08d3f6933c69212114bb66e2df1813651844 0.000000000000000000 0 Account #4 32 | RESULT: 6 0xa55a151eb00fded1634d27d1127b4be4627079ea 0.000000000000000000 0 Account #5 33 | RESULT: 7 0xa66a85ede0cbe03694aa9d9de0bb19c99ff55bd9 0.000000000000000000 0 Account #6 34 | undefined 35 | > 36 | RESULT: 37 | undefined 38 | > 39 | > 40 | > 41 | undefined 42 | > 43 | undefined 44 | > 45 | RESULT: Test 1.1 Deploy Token Contract 46 | undefined 47 | > 48 | undefined 49 | > 50 | {"abi":[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_amount","type":"uint256"}],"name":"approve","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_amount","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"wavesAddress","type":"string"},{"name":"amount","type":"uint256"}],"name":"moveToWaves","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"TOTALSUPPLY","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_amount","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"newOwner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"tokenAddress","type":"address"},{"name":"amount","type":"uint256"}],"name":"transferAnyERC20Token","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"type":"function"},{"inputs":[],"payable":false,"type":"constructor"},{"payable":false,"type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":false,"name":"wavesAddress","type":"string"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"WavesTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_owner","type":"address"},{"indexed":true,"name":"_spender","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"}],"name":"OwnershipTransferred","type":"event"}],"eth":{"_requestManager":{"polls":{},"provider":{},"timeout":null},"accounts":["0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e","0xa11aae29840fbb5c86e6fd4cf809eba183aef433","0xa22ab8a9d641ce77e06d98b7d7065d324d3d6976","0xa33a6c312d9ad0e0f2e95541beed0cc081621fd0","0xa44a08d3f6933c69212114bb66e2df1813651844","0xa55a151eb00fded1634d27d1127b4be4627079ea","0xa66a85ede0cbe03694aa9d9de0bb19c99ff55bd9","0xa77a2b9d4b1c010a22a7c565dc418cef683dbcec","0xa88a05d2b88283ce84c8325760b72a64591279a2","0xa99a0ae3354c06b1459fd441a32a3f71005d7da0","0xaaaa9de1e6c564446ebca0fd102d8bd92093c756","0xabba43e7594e3b76afb157989e93c6621497fd4b","0xacca534c9f62ab495bd986e002ddf0f054caae4f","0xadda9b762a00ff12711113bfdc36958b73d7f915","0xaeea63b5479b50f79583ec49dacdcf86ddeff392","0xaffa4d3a80add8ce4018540e056dacb649589394"],"blockNumber":0,"coinbase":"0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e","compile":{},"gasPrice":"20000000000","hashrate":0,"mining":true,"pendingTransactions":[],"protocolVersion":"0x3f","syncing":false}} 51 | undefined 52 | > 53 | undefined 54 | > 55 | undefined 56 | > 57 | ... 58 | ...... 59 | ......... 60 | ............ 61 | ............ 62 | ............ 63 | ............ 64 | ............ 65 | ............ 66 | ............ 67 | ............ 68 | ......... 69 | ...... 70 | ... 71 | undefined 72 | > 73 | ... 74 | undefined 75 | > 76 | DATA: tokenAddress=0x90d8927407c79c4a28ee879b821c76fc9bcc2688 77 | RESULT: tokenAddress=0x90d8927407c79c4a28ee879b821c76fc9bcc2688 gas=4000000 gasUsed=824983 costETH=0.01649966 costUSD=2.098756752 @ ETH/USD=127.2 gasPrice=20000000000 block=2 txId=0x7fc6acacee898ae87f94b5dc414621e234c478d5af9077dcf083ea14d5b15f8a 78 | RESULT: # Account EtherBalanceChange Token Name 79 | RESULT: 1 0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e 15.016499660000000000 0.00000000 Account #0 - Miner 80 | RESULT: 2 0xa11aae29840fbb5c86e6fd4cf809eba183aef433 -0.016499660000000000 54364795.00000000 Account #1 - Token Owner 81 | RESULT: 3 0xa22ab8a9d641ce77e06d98b7d7065d324d3d6976 0.000000000000000000 0.00000000 Account #2 82 | RESULT: 4 0xa33a6c312d9ad0e0f2e95541beed0cc081621fd0 0.000000000000000000 0.00000000 Account #3 83 | RESULT: 5 0xa44a08d3f6933c69212114bb66e2df1813651844 0.000000000000000000 0.00000000 Account #4 84 | RESULT: 6 0xa55a151eb00fded1634d27d1127b4be4627079ea 0.000000000000000000 0.00000000 Account #5 85 | RESULT: 7 0xa66a85ede0cbe03694aa9d9de0bb19c99ff55bd9 0.000000000000000000 0.00000000 Account #6 86 | RESULT: 8 0x90d8927407c79c4a28ee879b821c76fc9bcc2688 0.000000000000000000 0.00000000 TOKEN 87 | undefined 88 | > 89 | RESULT: PASS Test 1.1 Deploy Token Contract 90 | 1 91 | > 92 | RESULT: token.symbol=ETT 93 | RESULT: token.name=EncyptoTel Token 94 | RESULT: token.decimals=8 95 | undefined 96 | > 97 | RESULT: token.totalSupply=54364795 98 | RESULT: token.owner=0xa11aae29840fbb5c86e6fd4cf809eba183aef433 99 | RESULT: token.newOwner=0x0000000000000000000000000000000000000000 100 | undefined 101 | > 102 | RESULT: 103 | undefined 104 | > 105 | {"_eth":{"_requestManager":{"polls":{},"provider":{},"timeout":null},"accounts":["0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e","0xa11aae29840fbb5c86e6fd4cf809eba183aef433","0xa22ab8a9d641ce77e06d98b7d7065d324d3d6976","0xa33a6c312d9ad0e0f2e95541beed0cc081621fd0","0xa44a08d3f6933c69212114bb66e2df1813651844","0xa55a151eb00fded1634d27d1127b4be4627079ea","0xa66a85ede0cbe03694aa9d9de0bb19c99ff55bd9","0xa77a2b9d4b1c010a22a7c565dc418cef683dbcec","0xa88a05d2b88283ce84c8325760b72a64591279a2","0xa99a0ae3354c06b1459fd441a32a3f71005d7da0","0xaaaa9de1e6c564446ebca0fd102d8bd92093c756","0xabba43e7594e3b76afb157989e93c6621497fd4b","0xacca534c9f62ab495bd986e002ddf0f054caae4f","0xadda9b762a00ff12711113bfdc36958b73d7f915","0xaeea63b5479b50f79583ec49dacdcf86ddeff392","0xaffa4d3a80add8ce4018540e056dacb649589394"],"blockNumber":3,"coinbase":"0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e","compile":{},"gasPrice":"20000000000","hashrate":5435,"mining":true,"pendingTransactions":[],"protocolVersion":"0x3f","syncing":false},"abi":[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_amount","type":"uint256"}],"name":"approve","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_amount","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"wavesAddress","type":"string"},{"name":"amount","type":"uint256"}],"name":"moveToWaves","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"TOTALSUPPLY","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_amount","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"newOwner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"tokenAddress","type":"address"},{"name":"amount","type":"uint256"}],"name":"transferAnyERC20Token","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"type":"function"},{"inputs":[],"payable":false,"type":"constructor"},{"payable":false,"type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":false,"name":"wavesAddress","type":"string"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"WavesTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_owner","type":"address"},{"indexed":true,"name":"_spender","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"}],"name":"OwnershipTransferred","type":"event"}],"address":"0x90d8927407c79c4a28ee879b821c76fc9bcc2688","transactionHash":"0x7fc6acacee898ae87f94b5dc414621e234c478d5af9077dcf083ea14d5b15f8a"} 106 | undefined 107 | > 108 | > 109 | > 110 | undefined 111 | > 112 | undefined 113 | > 114 | RESULT: Test 1.2 Attempt to send ethers to the token contract - expecting to fail 115 | undefined 116 | > 117 | undefined 118 | > 119 | ... 120 | undefined 121 | > 122 | RESULT: # Account EtherBalanceChange Token Name 123 | RESULT: 1 0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e 25.024499660000000000 0.00000000 Account #0 - Miner 124 | RESULT: 2 0xa11aae29840fbb5c86e6fd4cf809eba183aef433 -0.016499660000000000 54364795.00000000 Account #1 - Token Owner 125 | RESULT: 3 0xa22ab8a9d641ce77e06d98b7d7065d324d3d6976 -0.008000000000000000 0.00000000 Account #2 126 | RESULT: 4 0xa33a6c312d9ad0e0f2e95541beed0cc081621fd0 0.000000000000000000 0.00000000 Account #3 127 | RESULT: 5 0xa44a08d3f6933c69212114bb66e2df1813651844 0.000000000000000000 0.00000000 Account #4 128 | RESULT: 6 0xa55a151eb00fded1634d27d1127b4be4627079ea 0.000000000000000000 0.00000000 Account #5 129 | RESULT: 7 0xa66a85ede0cbe03694aa9d9de0bb19c99ff55bd9 0.000000000000000000 0.00000000 Account #6 130 | RESULT: 8 0x90d8927407c79c4a28ee879b821c76fc9bcc2688 0.000000000000000000 0.00000000 TOKEN 131 | undefined 132 | > 133 | RESULT: PASS Test 1.2 Attempt to send ethers to the token contract - expecting to fail 134 | 1 135 | > 136 | RESULT: token.totalSupply=54364795 137 | RESULT: token.owner=0xa11aae29840fbb5c86e6fd4cf809eba183aef433 138 | RESULT: token.newOwner=0x0000000000000000000000000000000000000000 139 | undefined 140 | > 141 | RESULT: 142 | undefined 143 | > 144 | > 145 | > 146 | undefined 147 | > 148 | undefined 149 | > 150 | RESULT: Test 1.3 Token owner transfer 10,000 tokens to account2 and account3 151 | undefined 152 | > 153 | undefined 154 | > 155 | undefined 156 | > 157 | ... 158 | undefined 159 | > 160 | RESULT: # Account EtherBalanceChange Token Name 161 | RESULT: 1 0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e 40.026543100000000000 0.00000000 Account #0 - Miner 162 | RESULT: 2 0xa11aae29840fbb5c86e6fd4cf809eba183aef433 -0.018543100000000000 54344795.00000000 Account #1 - Token Owner 163 | RESULT: 3 0xa22ab8a9d641ce77e06d98b7d7065d324d3d6976 -0.008000000000000000 10000.00000000 Account #2 164 | RESULT: 4 0xa33a6c312d9ad0e0f2e95541beed0cc081621fd0 0.000000000000000000 10000.00000000 Account #3 165 | RESULT: 5 0xa44a08d3f6933c69212114bb66e2df1813651844 0.000000000000000000 0.00000000 Account #4 166 | RESULT: 6 0xa55a151eb00fded1634d27d1127b4be4627079ea 0.000000000000000000 0.00000000 Account #5 167 | RESULT: 7 0xa66a85ede0cbe03694aa9d9de0bb19c99ff55bd9 0.000000000000000000 0.00000000 Account #6 168 | RESULT: 8 0x90d8927407c79c4a28ee879b821c76fc9bcc2688 0.000000000000000000 0.00000000 TOKEN 169 | undefined 170 | > 171 | RESULT: PASS Test 1.3 Token owner transfer 10,000 tokens to account2 and account3 - account2 172 | 1 173 | > 174 | RESULT: PASS Test 1.3 Token owner transfer 10,000 tokens to account2 and account3 - account3 175 | 1 176 | > 177 | RESULT: token.totalSupply=54364795 178 | RESULT: token.owner=0xa11aae29840fbb5c86e6fd4cf809eba183aef433 179 | RESULT: token.newOwner=0x0000000000000000000000000000000000000000 180 | RESULT: Transfer Event 0: from=0xa11aae29840fbb5c86e6fd4cf809eba183aef433 to=0xa22ab8a9d641ce77e06d98b7d7065d324d3d6976 value=10000 block=7 181 | RESULT: Transfer Event 1: from=0xa11aae29840fbb5c86e6fd4cf809eba183aef433 to=0xa33a6c312d9ad0e0f2e95541beed0cc081621fd0 value=10000 block=7 182 | undefined 183 | > 184 | RESULT: 185 | undefined 186 | > 187 | > 188 | > 189 | undefined 190 | > 191 | undefined 192 | > 193 | RESULT: Test 1.4 Account2 transfers 50,000 tokens to account4 - expecting to fail without errors 194 | undefined 195 | > 196 | undefined 197 | > 198 | ... 199 | undefined 200 | > 201 | RESULT: # Account EtherBalanceChange Token Name 202 | RESULT: 1 0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e 50.027019940000000000 0.00000000 Account #0 - Miner 203 | RESULT: 2 0xa11aae29840fbb5c86e6fd4cf809eba183aef433 -0.018543100000000000 54344795.00000000 Account #1 - Token Owner 204 | RESULT: 3 0xa22ab8a9d641ce77e06d98b7d7065d324d3d6976 -0.008476840000000000 10000.00000000 Account #2 205 | RESULT: 4 0xa33a6c312d9ad0e0f2e95541beed0cc081621fd0 0.000000000000000000 10000.00000000 Account #3 206 | RESULT: 5 0xa44a08d3f6933c69212114bb66e2df1813651844 0.000000000000000000 0.00000000 Account #4 207 | RESULT: 6 0xa55a151eb00fded1634d27d1127b4be4627079ea 0.000000000000000000 0.00000000 Account #5 208 | RESULT: 7 0xa66a85ede0cbe03694aa9d9de0bb19c99ff55bd9 0.000000000000000000 0.00000000 Account #6 209 | RESULT: 8 0x90d8927407c79c4a28ee879b821c76fc9bcc2688 0.000000000000000000 0.00000000 TOKEN 210 | undefined 211 | > 212 | RESULT: PASS Test 1.4 Account2 transfers 50,000 tokens to account4 - expecting to fail without errors 213 | 1 214 | > 215 | RESULT: token.totalSupply=54364795 216 | RESULT: token.owner=0xa11aae29840fbb5c86e6fd4cf809eba183aef433 217 | RESULT: token.newOwner=0x0000000000000000000000000000000000000000 218 | undefined 219 | > 220 | RESULT: 221 | undefined 222 | > 223 | > 224 | > 225 | undefined 226 | > 227 | undefined 228 | > 229 | RESULT: Test 1.5 Account2 approves transfer of 2,000 tokens to account3 and account3 transfers 230 | undefined 231 | > 232 | undefined 233 | > 234 | ... 235 | undefined 236 | > 237 | undefined 238 | > 239 | ... 240 | undefined 241 | > 242 | RESULT: # Account EtherBalanceChange Token Name 243 | RESULT: 1 0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e 70.028482780000000000 0.00000000 Account #0 - Miner 244 | RESULT: 2 0xa11aae29840fbb5c86e6fd4cf809eba183aef433 -0.018543100000000000 54344795.00000000 Account #1 - Token Owner 245 | RESULT: 3 0xa22ab8a9d641ce77e06d98b7d7065d324d3d6976 -0.009383640000000000 8000.00000000 Account #2 246 | RESULT: 4 0xa33a6c312d9ad0e0f2e95541beed0cc081621fd0 -0.000556040000000000 12000.00000000 Account #3 247 | RESULT: 5 0xa44a08d3f6933c69212114bb66e2df1813651844 0.000000000000000000 0.00000000 Account #4 248 | RESULT: 6 0xa55a151eb00fded1634d27d1127b4be4627079ea 0.000000000000000000 0.00000000 Account #5 249 | RESULT: 7 0xa66a85ede0cbe03694aa9d9de0bb19c99ff55bd9 0.000000000000000000 0.00000000 Account #6 250 | RESULT: 8 0x90d8927407c79c4a28ee879b821c76fc9bcc2688 0.000000000000000000 0.00000000 TOKEN 251 | undefined 252 | > 253 | RESULT: PASS Test 1.5 Account2 approves transfer of 2,000 tokens to account3 and account3 transfers - account2 approves 254 | 1 255 | > 256 | RESULT: PASS Test 1.5 Account2 approves transfer of 2,000 tokens to account3 and account3 transfers - account3 transferFrom 257 | 1 258 | > 259 | RESULT: token.totalSupply=54364795 260 | RESULT: token.owner=0xa11aae29840fbb5c86e6fd4cf809eba183aef433 261 | RESULT: token.newOwner=0x0000000000000000000000000000000000000000 262 | RESULT: Approval Event 0: owner=0xa22ab8a9d641ce77e06d98b7d7065d324d3d6976 spender=0xa33a6c312d9ad0e0f2e95541beed0cc081621fd0 2000 block=12 263 | RESULT: Transfer Event 0: from=0xa22ab8a9d641ce77e06d98b7d7065d324d3d6976 to=0xa33a6c312d9ad0e0f2e95541beed0cc081621fd0 value=2000 block=14 264 | undefined 265 | > 266 | RESULT: 267 | undefined 268 | > 269 | > 270 | > 271 | undefined 272 | > 273 | undefined 274 | > 275 | RESULT: Test 1.6 Change Ownership 276 | undefined 277 | > 278 | undefined 279 | > 280 | ... 281 | undefined 282 | > 283 | undefined 284 | > 285 | ... 286 | undefined 287 | > 288 | RESULT: tx1_6_1 gas=100000 gasUsed=43405 costETH=0.0008681 costUSD=0.11042232 @ ETH/USD=127.2 gasPrice=20000000000 block=16 txId=0x70a0b53505c77671dd1266c5655721099eeae7565d652722f4f5d9f37b6dbc49 289 | undefined 290 | > 291 | RESULT: tx1_6_2 gas=100000 gasUsed=28497 costETH=0.00056994 costUSD=0.072496368 @ ETH/USD=127.2 gasPrice=20000000000 block=18 txId=0xf5622930ec91af48befb11d768330553afde352c942fd198ebc933e39b3f30f8 292 | undefined 293 | > 294 | RESULT: # Account EtherBalanceChange Token Name 295 | RESULT: 1 0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e 90.029350880000000000 0.00000000 Account #0 - Miner 296 | RESULT: 2 0xa11aae29840fbb5c86e6fd4cf809eba183aef433 -0.019411200000000000 54344795.00000000 Account #1 - Token Owner 297 | RESULT: 3 0xa22ab8a9d641ce77e06d98b7d7065d324d3d6976 -0.009383640000000000 8000.00000000 Account #2 298 | RESULT: 4 0xa33a6c312d9ad0e0f2e95541beed0cc081621fd0 -0.000556040000000000 12000.00000000 Account #3 299 | RESULT: 5 0xa44a08d3f6933c69212114bb66e2df1813651844 0.000000000000000000 0.00000000 Account #4 300 | RESULT: 6 0xa55a151eb00fded1634d27d1127b4be4627079ea 0.000000000000000000 0.00000000 Account #5 301 | RESULT: 7 0xa66a85ede0cbe03694aa9d9de0bb19c99ff55bd9 0.000000000000000000 0.00000000 Account #6 302 | RESULT: 8 0x90d8927407c79c4a28ee879b821c76fc9bcc2688 0.000000000000000000 0.00000000 TOKEN 303 | undefined 304 | > 305 | RESULT: PASS Test 1.6 Change Ownership - Change owner 306 | 1 307 | > 308 | RESULT: PASS Test 1.6 Change Ownership - Accept ownership 309 | 1 310 | > 311 | RESULT: token.totalSupply=54364795 312 | RESULT: token.owner=0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e 313 | RESULT: token.newOwner=0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e 314 | RESULT: OwnershipTransferred Event 0: from=0xa11aae29840fbb5c86e6fd4cf809eba183aef433 to=0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e 18 315 | undefined 316 | > 317 | RESULT: 318 | undefined 319 | > 320 | > 321 | > 322 | undefined 323 | > 324 | undefined 325 | > 326 | RESULT: Test 1.6 Account2 blockswaps to Waves account 3PBcRZBV38UBWQXmmnXNkVf7VZLBQgGZ9DM 327 | undefined 328 | > 329 | undefined 330 | > 331 | ... 332 | undefined 333 | > 334 | RESULT: # Account EtherBalanceChange Token Name 335 | RESULT: 1 0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e 100.030462640000000000 2000.00000000 Account #0 - Miner 336 | RESULT: 2 0xa11aae29840fbb5c86e6fd4cf809eba183aef433 -0.019411200000000000 54344795.00000000 Account #1 - Token Owner 337 | RESULT: 3 0xa22ab8a9d641ce77e06d98b7d7065d324d3d6976 -0.010495400000000000 6000.00000000 Account #2 338 | RESULT: 4 0xa33a6c312d9ad0e0f2e95541beed0cc081621fd0 -0.000556040000000000 12000.00000000 Account #3 339 | RESULT: 5 0xa44a08d3f6933c69212114bb66e2df1813651844 0.000000000000000000 0.00000000 Account #4 340 | RESULT: 6 0xa55a151eb00fded1634d27d1127b4be4627079ea 0.000000000000000000 0.00000000 Account #5 341 | RESULT: 7 0xa66a85ede0cbe03694aa9d9de0bb19c99ff55bd9 0.000000000000000000 0.00000000 Account #6 342 | RESULT: 8 0x90d8927407c79c4a28ee879b821c76fc9bcc2688 0.000000000000000000 0.00000000 TOKEN 343 | undefined 344 | > 345 | RESULT: PASS Test 1.6 Account2 blockswaps to Waves account 3PBcRZBV38UBWQXmmnXNkVf7VZLBQgGZ9DM 346 | 1 347 | > 348 | RESULT: token.totalSupply=54364795 349 | RESULT: token.owner=0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e 350 | RESULT: token.newOwner=0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e 351 | RESULT: WavesTransfer Event 0: from=0xa22ab8a9d641ce77e06d98b7d7065d324d3d6976 wavesAddress=3PBcRZBV38UBWQXmmnXNkVf7VZLBQgGZ9DM amount=2000 block=20 352 | RESULT: Transfer Event 0: from=0xa22ab8a9d641ce77e06d98b7d7065d324d3d6976 to=0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e value=2000 block=20 353 | undefined 354 | > 355 | RESULT: 356 | undefined 357 | > 358 | > 359 | --------------------------------------------------------------------------------