Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ethereum-input-data-decoder

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ethereum-input-data-decoder - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

14

package.json
{
"name": "ethereum-input-data-decoder",
"version": "0.0.1",
"version": "0.0.2",
"description": "Ethereum smart contract transaction input data decoder",

@@ -9,3 +9,3 @@ "main": "index.js",

},
"repository": {
"repository": {
"type": "git",

@@ -22,3 +22,13 @@ "url": "https://github.com/miguelmota/ethereum-input-data-decoder"

"ethereumjs-abi": "^0.6.4"
},
"keywords": [
"ethereum",
"decoder",
"abi",
"smart",
"contracts"
],
"devDependencies": {
"tape": "^4.6.3"
}
}

40

README.md

@@ -15,3 +15,3 @@ # Ethereum input data decoder

Pass decoder ABI file path to constructor:
Pass [ABI](https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI) file path to decoder constructor:

@@ -30,6 +30,9 @@ ```javascript

[example abi](./test/abi.json)
Then you can decode input data:
```javascript
const data = `0x67043cae0000000000000000000000005a9dac9315fdd1c...`;
const data = `0x67043cae0000000000000000000000005a9dac9315fdd1c3d13ef8af7fdfeb522db08f020000000000000000000000000000000000000000000000000000000058a20230000000000000000000000000000000000000000000000000000000000040293400000000000000000000000000000000000000000000000000000000000000a0f3df64775a2dfb6bc9e09dced96d0816ff5055bf95da13ce5b6c3f53b97071c800000000000000000000000000000000000000000000000000000000000000034254430000000000000000000000000000000000000000000000000000000000`;
const result = decoder.decodeData(data);

@@ -40,25 +43,30 @@

```js
```text
{
"name": "registerOffChainDonation",
"types": [
"address",
"uint256",
"uint256",
"string",
"bytes32"
"name": "registerOffChainDonation",
"types": [
"address",
"uint256",
"uint256",
"string",
"bytes32"
],
"inputs": [
<BN: 5a9dac9315fdd1c3d13ef8af7fdfeb522db08f02>,
<BN: 58a20230>,
<BN: 402934>,
"BTC",
<Buffer f3 df ... 71 c8>
<BN: 5a9dac9315fdd1c3d13ef8af7fdfeb522db08f02>,
<BN: 58a20230>,
<BN: 402934>,
"BTC",
<Buffer f3 df ... 71 c8>
]
}
```
Example input data from [this transaction](https://etherscan.io/tx/0xa6f019f2fc916bd8df607f1c99148ebb06322999ff08bc88927fe8406acae1b2).
## Test
```bash
npm test
```
## License
MIT

@@ -1,2 +0,1171 @@

[{"constant":false,"inputs":[{"name":"newAddr","type":"address"}],"name":"setFoundationWallet","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalUnrestrictedAssignments","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"getState","outputs":[{"name":"","type":"uint8"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"round0StartTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"round0Target","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"minDonation","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"weiDonated","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"x","type":"uint256"},{"name":"a","type":"uint256"},{"name":"b","type":"uint256"}],"name":"multFracCeiling","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalRestrictedTokens","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"round1BonusSteps","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newAuth","type":"address"}],"name":"setExchangeRateAuth","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"round1StartTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"round1EndTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"maxRoundDelay","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"n","type":"uint256"}],"name":"getPhaseStartTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"time","type":"uint256"}],"name":"getMultiplierAtTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"id","type":"uint256"}],"name":"targetReached","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"}],"name":"finalize","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"assignmentsClosed","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"donorList","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"phaseLength","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"},{"name":"timestamp","type":"uint256"},{"name":"chfCents","type":"uint256"},{"name":"currency","type":"string"},{"name":"memo","type":"bytes32"}],"name":"registerOffChainDonation","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"gracePeriodAfterRound1Target","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalRestrictedAssignments","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"burnMultNom","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"foundationWallet","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"gracePeriodAfterRound0Target","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"finalizeStartTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"finalizeEndTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"donationRound","type":"uint256"},{"name":"dfnAddr","type":"address"},{"name":"fwdAddr","type":"address"}],"name":"getStatus","outputs":[{"name":"currentState","type":"uint8"},{"name":"fxRate","type":"uint256"},{"name":"currentMultiplier","type":"uint256"},{"name":"donationCount","type":"uint256"},{"name":"totalTokenAmount","type":"uint256"},{"name":"startTime","type":"uint256"},{"name":"endTime","type":"uint256"},{"name":"isTargetReached","type":"bool"},{"name":"chfCentsDonated","type":"uint256"},{"name":"tokenAmount","type":"uint256"},{"name":"fwdBalance","type":"uint256"},{"name":"donated","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"burnMultDen","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"donPhase","type":"uint256"},{"name":"timedelta","type":"uint256"}],"name":"delayDonPhase","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"round1Target","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"earlyContribList","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"round0EndTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"isUnrestricted","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"restrictions","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"earlyContribShare","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"target","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newAuth","type":"address"}],"name":"setRegistrarAuth","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalUnrestrictedTokens","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"weiPerCHF","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"elapsedTime","type":"uint256"}],"name":"getStepFunction","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"exchangeRateAuth","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"counter","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"masterAuth","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"time","type":"uint256"},{"name":"n","type":"uint256"}],"name":"isPhase","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"registrarAuth","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"restrictedShare","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"tokensPerCHF","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"round1InitialBonus","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"weis","type":"uint256"}],"name":"setWeiPerCHF","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"N","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"},{"name":"checksum","type":"bytes4"}],"name":"donateAsWithChecksum","outputs":[{"name":"","type":"bool"}],"payable":true,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"phaseEndTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"},{"name":"restricted","type":"bool"}],"name":"isRegistered","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"maxDelay","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newAuth","type":"address"}],"name":"setMasterAuth","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"step","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"tokens","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"time","type":"uint256"}],"name":"getPhaseAtTime","outputs":[{"name":"n","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"round0Bonus","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"empty","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"nSteps","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"},{"name":"tokenAmount","type":"uint256"},{"name":"memo","type":"bytes32"}],"name":"registerEarlyContrib","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalWeiDonated","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"millionInCents","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"inputs":[{"name":"_masterAuth","type":"address"},{"name":"_name","type":"string"}],"payable":false,"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"addr","type":"address"},{"indexed":true,"name":"currency","type":"string"},{"indexed":true,"name":"bonusMultiplierApplied","type":"uint256"},{"indexed":false,"name":"timestamp","type":"uint256"},{"indexed":false,"name":"tokenAmount","type":"uint256"},{"indexed":false,"name":"memo","type":"bytes32"}],"name":"DonationReceipt","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"addr","type":"address"},{"indexed":false,"name":"tokenAmount","type":"uint256"},{"indexed":false,"name":"memo","type":"bytes32"}],"name":"EarlyContribReceipt","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"addr","type":"address"},{"indexed":false,"name":"tokenAmountBurned","type":"uint256"}],"name":"BurnReceipt","type":"event"}]
[
{
"constant": false,
"inputs": [
{
"name": "newAddr",
"type": "address"
}
],
"name": "setFoundationWallet",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "name",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "totalUnrestrictedAssignments",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getState",
"outputs": [
{
"name": "",
"type": "uint8"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "round0StartTime",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "round0Target",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "minDonation",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "weiDonated",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "x",
"type": "uint256"
},
{
"name": "a",
"type": "uint256"
},
{
"name": "b",
"type": "uint256"
}
],
"name": "multFracCeiling",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "totalRestrictedTokens",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "round1BonusSteps",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "newAuth",
"type": "address"
}
],
"name": "setExchangeRateAuth",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "round1StartTime",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "round1EndTime",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "maxRoundDelay",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "n",
"type": "uint256"
}
],
"name": "getPhaseStartTime",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "time",
"type": "uint256"
}
],
"name": "getMultiplierAtTime",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "id",
"type": "uint256"
}
],
"name": "targetReached",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "addr",
"type": "address"
}
],
"name": "finalize",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "assignmentsClosed",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "donorList",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "phaseLength",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "addr",
"type": "address"
},
{
"name": "timestamp",
"type": "uint256"
},
{
"name": "chfCents",
"type": "uint256"
},
{
"name": "currency",
"type": "string"
},
{
"name": "memo",
"type": "bytes32"
}
],
"name": "registerOffChainDonation",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "gracePeriodAfterRound1Target",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "totalRestrictedAssignments",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "burnMultNom",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "foundationWallet",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "gracePeriodAfterRound0Target",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "finalizeStartTime",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "finalizeEndTime",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "donationRound",
"type": "uint256"
},
{
"name": "dfnAddr",
"type": "address"
},
{
"name": "fwdAddr",
"type": "address"
}
],
"name": "getStatus",
"outputs": [
{
"name": "currentState",
"type": "uint8"
},
{
"name": "fxRate",
"type": "uint256"
},
{
"name": "currentMultiplier",
"type": "uint256"
},
{
"name": "donationCount",
"type": "uint256"
},
{
"name": "totalTokenAmount",
"type": "uint256"
},
{
"name": "startTime",
"type": "uint256"
},
{
"name": "endTime",
"type": "uint256"
},
{
"name": "isTargetReached",
"type": "bool"
},
{
"name": "chfCentsDonated",
"type": "uint256"
},
{
"name": "tokenAmount",
"type": "uint256"
},
{
"name": "fwdBalance",
"type": "uint256"
},
{
"name": "donated",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "burnMultDen",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "donPhase",
"type": "uint256"
},
{
"name": "timedelta",
"type": "uint256"
}
],
"name": "delayDonPhase",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "round1Target",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "earlyContribList",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "round0EndTime",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "isUnrestricted",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "restrictions",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "earlyContribShare",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "target",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "newAuth",
"type": "address"
}
],
"name": "setRegistrarAuth",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "totalUnrestrictedTokens",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "weiPerCHF",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "elapsedTime",
"type": "uint256"
}
],
"name": "getStepFunction",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "exchangeRateAuth",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "counter",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "masterAuth",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "time",
"type": "uint256"
},
{
"name": "n",
"type": "uint256"
}
],
"name": "isPhase",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "registrarAuth",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "restrictedShare",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "tokensPerCHF",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "round1InitialBonus",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "weis",
"type": "uint256"
}
],
"name": "setWeiPerCHF",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "N",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "addr",
"type": "address"
},
{
"name": "checksum",
"type": "bytes4"
}
],
"name": "donateAsWithChecksum",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": true,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "phaseEndTime",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "addr",
"type": "address"
},
{
"name": "restricted",
"type": "bool"
}
],
"name": "isRegistered",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "maxDelay",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "newAuth",
"type": "address"
}
],
"name": "setMasterAuth",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "step",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "tokens",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "time",
"type": "uint256"
}
],
"name": "getPhaseAtTime",
"outputs": [
{
"name": "n",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "round0Bonus",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "empty",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "nSteps",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "addr",
"type": "address"
},
{
"name": "tokenAmount",
"type": "uint256"
},
{
"name": "memo",
"type": "bytes32"
}
],
"name": "registerEarlyContrib",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "totalWeiDonated",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "millionInCents",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"inputs": [
{
"name": "_masterAuth",
"type": "address"
},
{
"name": "_name",
"type": "string"
}
],
"payable": false,
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "addr",
"type": "address"
},
{
"indexed": true,
"name": "currency",
"type": "string"
},
{
"indexed": true,
"name": "bonusMultiplierApplied",
"type": "uint256"
},
{
"indexed": false,
"name": "timestamp",
"type": "uint256"
},
{
"indexed": false,
"name": "tokenAmount",
"type": "uint256"
},
{
"indexed": false,
"name": "memo",
"type": "bytes32"
}
],
"name": "DonationReceipt",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "addr",
"type": "address"
},
{
"indexed": false,
"name": "tokenAmount",
"type": "uint256"
},
{
"indexed": false,
"name": "memo",
"type": "bytes32"
}
],
"name": "EarlyContribReceipt",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "addr",
"type": "address"
},
{
"indexed": false,
"name": "tokenAmountBurned",
"type": "uint256"
}
],
"name": "BurnReceipt",
"type": "event"
}
]

@@ -5,4 +5,9 @@ const fs = require('fs');

/*
* Example input data from this transaction
* https://etherscan.io/tx/0xa6f019f2fc916bd8df607f1c99148ebb06322999ff08bc88927fe8406acae1b2)
*/
test('decoder', t => {
const data = `0x67043cae0000000000000000000000005a9dac9315fdd1c3d13ef8af7fdfeb522db08f020000000000000000000000000000000000000000000000000000000058a20230000000000000000000000000000000000000000000000000000000000040293400000000000000000000000000000000000000000000000000000000000000a0f3df64775a2dfb6bc9e09dced96d0816ff5055bf95da13ce5b6c3f53b97071c800000000000000000000000000000000000000000000000000000000000000034254430000000000000000000000000000000000000000000000000000000000`
const data = `0x67043cae0000000000000000000000005a9dac9315fdd1c3d13ef8af7fdfeb522db08f020000000000000000000000000000000000000000000000000000000058a20230000000000000000000000000000000000000000000000000000000000040293400000000000000000000000000000000000000000000000000000000000000a0f3df64775a2dfb6bc9e09dced96d0816ff5055bf95da13ce5b6c3f53b97071c800000000000000000000000000000000000000000000000000000000000000034254430000000000000000000000000000000000000000000000000000000000`;

@@ -9,0 +14,0 @@ t.test(`abi filepath`, t => {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc