UNPKG

@venusprotocol/governance-contracts

Version:

### Prerequisites

1 lines 448 kB
{"id":"c301652843ee5deb64bb2720564f49d0","_format":"hh-sol-build-info-1","solcVersion":"0.5.16","solcLongVersion":"0.5.16+commit.9c3226ce","input":{"language":"Solidity","sources":{"@venusprotocol/venus-protocol/contracts/Tokens/XVS/XVS.sol":{"content":"pragma solidity ^0.5.16;\n\nimport \"../../Utils/Tokenlock.sol\";\n\ncontract XVS is Tokenlock {\n /// @notice BEP-20 token name for this token\n string public constant name = \"Venus\";\n\n /// @notice BEP-20 token symbol for this token\n string public constant symbol = \"XVS\";\n\n /// @notice BEP-20 token decimals for this token\n uint8 public constant decimals = 18;\n\n /// @notice Total number of tokens in circulation\n uint public constant totalSupply = 30000000e18; // 30 million XVS\n\n /// @notice Allowance amounts on behalf of others\n mapping(address => mapping(address => uint96)) internal allowances;\n\n /// @notice Official record of token balances for each account\n mapping(address => uint96) internal balances;\n\n /// @notice A record of each accounts delegate\n mapping(address => address) public delegates;\n\n /// @notice A checkpoint for marking number of votes from a given block\n struct Checkpoint {\n uint32 fromBlock;\n uint96 votes;\n }\n\n /// @notice A record of votes checkpoints for each account, by index\n mapping(address => mapping(uint32 => Checkpoint)) public checkpoints;\n\n /// @notice The number of checkpoints for each account\n mapping(address => uint32) public numCheckpoints;\n\n /// @notice The EIP-712 typehash for the contract's domain\n bytes32 public constant DOMAIN_TYPEHASH =\n keccak256(\"EIP712Domain(string name,uint256 chainId,address verifyingContract)\");\n\n /// @notice The EIP-712 typehash for the delegation struct used by the contract\n bytes32 public constant DELEGATION_TYPEHASH =\n keccak256(\"Delegation(address delegatee,uint256 nonce,uint256 expiry)\");\n\n /// @notice A record of states for signing / validating signatures\n mapping(address => uint) public nonces;\n\n /// @notice An event thats emitted when an account changes its delegate\n event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);\n\n /// @notice An event thats emitted when a delegate account's vote balance changes\n event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance);\n\n /// @notice The standard BEP-20 transfer event\n event Transfer(address indexed from, address indexed to, uint256 amount);\n\n /// @notice The standard BEP-20 approval event\n event Approval(address indexed owner, address indexed spender, uint256 amount);\n\n /**\n * @notice Construct a new XVS token\n * @param account The initial account to grant all the tokens\n */\n constructor(address account) public {\n balances[account] = uint96(totalSupply);\n emit Transfer(address(0), account, totalSupply);\n }\n\n /**\n * @notice Get the number of tokens `spender` is approved to spend on behalf of `account`\n * @param account The address of the account holding the funds\n * @param spender The address of the account spending the funds\n * @return The number of tokens approved\n */\n function allowance(address account, address spender) external view returns (uint) {\n return allowances[account][spender];\n }\n\n /**\n * @notice Approve `spender` to transfer up to `amount` from `src`\n * @dev This will overwrite the approval amount for `spender`\n * @param spender The address of the account which may transfer tokens\n * @param rawAmount The number of tokens that are approved (2^256-1 means infinite)\n * @return Whether or not the approval succeeded\n */\n function approve(address spender, uint rawAmount) external validLock returns (bool) {\n uint96 amount;\n if (rawAmount == uint(-1)) {\n amount = uint96(-1);\n } else {\n amount = safe96(rawAmount, \"XVS::approve: amount exceeds 96 bits\");\n }\n\n allowances[msg.sender][spender] = amount;\n\n emit Approval(msg.sender, spender, amount);\n return true;\n }\n\n /**\n * @notice Get the number of tokens held by the `account`\n * @param account The address of the account to get the balance of\n * @return The number of tokens held\n */\n function balanceOf(address account) external view returns (uint) {\n return balances[account];\n }\n\n /**\n * @notice Transfer `amount` tokens from `msg.sender` to `dst`\n * @param dst The address of the destination account\n * @param rawAmount The number of tokens to transfer\n * @return Whether or not the transfer succeeded\n */\n function transfer(address dst, uint rawAmount) external validLock returns (bool) {\n uint96 amount = safe96(rawAmount, \"XVS::transfer: amount exceeds 96 bits\");\n _transferTokens(msg.sender, dst, amount);\n return true;\n }\n\n /**\n * @notice Transfer `amount` tokens from `src` to `dst`\n * @param src The address of the source account\n * @param dst The address of the destination account\n * @param rawAmount The number of tokens to transfer\n * @return Whether or not the transfer succeeded\n */\n function transferFrom(address src, address dst, uint rawAmount) external validLock returns (bool) {\n address spender = msg.sender;\n uint96 spenderAllowance = allowances[src][spender];\n uint96 amount = safe96(rawAmount, \"XVS::approve: amount exceeds 96 bits\");\n\n if (spender != src && spenderAllowance != uint96(-1)) {\n uint96 newAllowance = sub96(\n spenderAllowance,\n amount,\n \"XVS::transferFrom: transfer amount exceeds spender allowance\"\n );\n allowances[src][spender] = newAllowance;\n\n emit Approval(src, spender, newAllowance);\n }\n\n _transferTokens(src, dst, amount);\n return true;\n }\n\n /**\n * @notice Delegate votes from `msg.sender` to `delegatee`\n * @param delegatee The address to delegate votes to\n */\n function delegate(address delegatee) public validLock {\n return _delegate(msg.sender, delegatee);\n }\n\n /**\n * @notice Delegates votes from signatory to `delegatee`\n * @param delegatee The address to delegate votes to\n * @param nonce The contract state required to match the signature\n * @param expiry The time at which to expire the signature\n * @param v The recovery byte of the signature\n * @param r Half of the ECDSA signature pair\n * @param s Half of the ECDSA signature pair\n */\n function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public validLock {\n bytes32 domainSeparator = keccak256(\n abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this))\n );\n bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry));\n bytes32 digest = keccak256(abi.encodePacked(\"\\x19\\x01\", domainSeparator, structHash));\n address signatory = ecrecover(digest, v, r, s);\n require(signatory != address(0), \"XVS::delegateBySig: invalid signature\");\n require(nonce == nonces[signatory]++, \"XVS::delegateBySig: invalid nonce\");\n require(now <= expiry, \"XVS::delegateBySig: signature expired\");\n return _delegate(signatory, delegatee);\n }\n\n /**\n * @notice Gets the current votes balance for `account`\n * @param account The address to get votes balance\n * @return The number of current votes for `account`\n */\n function getCurrentVotes(address account) external view returns (uint96) {\n uint32 nCheckpoints = numCheckpoints[account];\n return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;\n }\n\n /**\n * @notice Determine the prior number of votes for an account as of a block number\n * @dev Block number must be a finalized block or else this function will revert to prevent misinformation.\n * @param account The address of the account to check\n * @param blockNumber The block number to get the vote balance at\n * @return The number of votes the account had as of the given block\n */\n function getPriorVotes(address account, uint blockNumber) public view returns (uint96) {\n require(blockNumber < block.number, \"XVS::getPriorVotes: not yet determined\");\n\n uint32 nCheckpoints = numCheckpoints[account];\n if (nCheckpoints == 0) {\n return 0;\n }\n\n // First check most recent balance\n if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {\n return checkpoints[account][nCheckpoints - 1].votes;\n }\n\n // Next check implicit zero balance\n if (checkpoints[account][0].fromBlock > blockNumber) {\n return 0;\n }\n\n uint32 lower = 0;\n uint32 upper = nCheckpoints - 1;\n while (upper > lower) {\n uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow\n Checkpoint memory cp = checkpoints[account][center];\n if (cp.fromBlock == blockNumber) {\n return cp.votes;\n } else if (cp.fromBlock < blockNumber) {\n lower = center;\n } else {\n upper = center - 1;\n }\n }\n return checkpoints[account][lower].votes;\n }\n\n function _delegate(address delegator, address delegatee) internal {\n address currentDelegate = delegates[delegator];\n uint96 delegatorBalance = balances[delegator];\n delegates[delegator] = delegatee;\n\n emit DelegateChanged(delegator, currentDelegate, delegatee);\n\n _moveDelegates(currentDelegate, delegatee, delegatorBalance);\n }\n\n function _transferTokens(address src, address dst, uint96 amount) internal {\n require(src != address(0), \"XVS::_transferTokens: cannot transfer from the zero address\");\n require(dst != address(0), \"XVS::_transferTokens: cannot transfer to the zero address\");\n\n balances[src] = sub96(balances[src], amount, \"XVS::_transferTokens: transfer amount exceeds balance\");\n balances[dst] = add96(balances[dst], amount, \"XVS::_transferTokens: transfer amount overflows\");\n emit Transfer(src, dst, amount);\n\n _moveDelegates(delegates[src], delegates[dst], amount);\n }\n\n function _moveDelegates(address srcRep, address dstRep, uint96 amount) internal {\n if (srcRep != dstRep && amount > 0) {\n if (srcRep != address(0)) {\n uint32 srcRepNum = numCheckpoints[srcRep];\n uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0;\n uint96 srcRepNew = sub96(srcRepOld, amount, \"XVS::_moveVotes: vote amount underflows\");\n _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);\n }\n\n if (dstRep != address(0)) {\n uint32 dstRepNum = numCheckpoints[dstRep];\n uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0;\n uint96 dstRepNew = add96(dstRepOld, amount, \"XVS::_moveVotes: vote amount overflows\");\n _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);\n }\n }\n }\n\n function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal {\n uint32 blockNumber = safe32(block.number, \"XVS::_writeCheckpoint: block number exceeds 32 bits\");\n\n if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) {\n checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;\n } else {\n checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes);\n numCheckpoints[delegatee] = nCheckpoints + 1;\n }\n\n emit DelegateVotesChanged(delegatee, oldVotes, newVotes);\n }\n\n function safe32(uint n, string memory errorMessage) internal pure returns (uint32) {\n require(n < 2 ** 32, errorMessage);\n return uint32(n);\n }\n\n function safe96(uint n, string memory errorMessage) internal pure returns (uint96) {\n require(n < 2 ** 96, errorMessage);\n return uint96(n);\n }\n\n function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {\n uint96 c = a + b;\n require(c >= a, errorMessage);\n return c;\n }\n\n function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {\n require(b <= a, errorMessage);\n return a - b;\n }\n\n function getChainId() internal pure returns (uint) {\n uint256 chainId;\n assembly {\n chainId := chainid()\n }\n return chainId;\n }\n}\n"},"@venusprotocol/venus-protocol/contracts/Utils/Owned.sol":{"content":"pragma solidity ^0.5.16;\n\ncontract Owned {\n address public owner;\n\n event OwnershipTransferred(address indexed _from, address indexed _to);\n\n constructor() public {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(msg.sender == owner, \"Should be owner\");\n _;\n }\n\n function transferOwnership(address newOwner) public onlyOwner {\n owner = newOwner;\n emit OwnershipTransferred(owner, newOwner);\n }\n}\n"},"@venusprotocol/venus-protocol/contracts/Utils/Tokenlock.sol":{"content":"pragma solidity ^0.5.16;\n\nimport \"./Owned.sol\";\n\ncontract Tokenlock is Owned {\n /// @notice Indicates if token is locked\n uint8 internal isLocked = 0;\n\n event Freezed();\n event UnFreezed();\n\n modifier validLock() {\n require(isLocked == 0, \"Token is locked\");\n _;\n }\n\n function freeze() public onlyOwner {\n isLocked = 1;\n\n emit Freezed();\n }\n\n function unfreeze() public onlyOwner {\n isLocked = 0;\n\n emit UnFreezed();\n }\n}\n"},"contracts/hardhat-dependency-compiler/@venusprotocol/venus-protocol/contracts/Tokens/XVS/XVS.sol":{"content":"// SPDX-License-Identifier: UNLICENSED\npragma solidity >0.0.0;\nimport '@venusprotocol/venus-protocol/contracts/Tokens/XVS/XVS.sol';\n"}},"settings":{"optimizer":{"enabled":true,"runs":200},"outputSelection":{"*":{"*":["storageLayout","abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata","devdoc","userdoc","evm.gasEstimates"],"":["ast"]}},"metadata":{"useLiteralContent":true}}},"output":{"sources":{"@venusprotocol/venus-protocol/contracts/Tokens/XVS/XVS.sol":{"ast":{"absolutePath":"@venusprotocol/venus-protocol/contracts/Tokens/XVS/XVS.sol","exportedSymbols":{"XVS":[969]},"id":970,"nodeType":"SourceUnit","nodes":[{"id":1,"literals":["solidity","^","0.5",".16"],"nodeType":"PragmaDirective","src":"0:24:0"},{"absolutePath":"@venusprotocol/venus-protocol/contracts/Utils/Tokenlock.sol","file":"../../Utils/Tokenlock.sol","id":2,"nodeType":"ImportDirective","scope":970,"sourceUnit":1069,"src":"26:35:0","symbolAliases":[],"unitAlias":""},{"baseContracts":[{"arguments":null,"baseName":{"contractScope":null,"id":3,"name":"Tokenlock","nodeType":"UserDefinedTypeName","referencedDeclaration":1068,"src":"79:9:0","typeDescriptions":{"typeIdentifier":"t_contract$_Tokenlock_$1068","typeString":"contract Tokenlock"}},"id":4,"nodeType":"InheritanceSpecifier","src":"79:9:0"}],"contractDependencies":[1018,1068],"contractKind":"contract","documentation":null,"fullyImplemented":true,"id":969,"linearizedBaseContracts":[969,1068,1018],"name":"XVS","nodeType":"ContractDefinition","nodes":[{"constant":true,"id":7,"name":"name","nodeType":"VariableDeclaration","scope":969,"src":"144:37:0","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_string_memory","typeString":"string"},"typeName":{"id":5,"name":"string","nodeType":"ElementaryTypeName","src":"144:6:0","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"value":{"argumentTypes":null,"hexValue":"56656e7573","id":6,"isConstant":false,"isLValue":false,"isPure":true,"kind":"string","lValueRequested":false,"nodeType":"Literal","src":"174:7:0","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_stringliteral_1a6875e3c24a024aa04a101518d25b2c59648a74ace83f8261f2a8e64025d85b","typeString":"literal_string \"Venus\""},"value":"Venus"},"visibility":"public"},{"constant":true,"id":10,"name":"symbol","nodeType":"VariableDeclaration","scope":969,"src":"239:37:0","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_string_memory","typeString":"string"},"typeName":{"id":8,"name":"string","nodeType":"ElementaryTypeName","src":"239:6:0","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"value":{"argumentTypes":null,"hexValue":"585653","id":9,"isConstant":false,"isLValue":false,"isPure":true,"kind":"string","lValueRequested":false,"nodeType":"Literal","src":"271:5:0","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_stringliteral_76e8c3a4e0bf6a403f16853d9a583f26097ecbfbbc77b1ec65fa370c98b12bf0","typeString":"literal_string \"XVS\""},"value":"XVS"},"visibility":"public"},{"constant":true,"id":13,"name":"decimals","nodeType":"VariableDeclaration","scope":969,"src":"336:35:0","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"},"typeName":{"id":11,"name":"uint8","nodeType":"ElementaryTypeName","src":"336:5:0","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"value":{"argumentTypes":null,"hexValue":"3138","id":12,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"369:2:0","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_18_by_1","typeString":"int_const 18"},"value":"18"},"visibility":"public"},{"constant":true,"id":16,"name":"totalSupply","nodeType":"VariableDeclaration","scope":969,"src":"432:46:0","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":14,"name":"uint","nodeType":"ElementaryTypeName","src":"432:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":{"argumentTypes":null,"hexValue":"3330303030303030653138","id":15,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"467:11:0","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_30000000000000000000000000_by_1","typeString":"int_const 30000000000000000000000000"},"value":"30000000e18"},"visibility":"public"},{"constant":false,"id":22,"name":"allowances","nodeType":"VariableDeclaration","scope":969,"src":"557:66:0","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint96_$_$","typeString":"mapping(address => mapping(address => uint96))"},"typeName":{"id":21,"keyType":{"id":17,"name":"address","nodeType":"ElementaryTypeName","src":"565:7:0","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Mapping","src":"557:46:0","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint96_$_$","typeString":"mapping(address => mapping(address => uint96))"},"valueType":{"id":20,"keyType":{"id":18,"name":"address","nodeType":"ElementaryTypeName","src":"584:7:0","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Mapping","src":"576:26:0","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_uint96_$","typeString":"mapping(address => uint96)"},"valueType":{"id":19,"name":"uint96","nodeType":"ElementaryTypeName","src":"595:6:0","typeDescriptions":{"typeIdentifier":"t_uint96","typeString":"uint96"}}}},"value":null,"visibility":"internal"},{"constant":false,"id":26,"name":"balances","nodeType":"VariableDeclaration","scope":969,"src":"697:44:0","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_uint96_$","typeString":"mapping(address => uint96)"},"typeName":{"id":25,"keyType":{"id":23,"name":"address","nodeType":"ElementaryTypeName","src":"705:7:0","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Mapping","src":"697:26:0","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_uint96_$","typeString":"mapping(address => uint96)"},"valueType":{"id":24,"name":"uint96","nodeType":"ElementaryTypeName","src":"716:6:0","typeDescriptions":{"typeIdentifier":"t_uint96","typeString":"uint96"}}},"value":null,"visibility":"internal"},{"constant":false,"id":30,"name":"delegates","nodeType":"VariableDeclaration","scope":969,"src":"799:44:0","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_address_$","typeString":"mapping(address => address)"},"typeName":{"id":29,"keyType":{"id":27,"name":"address","nodeType":"ElementaryTypeName","src":"807:7:0","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Mapping","src":"799:27:0","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_address_$","typeString":"mapping(address => address)"},"valueType":{"id":28,"name":"address","nodeType":"ElementaryTypeName","src":"818:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}}},"value":null,"visibility":"public"},{"canonicalName":"XVS.Checkpoint","id":35,"members":[{"constant":false,"id":32,"name":"fromBlock","nodeType":"VariableDeclaration","scope":35,"src":"954:16:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint32","typeString":"uint32"},"typeName":{"id":31,"name":"uint32","nodeType":"ElementaryTypeName","src":"954:6:0","typeDescriptions":{"typeIdentifier":"t_uint32","typeString":"uint32"}},"value":null,"visibility":"internal"},{"constant":false,"id":34,"name":"votes","nodeType":"VariableDeclaration","scope":35,"src":"980:12:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint96","typeString":"uint96"},"typeName":{"id":33,"name":"uint96","nodeType":"ElementaryTypeName","src":"980:6:0","typeDescriptions":{"typeIdentifier":"t_uint96","typeString":"uint96"}},"value":null,"visibility":"internal"}],"name":"Checkpoint","nodeType":"StructDefinition","scope":969,"src":"926:73:0","visibility":"public"},{"constant":false,"id":41,"name":"checkpoints","nodeType":"VariableDeclaration","scope":969,"src":"1078:68:0","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_mapping$_t_uint32_$_t_struct$_Checkpoint_$35_storage_$_$","typeString":"mapping(address => mapping(uint32 => struct XVS.Checkpoint))"},"typeName":{"id":40,"keyType":{"id":36,"name":"address","nodeType":"ElementaryTypeName","src":"1086:7:0","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Mapping","src":"1078:49:0","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_mapping$_t_uint32_$_t_struct$_Checkpoint_$35_storage_$_$","typeString":"mapping(address => mapping(uint32 => struct XVS.Checkpoint))"},"valueType":{"id":39,"keyType":{"id":37,"name":"uint32","nodeType":"ElementaryTypeName","src":"1105:6:0","typeDescriptions":{"typeIdentifier":"t_uint32","typeString":"uint32"}},"nodeType":"Mapping","src":"1097:29:0","typeDescriptions":{"typeIdentifier":"t_mapping$_t_uint32_$_t_struct$_Checkpoint_$35_storage_$","typeString":"mapping(uint32 => struct XVS.Checkpoint)"},"valueType":{"contractScope":null,"id":38,"name":"Checkpoint","nodeType":"UserDefinedTypeName","referencedDeclaration":35,"src":"1115:10:0","typeDescriptions":{"typeIdentifier":"t_struct$_Checkpoint_$35_storage_ptr","typeString":"struct XVS.Checkpoint"}}}},"value":null,"visibility":"public"},{"constant":false,"id":45,"name":"numCheckpoints","nodeType":"VariableDeclaration","scope":969,"src":"1212:48:0","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_uint32_$","typeString":"mapping(address => uint32)"},"typeName":{"id":44,"keyType":{"id":42,"name":"address","nodeType":"ElementaryTypeName","src":"1220:7:0","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Mapping","src":"1212:26:0","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_uint32_$","typeString":"mapping(address => uint32)"},"valueType":{"id":43,"name":"uint32","nodeType":"ElementaryTypeName","src":"1231:6:0","typeDescriptions":{"typeIdentifier":"t_uint32","typeString":"uint32"}}},"value":null,"visibility":"public"},{"constant":true,"id":50,"name":"DOMAIN_TYPEHASH","nodeType":"VariableDeclaration","scope":969,"src":"1330:130:0","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":46,"name":"bytes32","nodeType":"ElementaryTypeName","src":"1330:7:0","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"value":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"hexValue":"454950373132446f6d61696e28737472696e67206e616d652c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e747261637429","id":48,"isConstant":false,"isLValue":false,"isPure":true,"kind":"string","lValueRequested":false,"nodeType":"Literal","src":"1390:69:0","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_stringliteral_8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a866","typeString":"literal_string \"EIP712Domain(string name,uint256 chainId,address verifyingContract)\""},"value":"EIP712Domain(string name,uint256 chainId,address verifyingContract)"}],"expression":{"argumentTypes":[{"typeIdentifier":"t_stringliteral_8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a866","typeString":"literal_string \"EIP712Domain(string name,uint256 chainId,address verifyingContract)\""}],"id":47,"name":"keccak256","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1080,"src":"1380:9:0","typeDescriptions":{"typeIdentifier":"t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$","typeString":"function (bytes memory) pure returns (bytes32)"}},"id":49,"isConstant":false,"isLValue":false,"isPure":true,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1380:80:0","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"public"},{"constant":true,"id":55,"name":"DELEGATION_TYPEHASH","nodeType":"VariableDeclaration","scope":969,"src":"1551:125:0","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":51,"name":"bytes32","nodeType":"ElementaryTypeName","src":"1551:7:0","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"value":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"hexValue":"44656c65676174696f6e28616464726573732064656c6567617465652c75696e74323536206e6f6e63652c75696e743235362065787069727929","id":53,"isConstant":false,"isLValue":false,"isPure":true,"kind":"string","lValueRequested":false,"nodeType":"Literal","src":"1615:60:0","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_stringliteral_e48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf","typeString":"literal_string \"Delegation(address delegatee,uint256 nonce,uint256 expiry)\""},"value":"Delegation(address delegatee,uint256 nonce,uint256 expiry)"}],"expression":{"argumentTypes":[{"typeIdentifier":"t_stringliteral_e48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf","typeString":"literal_string \"Delegation(address delegatee,uint256 nonce,uint256 expiry)\""}],"id":52,"name":"keccak256","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":1080,"src":"1605:9:0","typeDescriptions":{"typeIdentifier":"t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$","typeString":"function (bytes memory) pure returns (bytes32)"}},"id":54,"isConstant":false,"isLValue":false,"isPure":true,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1605:71:0","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"public"},{"constant":false,"id":59,"name":"nonces","nodeType":"VariableDeclaration","scope":969,"src":"1754:38:0","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_uint256_$","typeString":"mapping(address => uint256)"},"typeName":{"id":58,"keyType":{"id":56,"name":"address","nodeType":"ElementaryTypeName","src":"1762:7:0","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Mapping","src":"1754:24:0","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_uint256_$","typeString":"mapping(address => uint256)"},"valueType":{"id":57,"name":"uint","nodeType":"ElementaryTypeName","src":"1773:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}},"value":null,"visibility":"public"},{"anonymous":false,"documentation":"@notice An event thats emitted when an account changes its delegate","id":67,"name":"DelegateChanged","nodeType":"EventDefinition","parameters":{"id":66,"nodeType":"ParameterList","parameters":[{"constant":false,"id":61,"indexed":true,"name":"delegator","nodeType":"VariableDeclaration","scope":67,"src":"1897:25:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":60,"name":"address","nodeType":"ElementaryTypeName","src":"1897:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":63,"indexed":true,"name":"fromDelegate","nodeType":"VariableDeclaration","scope":67,"src":"1924:28:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":62,"name":"address","nodeType":"ElementaryTypeName","src":"1924:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":65,"indexed":true,"name":"toDelegate","nodeType":"VariableDeclaration","scope":67,"src":"1954:26:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":64,"name":"address","nodeType":"ElementaryTypeName","src":"1954:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"}],"src":"1896:85:0"},"src":"1875:107:0"},{"anonymous":false,"documentation":"@notice An event thats emitted when a delegate account's vote balance changes","id":75,"name":"DelegateVotesChanged","nodeType":"EventDefinition","parameters":{"id":74,"nodeType":"ParameterList","parameters":[{"constant":false,"id":69,"indexed":true,"name":"delegate","nodeType":"VariableDeclaration","scope":75,"src":"2101:24:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":68,"name":"address","nodeType":"ElementaryTypeName","src":"2101:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":71,"indexed":false,"name":"previousBalance","nodeType":"VariableDeclaration","scope":75,"src":"2127:20:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":70,"name":"uint","nodeType":"ElementaryTypeName","src":"2127:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"},{"constant":false,"id":73,"indexed":false,"name":"newBalance","nodeType":"VariableDeclaration","scope":75,"src":"2149:15:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":72,"name":"uint","nodeType":"ElementaryTypeName","src":"2149:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"src":"2100:65:0"},"src":"2074:92:0"},{"anonymous":false,"documentation":"@notice The standard BEP-20 transfer event","id":83,"name":"Transfer","nodeType":"EventDefinition","parameters":{"id":82,"nodeType":"ParameterList","parameters":[{"constant":false,"id":77,"indexed":true,"name":"from","nodeType":"VariableDeclaration","scope":83,"src":"2238:20:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":76,"name":"address","nodeType":"ElementaryTypeName","src":"2238:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":79,"indexed":true,"name":"to","nodeType":"VariableDeclaration","scope":83,"src":"2260:18:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":78,"name":"address","nodeType":"ElementaryTypeName","src":"2260:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":81,"indexed":false,"name":"amount","nodeType":"VariableDeclaration","scope":83,"src":"2280:14:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":80,"name":"uint256","nodeType":"ElementaryTypeName","src":"2280:7:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"src":"2237:58:0"},"src":"2223:73:0"},{"anonymous":false,"documentation":"@notice The standard BEP-20 approval event","id":91,"name":"Approval","nodeType":"EventDefinition","parameters":{"id":90,"nodeType":"ParameterList","parameters":[{"constant":false,"id":85,"indexed":true,"name":"owner","nodeType":"VariableDeclaration","scope":91,"src":"2368:21:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":84,"name":"address","nodeType":"ElementaryTypeName","src":"2368:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":87,"indexed":true,"name":"spender","nodeType":"VariableDeclaration","scope":91,"src":"2391:23:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":86,"name":"address","nodeType":"ElementaryTypeName","src":"2391:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":89,"indexed":false,"name":"amount","nodeType":"VariableDeclaration","scope":91,"src":"2416:14:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":88,"name":"uint256","nodeType":"ElementaryTypeName","src":"2416:7:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"src":"2367:64:0"},"src":"2353:79:0"},{"body":{"id":112,"nodeType":"Block","src":"2597:113:0","statements":[{"expression":{"argumentTypes":null,"id":102,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":96,"name":"balances","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":26,"src":"2607:8:0","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_uint96_$","typeString":"mapping(address => uint96)"}},"id":98,"indexExpression":{"argumentTypes":null,"id":97,"name":"account","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":93,"src":"2616:7:0","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"2607:17:0","typeDescriptions":{"typeIdentifier":"t_uint96","typeString":"uint96"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":100,"name":"totalSupply","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":16,"src":"2634:11:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":99,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"2627:6:0","typeDescriptions":{"typeIdentifier":"t_type$_t_uint96_$","typeString":"type(uint96)"},"typeName":"uint96"},"id":101,"isConstant":false,"isLValue":false,"isPure":true,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2627:19:0","typeDescriptions":{"typeIdentifier":"t_uint96","typeString":"uint96"}},"src":"2607:39:0","typeDescriptions":{"typeIdentifier":"t_uint96","typeString":"uint96"}},"id":103,"nodeType":"ExpressionStatement","src":"2607:39:0"},{"eventCall":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"arguments":[{"argumentTypes":null,"hexValue":"30","id":106,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"2678:1:0","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"},"value":"0"}],"expression":{"argumentTypes":[{"typeIdentifier":"t_rational_0_by_1","typeString":"int_const 0"}],"id":105,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"2670:7:0","typeDescriptions":{"typeIdentifier":"t_type$_t_address_$","typeString":"type(address)"},"typeName":"address"},"id":107,"isConstant":false,"isLValue":false,"isPure":true,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2670:10:0","typeDescriptions":{"typeIdentifier":"t_address_payable","typeString":"address payable"}},{"argumentTypes":null,"id":108,"name":"account","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":93,"src":"2682:7:0","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"argumentTypes":null,"id":109,"name":"totalSupply","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":16,"src":"2691:11:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address_payable","typeString":"address payable"},{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":104,"name":"Transfer","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":83,"src":"2661:8:0","typeDescriptions":{"typeIdentifier":"t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$","typeString":"function (address,address,uint256)"}},"id":110,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2661:42:0","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":111,"nodeType":"EmitStatement","src":"2656:47:0"}]},"documentation":"@notice Construct a new XVS token\n@param account The initial account to grant all the tokens","id":113,"implemented":true,"kind":"constructor","modifiers":[],"name":"","nodeType":"FunctionDefinition","parameters":{"id":94,"nodeType":"ParameterList","parameters":[{"constant":false,"id":93,"name":"account","nodeType":"VariableDeclaration","scope":113,"src":"2573:15:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":92,"name":"address","nodeType":"ElementaryTypeName","src":"2573:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"}],"src":"2572:17:0"},"returnParameters":{"id":95,"nodeType":"ParameterList","parameters":[],"src":"2597:0:0"},"scope":969,"src":"2561:149:0","stateMutability":"nonpayable","superFunction":null,"visibility":"public"},{"body":{"id":128,"nodeType":"Block","src":"3088:52:0","statements":[{"expression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":122,"name":"allowances","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":22,"src":"3105:10:0","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint96_$_$","typeString":"mapping(address => mapping(address => uint96))"}},"id":124,"indexExpression":{"argumentTypes":null,"id":123,"name":"account","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":115,"src":"3116:7:0","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"3105:19:0","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_uint96_$","typeString":"mapping(address => uint96)"}},"id":126,"indexExpression":{"argumentTypes":null,"id":125,"name":"spender","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":117,"src":"3125:7:0","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"3105:28:0","typeDescriptions":{"typeIdentifier":"t_uint96","typeString":"uint96"}},"functionReturnParameters":121,"id":127,"nodeType":"Return","src":"3098:35:0"}]},"documentation":"@notice Get the number of tokens `spender` is approved to spend on behalf of `account`\n@param account The address of the account holding the funds\n@param spender The address of the account spending the funds\n@return The number of tokens approved","id":129,"implemented":true,"kind":"function","modifiers":[],"name":"allowance","nodeType":"FunctionDefinition","parameters":{"id":118,"nodeType":"ParameterList","parameters":[{"constant":false,"id":115,"name":"account","nodeType":"VariableDeclaration","scope":129,"src":"3025:15:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":114,"name":"address","nodeType":"ElementaryTypeName","src":"3025:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":117,"name":"spender","nodeType":"VariableDeclaration","scope":129,"src":"3042:15:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":116,"name":"address","nodeType":"ElementaryTypeName","src":"3042:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"}],"src":"3024:34:0"},"returnParameters":{"id":121,"nodeType":"ParameterList","parameters":[{"constant":false,"id":120,"name":"","nodeType":"VariableDeclaration","scope":129,"src":"3082:4:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":119,"name":"uint","nodeType":"ElementaryTypeName","src":"3082:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"src":"3081:6:0"},"scope":969,"src":"3006:134:0","stateMutability":"view","superFunction":null,"visibility":"external"},{"body":{"id":184,"nodeType":"Block","src":"3599:332:0","statements":[{"assignments":[141],"declarations":[{"constant":false,"id":141,"name":"amount","nodeType":"VariableDeclaration","scope":184,"src":"3609:13:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint96","typeString":"uint96"},"typeName":{"id":140,"name":"uint96","nodeType":"ElementaryTypeName","src":"3609:6:0","typeDescriptions":{"typeIdentifier":"t_uint96","typeString":"uint96"}},"value":null,"visibility":"internal"}],"id":142,"initialValue":null,"nodeType":"VariableDeclarationStatement","src":"3609:13:0"},{"condition":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":148,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":143,"name":"rawAmount","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":133,"src":"3636:9:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"==","rightExpression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":146,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"-","prefix":true,"src":"3654:2:0","subExpression":{"argumentTypes":null,"hexValue":"31","id":145,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"3655:1:0","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_1_by_1","typeString":"int_const 1"},"value":"1"},"typeDescriptions":{"typeIdentifier":"t_rational_minus_1_by_1","typeString":"int_const -1"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_rational_minus_1_by_1","typeString":"int_const -1"}],"id":144,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"3649:4:0","typeDescriptions":{"typeIdentifier":"t_type$_t_uint256_$","typeString":"type(uint256)"},"typeName":"uint"},"id":147,"isConstant":false,"isLValue":false,"isPure":true,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3649:8:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"3636:21:0","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"falseBody":{"id":164,"nodeType":"Block","src":"3709:91:0","statements":[{"expression":{"argumentTypes":null,"id":162,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"id":157,"name":"amount","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":141,"src":"3723:6:0","typeDescriptions":{"typeIdentifier":"t_uint96","typeString":"uint96"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":159,"name":"rawAmount","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":133,"src":"3739:9:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"argumentTypes":null,"hexValue":"5856533a3a617070726f76653a20616d6f756e7420657863656564732039362062697473","id":160,"isConstant":false,"isLValue":false,"isPure":true,"kind":"string","lValueRequested":false,"nodeType":"Literal","src":"3750:38:0","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_stringliteral_8cd7b820d3f2aeef11c5505712f00610d19902d1eeec2434c7a048d5821cab58","typeString":"literal_string \"XVS::approve: amount exceeds 96 bits\""},"value":"XVS::approve: amount exceeds 96 bits"}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_stringliteral_8cd7b820d3f2aeef11c5505712f00610d19902d1eeec2434c7a048d5821cab58","typeString":"literal_string \"XVS::approve: amount exceeds 96 bits\""}],"id":158,"name":"safe96","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":906,"src":"3732:6:0","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_uint256_$_t_string_memory_ptr_$returns$_t_uint96_$","typeString":"function (uint256,string memory) pure returns (uint96)"}},"id":161,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3732:57:0","typeDescriptions":{"typeIdentifier":"t_uint96","typeString":"uint96"}},"src":"3723:66:0","typeDescriptions":{"typeIdentifier":"t_uint96","typeString":"uint96"}},"id":163,"nodeType":"ExpressionStatement","src":"3723:66:0"}]},"id":165,"nodeType":"IfStatement","src":"3632:168:0","trueBody":{"id":156,"nodeType":"Block","src":"3659:44:0","statements":[{"expression":{"argumentTypes":null,"id":154,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"id":149,"name":"amount","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":141,"src":"3673:6:0","typeDescriptions":{"typeIdentifier":"t_uint96","