Formatting

This commit is contained in:
Mark Spanbroek 2023-07-04 15:44:07 +02:00 committed by markspanbroek
parent 842bf4d0a2
commit d7b7f67afb
1 changed files with 33 additions and 23 deletions

View File

@ -17,7 +17,7 @@ type
spender* {.indexed.}: Address spender* {.indexed.}: Address
value*: UInt256 value*: UInt256
method name*(erc20: Erc20Token): string {.base, contract, view.} method name*(token: Erc20Token): string {.base, contract, view.}
## Returns the name of the token. ## Returns the name of the token.
method symbol*(token: Erc20Token): string {.base, contract, view.} method symbol*(token: Erc20Token): string {.base, contract, view.}
@ -28,25 +28,35 @@ method decimals*(token: Erc20Token): uint8 {.base, contract, view.}
## For example, if `decimals` equals `2`, a balance of `505` tokens should ## For example, if `decimals` equals `2`, a balance of `505` tokens should
## be displayed to a user as `5.05` (`505 / 10 ** 2`). ## be displayed to a user as `5.05` (`505 / 10 ** 2`).
method totalSupply*(erc20: Erc20Token): UInt256 {.base, contract, view.} method totalSupply*(token: Erc20Token): UInt256 {.base, contract, view.}
## Returns the amount of tokens in existence. ## Returns the amount of tokens in existence.
method balanceOf*(erc20: Erc20Token, account: Address): UInt256 {.base, contract, view.} method balanceOf*(token: Erc20Token,
account: Address): UInt256 {.base, contract, view.}
## Returns the amount of tokens owned by `account`. ## Returns the amount of tokens owned by `account`.
method allowance*(erc20: Erc20Token, owner, spender: Address): UInt256 {.base, contract, view.} method allowance*(token: Erc20Token,
owner: Address,
spender: Address): UInt256 {.base, contract, view.}
## Returns the remaining number of tokens that `spender` will be allowed ## Returns the remaining number of tokens that `spender` will be allowed
## to spend on behalf of `owner` through {transferFrom}. This is zero by default. ## to spend on behalf of `owner` through {transferFrom}. This is zero by
## default.
## ##
## This value changes when {approve} or {transferFrom} are called. ## This value changes when {approve} or {transferFrom} are called.
method transfer*(erc20: Erc20Token, recipient: Address, amount: UInt256) {.base, contract.} method transfer*(token: Erc20Token,
recipient: Address,
amount: UInt256) {.base, contract.}
## Moves `amount` tokens from the caller's account to `recipient`. ## Moves `amount` tokens from the caller's account to `recipient`.
method approve*(token: Erc20Token, spender: Address, amount: UInt256) {.base, contract.} method approve*(token: Erc20Token,
spender: Address,
amount: UInt256) {.base, contract.}
## Sets `amount` as the allowance of `spender` over the caller's tokens. ## Sets `amount` as the allowance of `spender` over the caller's tokens.
method transferFrom*(erc20: Erc20Token, spender: Address, recipient: Address, amount: UInt256) {.base, contract.} method transferFrom*(token: Erc20Token,
spender: Address,
recipient: Address,
amount: UInt256) {.base, contract.}
## Moves `amount` tokens from `from` to `to` using the allowance ## Moves `amount` tokens from `from` to `to` using the allowance
## mechanism. `amount` is then deducted from the caller's allowance. ## mechanism. `amount` is then deducted from the caller's allowance.