Other smart contracts can mint and burn tokens. Each action issues an actionId
for tracking.
address wrappedUSDC = 0x03297A859fc70889E6132b6be9DD31c1d3edb9c7;
uint256 vetValue = 1000 ether; // equals 1000 VET
// initiate mint for the given token address
// the value of VET send will be used
bytes32 actionId = IBridge(0xb7A0A71eCb799c87C1eafb7c2946FE80505a3086).mintToken{value: vetValue}(wrappedUSDC);
https://bridge.vet/api/estimate/mint/:tokenAddress/?value=:vetValue
address wrappedUSDC = 0x03297A859fc70889E6132b6be9DD31c1d3edb9c7;
uint256 wrappedAmount = 1000 ether; // equals 1000 wUSDC
// initiate burn for defining given token address and the number of tokens to burn
// an approval to transfer the tokens is required first
IERC20(wrappedUSDC).approve(0xb7A0A71eCb799c87C1eafb7c2946FE80505a3086, wrappedAmount);
bytes32 actionId = IBridge(0xb7A0A71eCb799c87C1eafb7c2946FE80505a3086).burnToken(wrappedUSDC, wrappedAmount);
https://bridge.vet/api/estimate/burn/:tokenAddress/?value=:tokenAmount
actions(actionId)
represent these:https://bridge.vet/api/status/actionId/:actionId
https://bridge.vet/api/status/txId/:txId
pragma solidity >=0.7.0 <0.9.0;
// Address: 0xb7A0A71eCb799c87C1eafb7c2946FE80505a3086
interface IBridge {
// available actions
function mintToken( address token ) external payable returns (bytes32 actionId);
function burnToken( address token, uint256 tokenAmount ) external payable returns (bytes32 actionId);
function cancelAction( bytes32 actionId ) external payable;
// insight
function actions( bytes32 ) external view returns (address user, uint256 value, address token, uint256 tokenAmount, uint256 status, string memory extraData) ;
function openOrPendingActions( uint256 ) external view returns (bytes32 ) ;
function supportedTokens( address ) external view returns (bool ) ;
// tracking status and insights
event BurnFulfillment( bytes32 indexed actionId, address indexed tokenAddress, address indexed minter, uint256 tokenAmount, uint256 value ) ;
event BurnRequest( bytes32 indexed actionId, address indexed tokenAddress, address indexed user, uint256 tokenAmount ) ;
event MintFulfillment( bytes32 indexed actionId, address indexed tokenAddress, address indexed minter, uint256 value, uint256 tokenAmount ) ;
event MintRequest( bytes32 indexed actionId, address indexed tokenAddress, address indexed user, uint256 value ) ;
}