BS / src / contracts / Readme.md
Readme.md
Raw

What

Binding contracts to golang modules are done here

How

abigen --abi erc1155/ERC1155.abi --out erc1155.go --pkg contracts -type ERC1155

solc erc20.sol --abi -o erc20 && \
    abigen --abi erc20/ERC20.abi --out erc20.go --pkg contracts --type ERC20
☁  erc20 [dev] ⚡  solc erc20.sol  --overwrite --abi -o ./
Compiler run successful. Artifact(s) can be found in directory "./".
☁  erc20 [dev] ⚡  abigen --abi ERC20.abi --out ../erc20.go --pkg contracts --type ERC20

LP tokens

AMM V2

Uniswap V2 based tokens emit following :

  • Swap :
    emit Swap(msg.sender, amount0In, amount1In, amount0Out, amount1Out, to);
    
  • Mint - LP :
    event Mint(address indexed sender, uint amount0, uint amount1);
    
  • Burn - LP :
    event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
    
  • PairCreated - Factory:
    emit PairCreated(token0, token1, pair, allPairs.length);