Asset
Contract presenting LP tokens in a pool.
contracts/wombat-core/asset/Asset.sol
Title: Asset
Notice: Contract presenting an asset in a pool
Details: Expect to be owned by Timelock for management, and pool links to Pool for coordination
constructor(underlyingToken_, name_, symbol_)
Arguments
name | type | description |
underlyingToken_ | address | |
name_ | string | |
symbol_ | string | |
***Asset.Approval(owner, spender, value) ***
Arguments
name | type | description |
owner | address | indexed |
spender | address | indexed |
value | uint256 | not indexed |
***Asset.OwnershipTransferred(previousOwner, newOwner) ***
Arguments
name | type | description |
previousOwner | address | indexed |
newOwner | address | indexed |
***Asset.SetMaxSupply(previousMaxSupply, newMaxSupply) ***
Notice: An event thats emitted when max supply is updated
Arguments
name | type | description |
previousMaxSupply | uint256 | not indexed |
newMaxSupply | uint256 | not indexed |
***Asset.SetPool(previousPoolAddr, newPoolAddr) ***
Notice: An event thats emitted when pool address is updated
Arguments
name | type | description |
previousPoolAddr | address | not indexed |
newPoolAddr | address | not indexed |
***Asset.Transfer(from, to, value) ***
Arguments
name | type | description |
from | address | indexed |
to | address | indexed |
value | uint256 | not indexed |
Asset.cash() view
Notice: Cash balance, normally it should align with IERC20(underlyingToken).balanceOf(address(this))
Details: 18.18 fixed point decimals
Outputs
name | type | description |
| uint120 | |
Asset.liability() view
Notice: Total liability, equals to the sum of deposit and dividend
Details: 18.18 fixed point decimals
Outputs
name | type | description |
| uint120 | |
Asset.maxSupply() view
Notice: maxSupply the maximum amount of asset the pool is allowed to mint. The unit is the same as the underlying token
Details: if 0, means asset has no max
Outputs
name | type | description |
| uint256 | |
Asset.DOMAIN_SEPARATOR() view
Details: See {IERC20Permit-DOMAIN_SEPARATOR}.
Outputs
name | type | description |
| bytes32 | |
***Asset.addCash(amount) ***
Notice: Adds cash, expects actual ERC20 underlyingToken got transferred in. Can only be called by Pool.
Arguments
name | type | description |
amount | uint256 | amount to add |
***Asset.addLiability(amount) ***
Notice: Adds deposit or dividend, expect LP underlyingToken minted in case of deposit. Can only be called by Pool.
Arguments
name | type | description |
amount | uint256 | amount to add |
Asset.allowance(owner, spender) view
Details: See {IERC20-allowance}.
Arguments
name | type | description |
owner | address | |
spender | address | |
Outputs
name | type | description |
| uint256 | |
***Asset.approve(spender, amount) ***
Details: See {IERC20-approve}. Requirements: -spender
cannot be the zero address.
Arguments
name | type | description |
spender | address | |
amount | uint256 | |
Outputs
name | type | description |
| bool | |
Asset.balanceOf(account) view
Details: See {IERC20-balanceOf}.
Arguments
name | type | description |
account | address | |
Outputs
name | type | description |
| uint256 | |
***Asset.burn(to, amount) ***
Notice: Burn ERC20 Asset LP Token, expect pool coordinates other state updates. Can only be called by Pool.
Arguments
name | type | description |
to | address | address holding the tokens |
amount | uint256 | amount to burn |
Asset.decimals() view
Notice: Returns the decimals of Asset, fixed to 18 decimals
Outputs
name | type | description |
| uint8 | decimals for asset |
***Asset.decreaseAllowance(spender, subtractedValue) ***
Details: Atomically decreases the allowance granted tospender
by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: -spender
cannot be the zero address. -spender
must have allowance for the caller of at leastsubtractedValue
.
Arguments
name | type | description |
spender | address | |
subtractedValue | uint256 | |
Outputs
name | type | description |
| bool | |
***Asset.increaseAllowance(spender, addedValue) ***
Details: Atomically increases the allowance granted tospender
by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: -spender
cannot be the zero address.
Arguments
name | type | description |
spender | address | |
addedValue | uint256 | |
Outputs
name | type | description |
| bool | |
***Asset.mint(to, amount) ***
Notice: Mint ERC20 Asset LP Token, expect pool coordinates other state updates. Can only be called by Pool.
Arguments
name | type | description |
to | address | address to transfer the token to |
amount | uint256 | amount to transfer |
Asset.name() view
Details: Returns the name of the token.
Outputs
name | type | description |
| string | |
Asset.nonces(owner) view
Details: See {IERC20Permit-nonces}.
Arguments
name | type | description |
owner | address | |
Outputs
name | type | description |
| uint256 | |
Asset.owner() view
Details: Returns the address of the current owner.
Outputs
name | type | description |
| address | |
***Asset.permit(owner, spender, value, deadline, v, r, s) ***
Details: See {IERC20Permit-permit}.
Arguments
name | type | description |
owner | address | |
spender | address | |
value | uint256 | |
deadline | uint256 | |
v | uint8 | |
r | bytes32 |