5.1 Asset-Balance
Contract Interface
1
event GenesisBalance(address indexed user, bytes32 indexed tokenId, uint balance);
2
event BalanceChange(address indexed user, bytes32 indexed tokenId, uint balance);
3
event Transfer(address indexed fromAddr, address indexed toAddr, bytes32 indexed tokenId, uint amount);
4
event CancelTransfer(address indexed fromAddr, address indexed toAddr, bytes32 indexed tokenId, uint balance);
5
event Deposit(address peggingContract, bytes32 tokenId, address toAddr, uint amount);
6
event Withdraw(address peggingContract, bytes32 tokenId, address user, address extraUser, bytes destination, uint amount, bytes comment, uint withdrawId, uint feeAmount);
7
event GiveBack(address peggingContract, bytes32 tokenId, address user, address extraUser, uint amount, uint feeAmount, uint networkFee, uint backAmount);
8
9
mapping (bytes32 => address) public peggingContracts;
10
mapping (bytes32 => bytes32) public tokenIdToSummary;
11
mapping (bytes32 => uint) public decimals;
12
mapping (bytes32 => bool) public isValidToken;
13
mapping (bytes32 => mapping (address => uint)) public balanceOf;
14
mapping (address => bool) public isValidPeggingContract;
15
mapping (bytes32 => bool) public isUsedTransfer;
16
mapping (bytes32 => bool) public isUsedWithdraw;
17
mapping (address => bool) public userTransferable;
18
mapping (bytes32 => uint) public withdrawFee;
19
20
bool public defaultTransferable;
21
uint public withdrawCount = 0;
22
address public feeGovernance;
23
24
function deposit(bytes32 tokenSummary, address toAddr, uint amount) public
25
function deposit(bytes32 tokenSummary, address toAddr, uint amount, address extraToAddr) public
26
function giveBack(bytes32 tokenSummary, address toAddr, uint amount, uint networkFee) public
27
function giveBack(bytes32 tokenSummary, address toAddr, uint amount, uint networkFee, address extraToAddr) public
28
function withdraw(bytes32 tokenId, bytes memory destination, uint amount, bytes memory comment) public
29
function withdraw(bytes32 tokenId, address extraUser, bytes memory destination, uint amount, bytes memory comment) public
30
function withdrawBySignature(bytes32[] memory bytes32s, uint[] memory uints, address fromAddr, bytes memory destination, bytes memory comment, uint8 v) public
31
function cancelWithdrawSignature(address fromAddr, bytes32 tokenId, bytes memory destination, uint amount, bytes memory comment, uint expireTime, bytes32 wNonce, uint8 v, bytes32 r, bytes32 s) public
32
function transfer(bytes32 tokenId, address toAddr, uint amount, bool needLog) public
33
function transfer(bytes32 tokenId, address toAddr, uint amount, bool needLog, address extraToAddr) public
34
function transfer(bytes32 tokenId, address toAddr, uint amount, bool needLog, bytes memory data, string memory callMethod) public
35
function transferBySignature(bytes32[] memory bytesArr, address[] memory addrs, uint amount, uint8 v, bool onlyToSpender, bool needLog) public
36
function transferBySignatureWithExtra(bytes32[] memory bytesArr, address[] memory addrs, uint amount, uint8 v, bool onlyToSpender, bool needLog) public
37
function cancelTransferSignature(bytes32[] memory bytesArr, address[] memory addrs, uint amount, uint8 v, bool onlyToSpender) public
38
function cancelTransferSignatureWithExtra(bytes32[] memory bytesArr, address[] memory addrs, uint amount, uint8 v, bool onlyToSpender) public
39
40
function getBalance(bytes32 tokenId, address addr) public view returns(uint)
41
function logBalance(bytes32 tokenId, address addr) public
42
Copied!
Copy link