- In a truffle based project, add
@chainsafe/truffle-plugin-abigen
npm i --save @chainsafe/truffle-plugin-abigen
- then in truffle-config, add the plugin
plugins: ["@chainsafe/truffle-plugin-abigen"],
compilers: {
...
- now you run
truffle run abigen
- then use the script i added in this repo,
generate.js
, thename
field is the name of your contract - Find the generated go files in
custom_contracts
directory
getting the abigen version of defi contracts is a pain - but i already did it for you
aave, compound, plain erc20, uniswap, chainlink price feed
Example included shows how to watch for aave flashloans