https://github.com/gettocat/smart-contract-analyzer
Pure js smart contract analyzer
https://github.com/gettocat/smart-contract-analyzer
Last synced: 2 months ago
JSON representation
Pure js smart contract analyzer
- Host: GitHub
- URL: https://github.com/gettocat/smart-contract-analyzer
- Owner: gettocat
- License: mit
- Created: 2021-12-16T08:53:52.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-12-16T13:34:57.000Z (over 3 years ago)
- Last Synced: 2024-10-05T22:04:13.275Z (8 months ago)
- Language: JavaScript
- Size: 15.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# smart-contract-analyzer
Pure js smart contract analyzer## install
```
cd package
npm install
```## usage
```js
const { SmartContract } = require('./package');let contract = new SmartContract(Buffer.from(initialcode, 'hex'));
contract.deploy(['constructorParam1', 'constructorParam2', 'etc...'], {
'callvalue': 0
})//console.log(contract.state.hrs()) //contains state after deploy
//console.log(contract.binary) // contains code after deploylet methodName = 'ae42e951';
let methodParams = [2, 5];
let newstate = contract.call(methodName, methodParams, {//
'callvalue': 0
});//console.log(newstate.state.hrs())//contains state after method call
//console.log(newstate.return)//containts return data//let res = contract.callStatic(methodName, methodParams, {//also you can make static call
// 'callvalue': 0
//});
//res.return //return of this method call```
## Disclamer
This is not final code, it is not worked for ERC20, need to be tested for all operations in ./state.js file. TODO.