Skip to content

Instantly share code, notes, and snippets.

@viraj124
Created December 21, 2019 06:43
Show Gist options
  • Save viraj124/3a5ba679dbc93f8cda3bb6e3d3608423 to your computer and use it in GitHub Desktop.
Save viraj124/3a5ba679dbc93f8cda3bb6e3d3608423 to your computer and use it in GitHub Desktop.
async loadBlockchainData() {
const web3 = window.web3
var instaKyberABI = { // compound connnector mint/deposit ABI
constant: false,
inputs: [
{
name: "src",
type: "address"
},
{
name: "dest",
type: "address"
},
{
name: "srcAmt",
type: "uint"
},
{
name: "maxDestAmt",
type: "uint"
},
{
name: "slippageRate",
type: "uint"
}
],
name: "buy",
outputs: [
{
name: "destAmt",
type: "uint"
}
],
payable: true,
stateMutability: "payable",
type: "function"
};
var args = [
'0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee',
'0xDb0040451F373949A4Be60dcd7b6B8D6E42658B6',
"100000000000000000",
"1000000000000000000000",
1 // Amount you want to deposit in wei
]
const data = await web3.eth.abi.encodeFunctionCall(instaKyberABI, args)
console.log(data)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment