Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vinhyenvodoi98/smartcontract-unit-testing
https://github.com/vinhyenvodoi98/smartcontract-unit-testing
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/vinhyenvodoi98/smartcontract-unit-testing
- Owner: vinhyenvodoi98
- Created: 2019-06-21T01:41:06.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T19:44:57.000Z (about 2 years ago)
- Last Synced: 2024-12-11T13:13:35.689Z (2 months ago)
- Language: JavaScript
- Size: 22.2 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
Run loom
./loom run
Create contract by this command
yarn truffle create contract DappToken
Deploy the ERC20 token contract to Testrpc
yarn truffle migrate
or
yarn truffle deploy -remove --network loom_dapp_chain
Create a test .js file for this contract.
yarn truffle create test fixedsupplytoken
Run test
it run test in network 'test' when run **yarn truffle test** in version 4.1.13
yarn truffle test ./test/fixedsupplytoken.js
setup network test
yarn truffle test --network loom_dapp_chain
Have error
error contain revert when run in network loom_dapp_chainError: Number can only safely store up to 53 bits
in truffle 5.0.0 -> 5.0.24
Loom using web3js 1.0.0
goto loom console
yarn truffle console --network loom_dapp_chain
truffle >=5.0.0 using [email protected]
run
DappToken.deployed().then((instance) => {tokenInstance = instance})
after deploy contract seaching **class_defaults** by command `tokenInstance` this address holding all token :
class_defaults:
{ from: '0x917b7288EAe1bBE3b08d5503A209fcf8106D341d',
gas: 6721975,
gasPrice: 20000000000 },testing transfer
tokenInstance.transfer(account2.address , 1, {from : account1})
errer with
tokenInstance.approve(spendingAccount.address, 10 ,{from : fromAccount.address});
**Thrown:**
**Error: Failed to commit Tx: invalid public key leght**