Skip to content

Instantly share code, notes, and snippets.

@mariano-aguero
Created April 20, 2020 17:04
Show Gist options
  • Save mariano-aguero/bc70f23ff8eaa453c2c9b888d07676c3 to your computer and use it in GitHub Desktop.
Save mariano-aguero/bc70f23ff8eaa453c2c9b888d07676c3 to your computer and use it in GitHub Desktop.
FA 1.2 entry points
function main (const action : tokenAction ; const store : store) : return is
block {
if amount =/= 0tz then failwith ("This contract do not accept token amount");
else skip;
} with case action of
GetAllowance(n) -> allowance(n.0, n.1, n.2, store)
| Transfer(n) -> transfer(n.0, n.1, n.2, store)
| Approve(n) -> approve(n.0, n.1, store)
| GetBalance(n) -> balanceOf(n.0, n.1, store)
| GetTotalSupply(n) -> totalSupply(n.1, store)
| Mint(n) -> mint(n, store)
| Burn(n) -> burn(n, store)
| Decimals(n) -> decimals(n.1, store)
| Symbol(n) -> symbol(n.1, store)
| Name(n) -> name(n.1, store)
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment