cryptofinlabs / canoe-solidity Goto Github PK
View Code? Open in Web Editor NEWLightweight Javascript library for decoding constructor arguments.
License: MIT License
Lightweight Javascript library for decoding constructor arguments.
License: MIT License
没有 python版本么
Hola
let input_data = `0x7ff36ab500000000000000000000000000000000000000000073ef44020e785db242c9dd000000000000000000000000000000000000000000000000000000000000008000000000000000000000000060675dbb66f2c58b5ab07cdc7b034b95c59289090000000000000000000000000000000000000000000000000000000061e1cd290000000000000000000000000000000000000000000000000000000000000002000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c0000000000000000000000007fb4ed1b35d8f8638056913bece78b8cd624ca0d`;
input_data = `0x791ac9470000000000000000000000000000000000000000fa5b5c2d729d7c8dade400000000000000000000000000000000000000000000000000000134ee686ef3ef3100000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000f72efb028dd54e3d9238bcd006965a8f65c128240000000000000000000000000000000000000000000000000000000061e1f85d0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000a21f043f78f51cabacf84960aaacb7a2f8110b67000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c`;
input_data = input_data.substring(10);
const {decodeConstructorArgs} = require('canoe-solidity');
let abiExample = {
'abi': [
{
"inputs": [
{"internalType": "uint256", "name": "amountOutMin", "type": "uint256"},
{
"internalType": "address[]",
"name": "path",
"type": "address[]"
}, {"internalType": "address", "name": "to", "type": "address"},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
'type': 'constructor'
}
]
};
console.log(decodeConstructorArgs(abiExample.abi, input_data));
error:
UnhandledPromiseRejectionWarning: Error: Number can only safely store up to 53 bits
I would like to use it, but im not sure if its open sourced.
Could you please update repo with license spec?
Value
Balance ₽1000000
input_data 0000000000000000000000000000000000000000000000008ac7230489e8000000000000000000000000000000000000000000000000000118247408147f894800000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000a96bb891ae41a43573094ccfc7040521143ad8c4000000000000000000000000000000000000000000000000000000006245b8e3000000000000000000000000000000000000000000000000000000000000000300000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c0000000000000000000000003810a078aa274ea6d06a480588eff8fe517220a4
Error: Number can only safely store up to 53 bits
at assert (/Users/cayden/node_modules/bn.js/lib/bn.js:6:21)
at BN.toNumber (/Users/cayden/node_modules/bn.js/lib/bn.js:519:7)
at decodeSingle (/Users/cayden/node_modules/ethereumjs-abi/lib/index.js:232:54)
at Function.ABI.rawDecode (/Users/cayden/node_modules/ethereumjs-abi/lib/index.js:390:19)
at decodeConstructorArgs (/Users/cayden/node_modules/canoe-solidity/index.js:42:21)
at Timeout._onTimeout (/Users/cayden/Documents/code/node/bsc-monitor/test_bsc.js:826:33)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
Hi, I am trying to use the decodeFunctionArgs but it was returning TypeError: decodeFunctionArgs is not a function
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.