Reference
Contracts
Addresses and interfaces of the contracts that LibChain deploys on Lib Testnet.
#Lib Testnet addresses
| Contract | Address | Source |
|---|---|---|
| WtLIB (Wrapped tLIB) | 0x87052f1f17b2b4054b014e93e53d6ce6dc912bdalib1suzj78chk26q2jcpf6f720tvumwfz276ynschv | Verified |
There are no system contracts to call: native tLIB transfers, balances and fees work as on Ethereum.
#WtLIB
| Compiler | Solidity 0.8.28, optimiser on, EVM Cancun |
| Deployed | Block 264, transaction 0x5fccb6104dc463c2c630f60b23f35dfaf66c644d52fae3f8fb5a270ad6e6edab |
| Admin | 0xe9ecb7ee5f9c5c9a8157c2bb615feaa58e6ccfb5 |
#Interface
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
interface IWtLIB {
// ERC-20
function name() external view returns (string memory); // "Wrapped tLIB"
function symbol() external view returns (string memory); // "WtLIB"
function decimals() external view returns (uint8); // 18
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
// Wrapping (sending tLIB to the contract also calls deposit)
function deposit() external payable;
function depositTo(address to) external payable;
function withdraw(uint256 amount) external;
function withdrawTo(address payable to, uint256 amount) external;
// Admin and state
function admin() external view returns (address);
function pendingAdmin() external view returns (address);
function paused() external view returns (bool);
function surplus() external view returns (uint256); // tLIB held above totalSupply
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Deposit(address indexed account, uint256 amount);
event Withdrawal(address indexed account, address indexed to, uint256 amount);
}#Admin functions
pause(), unpause() | Stop or resume deposits and transfers. Withdrawals always work |
transferAdmin(address), acceptAdmin() | Two-step handover of the admin role |
renounceAdmin() | Give up the role for good |
recoverTokens(token, to, amount) | Return other ERC-20 tokens sent to the contract by mistake |
sweepSurplus(to) | Move only the tLIB above totalSupply; the backing can't be touched |
#Errors
The contract reverts with custom errors: IsPaused, InsufficientBalance, InsufficientAllowance, ZeroAddress, NativeTransferFailed, NotAdmin, NotPendingAdmin, NoSurplus, TokenTransferFailed, Reentrancy.