This commit is contained in:
BokkyPooBah 2017-11-13 00:10:35 +11:00
parent 0faabd9998
commit 99f5ce21c3
22 changed files with 163 additions and 0 deletions

8
audit/test/00_runGeth.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
rm -f ./testchain/geth/chaindata/*
geth --datadir ./testchain init genesis.json
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

57
audit/test/README.md Normal file
View File

@ -0,0 +1,57 @@
# Contract - Testing
<br />
<hr />
# Table of contents
* [Requirements](#requirements)
* [Executing The Tests](#executing-the-tests)
* [The Tests](#the-tests)
* [Notes](#notes)
<br />
<hr />
# Requirements
* The tests works on OS/X. Should work in Linux. May work in Windows with Cygwin
* Geth/v1.7.2-stable-1db4ecdc/darwin-amd64/go1.9
* Solc 0.4.18+commit.9cf6e910.Darwin.appleclang
<br />
<hr />
# Executing The Tests
* Run `geth` in dev mode
./00_runGeth.sh
* Run the test in [01_test1.sh](01_test1.sh)
./01_test1.sh
* See [test1results.txt](test1results.txt) for the results and [test1output.txt](test1output.txt) for the full output.
<br />
<hr />
# Notes
* The tests were conducted using bash shell scripts running Geth/v1.7.2-stable-1db4ecdc/darwin-amd64/go1.9 JavaScript commands
* The smart contracts were compiled using Solidity 0.4.18+commit.9cf6e910.Darwin.appleclang
* The test script can be found in [01_test1.sh](01_test1.sh)
* The test results can be found in [test1results.txt](test1results.txt) with details in [test1output.txt](test1output.txt)
* The test can be run on OS/X, should run on Linux and may run on Windows with Cygwin
* The [genesis.json](genesis.json) allocates ethers to the test accounts, and specifies a high block gas limit to accommodate many transactions in the same block
* The [00_runGeth.sh](00_runGeth.sh) scripts starts `geth` with the parameter `--targetgaslimit 994712388` to keep the high block gas limit
* The reasons for using the test environment as listed above, instead of truffles/testrpc are:
* The test are conducted using the actual blockchain client software as is running on Mainnet and not just a mock environment like testrpc
* It is easy to change parameters like dates, addresses or blocknumbers using the Unix search/replace tools
* There have been issues in the part with version incompatibility between testrpc and solidity, i.e., version mismatches
* The intermediate and key results are all saved to later viewing

67
audit/test/genesis.json Normal file
View File

@ -0,0 +1,67 @@
{
"config": {
"homesteadBlock": 1,
"byzantiumBlock": 2
},
"nonce": "0",
"difficulty": "0x400",
"mixhash": "0x00000000000000000000000000000000000000647572616c65787365646c6578",
"coinbase": "0x0000000000000000000000000000000000000000",
"timestamp": "0x00",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x",
"gasLimit": "0x3B4A1B44",
"alloc": {
"0xa00af22d07c87d96eeeb0ed583f8f6ac7812827e": {
"balance": "10000000000000000000000000"
},
"0xa11aae29840fbb5c86e6fd4cf809eba183aef433": {
"balance": "10000000000000000000000000"
},
"0xa22ab8a9d641ce77e06d98b7d7065d324d3d6976": {
"balance": "10000000000000000000000000"
},
"0xa33a6c312d9ad0e0f2e95541beed0cc081621fd0": {
"balance": "10000000000000000000000000"
},
"0xa44a08d3f6933c69212114bb66e2df1813651844": {
"balance": "10000000000000000000000000"
},
"0xa55a151eb00fded1634d27d1127b4be4627079ea": {
"balance": "10000000000000000000000000"
},
"0xa66a85ede0cbe03694aa9d9de0bb19c99ff55bd9": {
"balance": "10000000000000000000000000"
},
"0xa77a2b9d4b1c010a22a7c565dc418cef683dbcec": {
"balance": "10000000000000000000000000"
},
"0xa88a05d2b88283ce84c8325760b72a64591279a2": {
"balance": "10000000000000000000000000"
},
"0xa99a0ae3354c06b1459fd441a32a3f71005d7da0": {
"balance": "10000000000000000000000000"
},
"0xaaaa9de1e6c564446ebca0fd102d8bd92093c756": {
"balance": "10000000000000000000000000"
},
"0xabba43e7594e3b76afb157989e93c6621497fd4b": {
"balance": "10000000000000000000000000"
},
"0xacca534c9f62ab495bd986e002ddf0f054caae4f": {
"balance": "10000000000000000000000000"
},
"0xadda9b762a00ff12711113bfdc36958b73d7f915": {
"balance": "10000000000000000000000000"
},
"0xaeea63b5479b50f79583ec49dacdcf86ddeff392": {
"balance": "10000000000000000000000000"
},
"0xaffa4d3a80add8ce4018540e056dacb649589394": {
"balance": "10000000000000000000000000"
},
"0xbbbb34fa53a801b5f298744490a1596438bbbe50": {
"balance": "10000000000000000000000000"
}
}
}

13
audit/test/settings.txt Normal file
View File

@ -0,0 +1,13 @@
IPCFILE=ipc:./testchain/geth.ipc
PASSWORD=testtest
CONTRACTSDIR=../../flat
SALESOL=PresaleOracles_flat.sol
SALEJS=PresaleOracles_flat.js
DEPLOYMENTDATA=deploymentData.txt
INCLUDEJS=./include.js
TEST1OUTPUT=test1output.txt
TEST1RESULTS=test1results.txt

View File

@ -0,0 +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}

View File

@ -0,0 +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}

View File

@ -0,0 +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}

View File

@ -0,0 +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}

View File

@ -0,0 +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}

View File

@ -0,0 +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}

View File

@ -0,0 +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}

View File

@ -0,0 +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}

View File

@ -0,0 +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}

View File

@ -0,0 +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}

View File

@ -0,0 +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}

View File

@ -0,0 +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}

View File

@ -0,0 +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}

View File

@ -0,0 +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}

View File

@ -0,0 +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}

View File

@ -0,0 +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}

View File

@ -0,0 +1 @@
{"address":"bbbb34fa53a801b5f298744490a1596438bbbe50","crypto":{"cipher":"aes-128-ctr","ciphertext":"e0c451ce3787c50d965e82682d48d0c0515ef65809dfae49cf970a3a19995248","cipherparams":{"iv":"2e3945b92834f1e83a5038a4b7453b19"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"402f5bbe8ae477647c75abb80a7c9cb2d073be19e89442723847c3b959c96f7e"},"mac":"f294136b60656f7ec37151b54f4c78328c05e149b65d855e32d96feaf8c46718"},"id":"30c3bd74-9469-4075-8319-cb4aaee801ab","version":3}

1
audit/test/testpassword Normal file
View File

@ -0,0 +1 @@
testtest