Skip to content

Instantly share code, notes, and snippets.

@liamaharon
liamaharon / raw-trace-decoder.js
Last active January 8, 2020 04:00
wip internal tx decoding
function deriveGas(stack) {
const gasHexString = stack[stack.length - 1]
return parseInt(gasHexString, 16)
}
function deriveAddress(stack) {
const addressRaw = stack[stack.length - 2]
return `0x${addressRaw.slice(24)}`
}

Keybase proof

I hereby claim:

  • I am liamaharon on github.
  • I am liamaharon (https://keybase.io/liamaharon) on keybase.
  • I have a public key ASC3FFwcnzem8nxxdiIMpvlgchawitf-50xkOObMMkSOAQo

To claim this, I am signing this object:

@liamaharon
liamaharon / erc20-updated-tests-rmit.js
Created July 17, 2019 01:19
erc20-updated-tests-rmit
const MyERC20 = require('Embark/contracts/MyERC20');
const { toWei } = web3.utils
let accounts;
// For documentation please see https://embark.status.im/docs/contracts_testing.html
config({
//deployment: {
// accounts: [
// // you can configure custom accounts with a custom balance
@liamaharon
liamaharon / tests.js
Created July 17, 2019 01:13
Anton fixed tests
const MyERC20 = require('Embark/contracts/MyERC20');
// const Web3 = require('web3');
// const BigNumber = Web3.BigNumber;
// const BigNumber = require('bn.js');
// const BigNumber = web3.utils.BN; //Ethers.BigNumber;
const BigNumber = web3.utils.BN;
const { toWei } = web3.utils
// const a = Web3.Ethers.BigNumber;
const mlog = require('mocha-logger');
const util = require('util');