Coin Contract
The Coin contract implements an ERC20 stablecoin with additional functionality for the Monolith protocol. Contract implementationConstructor
_minter: Address authorized to mint new tokens (Lender.sol)name: ERC20 token name (e.g., “USD Coin”)symbol: ERC20 token symbol (e.g., “USDC”)
User-Facing Functions
mint
to: Address to receive the minted tokensamount: Amount of tokens to mint (in wei, 18 decimals)
msg.sendermust be the minter address (Lender.sol).
Transfer(address(0), to, amount)
burn
amount: Amount of tokens to burn from caller’s balance
- Caller must have sufficient balance (
balanceOf(msg.sender) >= amount)
Transfer(msg.sender, address(0), amount)
transfer
to: Recipient addressamount: Amount of tokens to transfer
bool: Always returns true on successful transfer
- Caller must have sufficient balance
Transfer(msg.sender, to, amount)
transferFrom
from: Address to transfer tokens fromto: Recipient addressamount: Amount of tokens to transfer
bool: Always returns true on successful transfer
frommust have sufficient balance- Caller must have sufficient allowance from
from
Transfer(from, to, amount)
approve
spender: Address authorized to spend tokensamount: Maximum amount spender can transfer
bool: Always returns true on successful approval
Approval(msg.sender, spender, amount)
View Functions
balanceOf
account: Address to query balance for
uint256: Token balance in wei
allowance
owner: Address that granted the allowancespender: Address authorized to spend
uint256: Remaining allowance amount
totalSupply
uint256: Total token supply in wei
name
string: Token name
symbol
string: Token symbol
decimals
uint8: Number of decimals (18 for this token)
minter
address: Minter address
Events
Transfer
from: Sender address (address(0) for mints)to: Recipient address (address(0) for burns)amount: Amount of tokens transferred
Approval
owner: Address granting the allowancespender: Address receiving the allowanceamount: New allowance amount

