diff --git a/build/contracts/ICurrency.json b/build/contracts/ICurrency.json index bc897ac..cf07f30 100644 --- a/build/contracts/ICurrency.json +++ b/build/contracts/ICurrency.json @@ -198,7 +198,7 @@ "type": "function" } ], - "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of `owner` through {transferFrom}. This is zero by default. This value changes when {approve} or {transferFrom} are called.\"},\"approve(address,uint256)\":{\"details\":\"Sets `amount` as the allowance of `spender` over the caller's tokens. Returns a boolean value indicating whether the operation succeeded. IMPORTANT: Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 Emits an {Approval} event.\"},\"balanceOf(address)\":{\"details\":\"Returns the amount of tokens owned by `account`.\"},\"totalSupply()\":{\"details\":\"Returns the amount of tokens in existence.\"},\"transfer(address,uint256)\":{\"details\":\"Moves `amount` tokens from the caller's account to `to`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"Moves `amount` tokens from `from` to `to` using the allowance mechanism. `amount` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"project:/contracts/market/BETokenMall.sol\":\"ICurrency\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"keccak256\":\"0xba43b97fba0d32eb4254f6a5a297b39a19a247082a02d6e69349e071e2946218\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://fc980984badf3984b6303b377711220e067722bbd6a135b24669ff5069ef9f32\",\"dweb:/ipfs/QmPHXMSXj99XjSVM21YsY6aNtLLjLVXDbyN76J5HQYvvrz\"]},\"@openzeppelin/contracts/security/ReentrancyGuard.sol\":{\"keccak256\":\"0xa535a5df777d44e945dd24aa43a11e44b024140fc340ad0dfe42acf4002aade1\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://41319e7f621f2dc3733511332c4fd032f8e32ad2aa7fd6f665c19741d9941a34\",\"dweb:/ipfs/QmcYR3bd862GD1Bc7jwrU9bGxrhUu5na1oP964bDCu2id1\"]},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://bd39944e8fc06be6dbe2dd1d8449b5336e23c6a7ba3e8e9ae5ae0f37f35283f5\",\"dweb:/ipfs/QmPV3FGYjVwvKSgAXKUN3r9T9GwniZz83CxBpM7vyj2G53\"]},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\":{\"keccak256\":\"0xec63854014a5b4f2b3290ab9103a21bdf902a508d0f41a8573fea49e98bf571a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://bc5b5dc12fbc4002f282eaa7a5f06d8310ed62c1c77c5770f6283e058454c39a\",\"dweb:/ipfs/Qme9rE2wS3yBuyJq9GgbmzbsBQsW2M2sVFqYYLw7bosGrv\"]},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"keccak256\":\"0x909d608c2db6eb165ca178c81289a07ed2e118e444d0025b2a85c97d0b44a4fa\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://656cda26512ddd7373c2d5551c8fae759fc30f05b10f0fc2e738e9274199dbd4\",\"dweb:/ipfs/QmTSArSzQRFbQmHgq7U1PZXnsDFhvDZhKVu9CzMG4yo6Lx\"]},\"@openzeppelin/contracts/utils/Address.sol\":{\"keccak256\":\"0x006dd67219697fe68d7fbfdea512e7c4cb64a43565ed86171d67e844982da6fa\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2455248c8ddd9cc6a7af76a13973cddf222072427e7b0e2a7d1aff345145e931\",\"dweb:/ipfs/QmfYjnjRbWqYpuxurqveE6HtzsY1Xx323J428AKQgtBJZm\"]},\"@openzeppelin/contracts/utils/Context.sol\":{\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6df0ddf21ce9f58271bdfaa85cde98b200ef242a05a3f85c2bc10a8294800a92\",\"dweb:/ipfs/QmRK2Y5Yc6BK7tGKkgsgn3aJEQGi5aakeSPZvS65PV8Xp3\"]},\"project:/contracts/market/BETokenMall.sol\":{\"keccak256\":\"0xad7cdcaf9659e5e4c7af8596154cd2de28e0fdc53495ed5dcf5b7899d05dc6b0\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6432d9c3f00bc344e2be5e355a72ee93259fa72976ac5013d4a87405a41c7a66\",\"dweb:/ipfs/QmRtwet7QoCg8yEk5aGDTw2eUZCgRLNZTYvJ9C2EiFom1M\"]},\"project:/contracts/market/MallBase.sol\":{\"keccak256\":\"0x21e5909f6a86d62b20ebbc92171e8f87638f1c34e35ec88768181b7c4271de65\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c487dd4637521c4e8c11697f5a9acb5188770dc89334b1ea72e2ce5058f605ab\",\"dweb:/ipfs/QmSakyzDfsYCX6VHsVfGrzuwXHWhq8PNxuMkafS1yjREhq\"]},\"project:/contracts/utils/UInt.sol\":{\"keccak256\":\"0xabf10d6f1fd47ffe04ab44b8b2f6638eece2276c3a8ba170d0c660e8212a7a8c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b2b1d61926fb315a771d8fd0d5d9a85ea58a154cd976a7500e12a1e2b3e14083\",\"dweb:/ipfs/QmbJkytTjjABgWbYLJBHv3uoLEAcbF7pWig71sd2rjGG2M\"]}},\"version\":1}", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of `owner` through {transferFrom}. This is zero by default. This value changes when {approve} or {transferFrom} are called.\"},\"approve(address,uint256)\":{\"details\":\"Sets `amount` as the allowance of `spender` over the caller's tokens. Returns a boolean value indicating whether the operation succeeded. IMPORTANT: Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 Emits an {Approval} event.\"},\"balanceOf(address)\":{\"details\":\"Returns the amount of tokens owned by `account`.\"},\"totalSupply()\":{\"details\":\"Returns the amount of tokens in existence.\"},\"transfer(address,uint256)\":{\"details\":\"Moves `amount` tokens from the caller's account to `to`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"Moves `amount` tokens from `from` to `to` using the allowance mechanism. `amount` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"project:/contracts/market/BETokenMall.sol\":\"ICurrency\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"keccak256\":\"0xba43b97fba0d32eb4254f6a5a297b39a19a247082a02d6e69349e071e2946218\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://fc980984badf3984b6303b377711220e067722bbd6a135b24669ff5069ef9f32\",\"dweb:/ipfs/QmPHXMSXj99XjSVM21YsY6aNtLLjLVXDbyN76J5HQYvvrz\"]},\"@openzeppelin/contracts/security/ReentrancyGuard.sol\":{\"keccak256\":\"0xa535a5df777d44e945dd24aa43a11e44b024140fc340ad0dfe42acf4002aade1\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://41319e7f621f2dc3733511332c4fd032f8e32ad2aa7fd6f665c19741d9941a34\",\"dweb:/ipfs/QmcYR3bd862GD1Bc7jwrU9bGxrhUu5na1oP964bDCu2id1\"]},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://bd39944e8fc06be6dbe2dd1d8449b5336e23c6a7ba3e8e9ae5ae0f37f35283f5\",\"dweb:/ipfs/QmPV3FGYjVwvKSgAXKUN3r9T9GwniZz83CxBpM7vyj2G53\"]},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\":{\"keccak256\":\"0xec63854014a5b4f2b3290ab9103a21bdf902a508d0f41a8573fea49e98bf571a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://bc5b5dc12fbc4002f282eaa7a5f06d8310ed62c1c77c5770f6283e058454c39a\",\"dweb:/ipfs/Qme9rE2wS3yBuyJq9GgbmzbsBQsW2M2sVFqYYLw7bosGrv\"]},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"keccak256\":\"0x909d608c2db6eb165ca178c81289a07ed2e118e444d0025b2a85c97d0b44a4fa\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://656cda26512ddd7373c2d5551c8fae759fc30f05b10f0fc2e738e9274199dbd4\",\"dweb:/ipfs/QmTSArSzQRFbQmHgq7U1PZXnsDFhvDZhKVu9CzMG4yo6Lx\"]},\"@openzeppelin/contracts/utils/Address.sol\":{\"keccak256\":\"0x006dd67219697fe68d7fbfdea512e7c4cb64a43565ed86171d67e844982da6fa\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2455248c8ddd9cc6a7af76a13973cddf222072427e7b0e2a7d1aff345145e931\",\"dweb:/ipfs/QmfYjnjRbWqYpuxurqveE6HtzsY1Xx323J428AKQgtBJZm\"]},\"@openzeppelin/contracts/utils/Context.sol\":{\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6df0ddf21ce9f58271bdfaa85cde98b200ef242a05a3f85c2bc10a8294800a92\",\"dweb:/ipfs/QmRK2Y5Yc6BK7tGKkgsgn3aJEQGi5aakeSPZvS65PV8Xp3\"]},\"project:/contracts/market/BETokenMall.sol\":{\"keccak256\":\"0xc25f7cc2cce5487dbf9a7dee96582caaf978b32b7fa0a5aa560383fc56c5c0dd\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://f1f91ac58de9e1303bcbb53f78ce47ed20b77d494060c23967665332d9084633\",\"dweb:/ipfs/QmNeu56W7NeX5G1tkrHmyxEBGVLkZMvFTkjzRU59oyjCL6\"]},\"project:/contracts/market/MallBase.sol\":{\"keccak256\":\"0x21e5909f6a86d62b20ebbc92171e8f87638f1c34e35ec88768181b7c4271de65\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c487dd4637521c4e8c11697f5a9acb5188770dc89334b1ea72e2ce5058f605ab\",\"dweb:/ipfs/QmSakyzDfsYCX6VHsVfGrzuwXHWhq8PNxuMkafS1yjREhq\"]},\"project:/contracts/utils/UInt.sol\":{\"keccak256\":\"0xabf10d6f1fd47ffe04ab44b8b2f6638eece2276c3a8ba170d0c660e8212a7a8c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b2b1d61926fb315a771d8fd0d5d9a85ea58a154cd976a7500e12a1e2b3e14083\",\"dweb:/ipfs/QmbJkytTjjABgWbYLJBHv3uoLEAcbF7pWig71sd2rjGG2M\"]}},\"version\":1}", "bytecode": "0x", "deployedBytecode": "0x", "immutableReferences": {}, @@ -206,7 +206,7 @@ "deployedGeneratedSources": [], "sourceMap": "", "deployedSourceMap": "", - "source": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.10;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport \"@openzeppelin/contracts/security/ReentrancyGuard.sol\";\nimport \"../utils/UInt.sol\";\nimport \"./MallBase.sol\";\n\ninterface ICurrency is IERC20 {\n function decimals() external view returns (uint256);\n}\n\ncontract BETokenMall is MallBase, ReentrancyGuard {\n using SafeERC20 for IERC20;\n using UInt for uint256;\n uint256 constant ROUND = 1000000;\n address public tokenAddress;\n address public seller;\n // currency => price\n mapping(address => uint256) public prices;\n\n // Events\n event BuyTransaction(\n address indexed buyer,\n address tokenAddress,\n address currency,\n uint256 amount\n );\n event TokenAddressUpdated(address tokenAddress);\n event SellerUpdated(address seller);\n event UpdateTokenPrice(address currency, uint256 price, uint256 pricePre);\n\n /**\n * @dev Constructor\n */\n constructor(address _tokenAddress, address _seller) {\n tokenAddress = _tokenAddress;\n seller = _seller;\n }\n\n /**\n * @dev Update token address\n */\n function updateTokenAddress(address _tokenAddress) external onlyOwner {\n tokenAddress = _tokenAddress;\n emit TokenAddressUpdated(_tokenAddress);\n }\n\n /**\n * @dev Update seller address\n */\n function updateSeller(address _seller) external onlyOwner {\n seller = _seller;\n emit SellerUpdated(_seller);\n }\n\n /**\n * @dev Update token price\n */\n function updateTokenPrice(\n address currency,\n uint256 price\n ) external onlyOwner {\n uint256 pricePre = prices[currency];\n prices[currency] = price;\n emit UpdateTokenPrice(currency, price, pricePre);\n }\n\n /**\n * @dev Buy token\n */\n function buyToken(address currency, uint256 amount) external nonReentrant {\n require(amount > 0, \"BETokenMall: invalid amount\");\n require(erc20Supported[currency], \"BETokenMall: invalid payment method\");\n require(prices[currency] > 0, \"BETokenMall: invalid token price\");\n // calc currency amount\n uint256 currencyDecimal = ICurrency(currency).decimals();\n uint256 tokenAmount = (prices[currency] *\n amount *\n (10 ** (18 - currencyDecimal))) / ROUND;\n address buyer = _msgSender();\n require(\n IERC20(tokenAddress).balanceOf(seller) >= tokenAmount,\n \"BETokenMall: seller doesn't have enough token to sell this item\"\n );\n require(\n IERC20(tokenAddress).allowance(seller, address(this)) >= tokenAmount,\n \"BETokenMall: seller doesn't approve enough token to sell this item\"\n );\n // Check payment approval and buyer balance\n require(\n IERC20(currency).balanceOf(buyer) >= amount,\n \"BETokenMall: buyer doesn't have enough token to buy this item\"\n );\n require(\n IERC20(currency).allowance(buyer, address(this)) >= amount,\n \"BETokenMall: buyer doesn't approve enough token to buy this item\"\n );\n\n // Transfer payment to seller\n IERC20(currency).safeTransferFrom(buyer, feeToAddress, amount);\n // Transfer token to buyer\n IERC20(tokenAddress).safeTransferFrom(seller, buyer, tokenAmount);\n // emit buy event\n emit BuyTransaction(buyer, tokenAddress, currency, amount);\n }\n}\n", + "source": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.10;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport \"@openzeppelin/contracts/security/ReentrancyGuard.sol\";\nimport \"../utils/UInt.sol\";\nimport \"./MallBase.sol\";\n\ninterface ICurrency is IERC20 {\n function decimals() external view returns (uint256);\n}\n\ncontract BETokenMall is MallBase, ReentrancyGuard {\n using SafeERC20 for IERC20;\n using UInt for uint256;\n uint256 constant ROUND = 1000000;\n address public tokenAddress;\n address public seller;\n // currency => price\n mapping(address => uint256) public prices;\n\n // Events\n event BuyTransaction(\n address indexed buyer,\n address tokenAddress,\n address currency,\n uint256 amount,\n uint256 tokenAmount\n );\n event TokenAddressUpdated(address tokenAddress);\n event SellerUpdated(address seller);\n event UpdateTokenPrice(address currency, uint256 price, uint256 pricePre);\n\n /**\n * @dev Constructor\n */\n constructor(address _tokenAddress, address _seller) {\n tokenAddress = _tokenAddress;\n seller = _seller;\n }\n\n /**\n * @dev Update token address\n */\n function updateTokenAddress(address _tokenAddress) external onlyOwner {\n tokenAddress = _tokenAddress;\n emit TokenAddressUpdated(_tokenAddress);\n }\n\n /**\n * @dev Update seller address\n */\n function updateSeller(address _seller) external onlyOwner {\n seller = _seller;\n emit SellerUpdated(_seller);\n }\n\n /**\n * @dev Update token price\n */\n function updateTokenPrice(\n address currency,\n uint256 price\n ) external onlyOwner {\n uint256 pricePre = prices[currency];\n prices[currency] = price;\n emit UpdateTokenPrice(currency, price, pricePre);\n }\n\n /**\n * @dev Buy token\n */\n function buyToken(address currency, uint256 amount) external nonReentrant {\n require(amount > 0, \"BETokenMall: invalid amount\");\n require(erc20Supported[currency], \"BETokenMall: invalid payment method\");\n require(prices[currency] > 0, \"BETokenMall: invalid token price\");\n // calc currency amount\n uint256 currencyDecimal = ICurrency(currency).decimals();\n uint256 tokenAmount = (prices[currency] *\n amount *\n (10 ** (18 - currencyDecimal))) / ROUND;\n address buyer = _msgSender();\n require(\n IERC20(tokenAddress).balanceOf(seller) >= tokenAmount,\n \"BETokenMall: seller doesn't have enough token to sell this item\"\n );\n require(\n IERC20(tokenAddress).allowance(seller, address(this)) >= tokenAmount,\n \"BETokenMall: seller doesn't approve enough token to sell this item\"\n );\n // Check payment approval and buyer balance\n require(\n IERC20(currency).balanceOf(buyer) >= amount,\n \"BETokenMall: buyer doesn't have enough token to buy this item\"\n );\n require(\n IERC20(currency).allowance(buyer, address(this)) >= amount,\n \"BETokenMall: buyer doesn't approve enough token to buy this item\"\n );\n\n // Transfer payment to seller\n IERC20(currency).safeTransferFrom(buyer, feeToAddress, amount);\n // Transfer token to buyer\n IERC20(tokenAddress).safeTransferFrom(seller, buyer, tokenAmount);\n // emit buy event\n emit BuyTransaction(buyer, tokenAddress, currency, amount, tokenAmount);\n }\n}\n", "sourcePath": "/Users/zhl/Documents/workspace/crypto/becrypto/contracts/market/BETokenMall.sol", "ast": { "absolutePath": "project:/contracts/market/BETokenMall.sol", @@ -215,7 +215,7 @@ 997 ], "BETokenMall": [ - 1310 + 1313 ], "Context": [ 1019 @@ -230,7 +230,7 @@ 291 ], "MallBase": [ - 1423 + 1426 ], "Ownable": [ 112 @@ -242,10 +242,10 @@ 667 ], "UInt": [ - 1454 + 1457 ] }, - "id": 1311, + "id": 1314, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ @@ -265,7 +265,7 @@ "id": 1022, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", - "scope": 1311, + "scope": 1314, "sourceUnit": 256, "src": "57:56:7", "symbolAliases": [], @@ -277,7 +277,7 @@ "id": 1023, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", - "scope": 1311, + "scope": 1314, "sourceUnit": 668, "src": "114:65:7", "symbolAliases": [], @@ -289,7 +289,7 @@ "id": 1024, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", - "scope": 1311, + "scope": 1314, "sourceUnit": 178, "src": "180:62:7", "symbolAliases": [], @@ -301,8 +301,8 @@ "id": 1025, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", - "scope": 1311, - "sourceUnit": 1455, + "scope": 1314, + "sourceUnit": 1458, "src": "243:27:7", "symbolAliases": [], "unitAlias": "" @@ -313,8 +313,8 @@ "id": 1026, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", - "scope": 1311, - "sourceUnit": 1424, + "scope": 1314, + "sourceUnit": 1427, "src": "271:24:7", "symbolAliases": [], "unitAlias": "" @@ -404,7 +404,7 @@ "visibility": "external" } ], - "scope": 1311, + "scope": 1314, "src": "297:88:7", "usedErrors": [] }, @@ -416,7 +416,7 @@ "id": 1035, "name": "MallBase", "nodeType": "IdentifierPath", - "referencedDeclaration": 1423, + "referencedDeclaration": 1426, "src": "411:8:7" }, "id": 1036, @@ -440,11 +440,11 @@ "contractDependencies": [], "contractKind": "contract", "fullyImplemented": true, - "id": 1310, + "id": 1313, "linearizedBaseContracts": [ - 1310, + 1313, 177, - 1423, + 1426, 112, 1019 ], @@ -487,7 +487,7 @@ "id": 1043, "name": "UInt", "nodeType": "IdentifierPath", - "referencedDeclaration": 1454, + "referencedDeclaration": 1457, "src": "477:4:7" }, "nodeType": "UsingForDirective", @@ -510,7 +510,7 @@ "name": "ROUND", "nameLocation": "514:5:7", "nodeType": "VariableDeclaration", - "scope": 1310, + "scope": 1313, "src": "497:32:7", "stateVariable": true, "storageLocation": "default", @@ -554,7 +554,7 @@ "name": "tokenAddress", "nameLocation": "548:12:7", "nodeType": "VariableDeclaration", - "scope": 1310, + "scope": 1313, "src": "533:27:7", "stateVariable": true, "storageLocation": "default", @@ -583,7 +583,7 @@ "name": "seller", "nameLocation": "579:6:7", "nodeType": "VariableDeclaration", - "scope": 1310, + "scope": 1313, "src": "564:21:7", "stateVariable": true, "storageLocation": "default", @@ -612,7 +612,7 @@ "name": "prices", "nameLocation": "647:6:7", "nodeType": "VariableDeclaration", - "scope": 1310, + "scope": 1313, "src": "612:41:7", "stateVariable": true, "storageLocation": "default", @@ -653,12 +653,12 @@ }, { "anonymous": false, - "id": 1066, + "id": 1068, "name": "BuyTransaction", "nameLocation": "676:14:7", "nodeType": "EventDefinition", "parameters": { - "id": 1065, + "id": 1067, "nodeType": "ParameterList", "parameters": [ { @@ -669,7 +669,7 @@ "name": "buyer", "nameLocation": "712:5:7", "nodeType": "VariableDeclaration", - "scope": 1066, + "scope": 1068, "src": "696:21:7", "stateVariable": false, "storageLocation": "default", @@ -698,7 +698,7 @@ "name": "tokenAddress", "nameLocation": "731:12:7", "nodeType": "VariableDeclaration", - "scope": 1066, + "scope": 1068, "src": "723:20:7", "stateVariable": false, "storageLocation": "default", @@ -727,7 +727,7 @@ "name": "currency", "nameLocation": "757:8:7", "nodeType": "VariableDeclaration", - "scope": 1066, + "scope": 1068, "src": "749:16:7", "stateVariable": false, "storageLocation": "default", @@ -756,7 +756,7 @@ "name": "amount", "nameLocation": "779:6:7", "nodeType": "VariableDeclaration", - "scope": 1066, + "scope": 1068, "src": "771:14:7", "stateVariable": false, "storageLocation": "default", @@ -775,149 +775,17 @@ } }, "visibility": "internal" - } - ], - "src": "690:99:7" - }, - "src": "670:120:7" - }, - { - "anonymous": false, - "id": 1070, - "name": "TokenAddressUpdated", - "nameLocation": "799:19:7", - "nodeType": "EventDefinition", - "parameters": { - "id": 1069, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1068, - "indexed": false, - "mutability": "mutable", - "name": "tokenAddress", - "nameLocation": "827:12:7", - "nodeType": "VariableDeclaration", - "scope": 1070, - "src": "819:20:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1067, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "819:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "818:22:7" - }, - "src": "793:48:7" - }, - { - "anonymous": false, - "id": 1074, - "name": "SellerUpdated", - "nameLocation": "850:13:7", - "nodeType": "EventDefinition", - "parameters": { - "id": 1073, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1072, - "indexed": false, - "mutability": "mutable", - "name": "seller", - "nameLocation": "872:6:7", - "nodeType": "VariableDeclaration", - "scope": 1074, - "src": "864:14:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1071, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "864:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "863:16:7" - }, - "src": "844:36:7" - }, - { - "anonymous": false, - "id": 1082, - "name": "UpdateTokenPrice", - "nameLocation": "889:16:7", - "nodeType": "EventDefinition", - "parameters": { - "id": 1081, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1076, - "indexed": false, - "mutability": "mutable", - "name": "currency", - "nameLocation": "914:8:7", - "nodeType": "VariableDeclaration", - "scope": 1082, - "src": "906:16:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1075, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "906:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" }, { "constant": false, - "id": 1078, + "id": 1066, "indexed": false, "mutability": "mutable", - "name": "price", - "nameLocation": "932:5:7", + "name": "tokenAmount", + "nameLocation": "799:11:7", "nodeType": "VariableDeclaration", - "scope": 1082, - "src": "924:13:7", + "scope": 1068, + "src": "791:19:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -925,27 +793,159 @@ "typeString": "uint256" }, "typeName": { - "id": 1077, + "id": 1065, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "924:7:7", + "src": "791:7:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" + } + ], + "src": "690:124:7" + }, + "src": "670:145:7" + }, + { + "anonymous": false, + "id": 1072, + "name": "TokenAddressUpdated", + "nameLocation": "824:19:7", + "nodeType": "EventDefinition", + "parameters": { + "id": 1071, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1070, + "indexed": false, + "mutability": "mutable", + "name": "tokenAddress", + "nameLocation": "852:12:7", + "nodeType": "VariableDeclaration", + "scope": 1072, + "src": "844:20:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1069, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "844:7:7", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "843:22:7" + }, + "src": "818:48:7" + }, + { + "anonymous": false, + "id": 1076, + "name": "SellerUpdated", + "nameLocation": "875:13:7", + "nodeType": "EventDefinition", + "parameters": { + "id": 1075, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1074, + "indexed": false, + "mutability": "mutable", + "name": "seller", + "nameLocation": "897:6:7", + "nodeType": "VariableDeclaration", + "scope": 1076, + "src": "889:14:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1073, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "889:7:7", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "888:16:7" + }, + "src": "869:36:7" + }, + { + "anonymous": false, + "id": 1084, + "name": "UpdateTokenPrice", + "nameLocation": "914:16:7", + "nodeType": "EventDefinition", + "parameters": { + "id": 1083, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1078, + "indexed": false, + "mutability": "mutable", + "name": "currency", + "nameLocation": "939:8:7", + "nodeType": "VariableDeclaration", + "scope": 1084, + "src": "931:16:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1077, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "931:7:7", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" }, { "constant": false, "id": 1080, "indexed": false, "mutability": "mutable", - "name": "pricePre", - "nameLocation": "947:8:7", + "name": "price", + "nameLocation": "957:5:7", "nodeType": "VariableDeclaration", - "scope": 1082, - "src": "939:16:7", + "scope": 1084, + "src": "949:13:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -956,7 +956,35 @@ "id": 1079, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "939:7:7", + "src": "949:7:7", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1082, + "indexed": false, + "mutability": "mutable", + "name": "pricePre", + "nameLocation": "972:8:7", + "nodeType": "VariableDeclaration", + "scope": 1084, + "src": "964:16:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1081, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "964:7:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -965,30 +993,30 @@ "visibility": "internal" } ], - "src": "905:51:7" + "src": "930:51:7" }, - "src": "883:74:7" + "src": "908:74:7" }, { "body": { - "id": 1098, + "id": 1100, "nodeType": "Block", - "src": "1047:61:7", + "src": "1072:61:7", "statements": [ { "expression": { - "id": 1092, + "id": 1094, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { - "id": 1090, + "id": 1092, "name": "tokenAddress", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1050, - "src": "1053:12:7", + "src": "1078:12:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -997,41 +1025,41 @@ "nodeType": "Assignment", "operator": "=", "rightHandSide": { - "id": 1091, + "id": 1093, "name": "_tokenAddress", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1085, - "src": "1068:13:7", + "referencedDeclaration": 1087, + "src": "1093:13:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, - "src": "1053:28:7", + "src": "1078:28:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, - "id": 1093, + "id": 1095, "nodeType": "ExpressionStatement", - "src": "1053:28:7" + "src": "1078:28:7" }, { "expression": { - "id": 1096, + "id": 1098, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { - "id": 1094, + "id": 1096, "name": "seller", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1052, - "src": "1087:6:7", + "src": "1112:6:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -1040,36 +1068,36 @@ "nodeType": "Assignment", "operator": "=", "rightHandSide": { - "id": 1095, + "id": 1097, "name": "_seller", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1087, - "src": "1096:7:7", + "referencedDeclaration": 1089, + "src": "1121:7:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, - "src": "1087:16:7", + "src": "1112:16:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, - "id": 1097, + "id": 1099, "nodeType": "ExpressionStatement", - "src": "1087:16:7" + "src": "1112:16:7" } ] }, "documentation": { - "id": 1083, + "id": 1085, "nodeType": "StructuredDocumentation", - "src": "961:31:7", + "src": "986:31:7", "text": " @dev Constructor" }, - "id": 1099, + "id": 1101, "implemented": true, "kind": "constructor", "modifiers": [], @@ -1077,46 +1105,18 @@ "nameLocation": "-1:-1:-1", "nodeType": "FunctionDefinition", "parameters": { - "id": 1088, + "id": 1090, "nodeType": "ParameterList", "parameters": [ - { - "constant": false, - "id": 1085, - "mutability": "mutable", - "name": "_tokenAddress", - "nameLocation": "1015:13:7", - "nodeType": "VariableDeclaration", - "scope": 1099, - "src": "1007:21:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1084, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1007:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, { "constant": false, "id": 1087, "mutability": "mutable", - "name": "_seller", - "nameLocation": "1038:7:7", + "name": "_tokenAddress", + "nameLocation": "1040:13:7", "nodeType": "VariableDeclaration", - "scope": 1099, - "src": "1030:15:7", + "scope": 1101, + "src": "1032:21:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1127,7 +1127,35 @@ "id": 1086, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1030:7:7", + "src": "1032:7:7", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 1089, + "mutability": "mutable", + "name": "_seller", + "nameLocation": "1063:7:7", + "nodeType": "VariableDeclaration", + "scope": 1101, + "src": "1055:15:7", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1088, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1055:7:7", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -1137,40 +1165,40 @@ "visibility": "internal" } ], - "src": "1006:40:7" + "src": "1031:40:7" }, "returnParameters": { - "id": 1089, + "id": 1091, "nodeType": "ParameterList", "parameters": [], - "src": "1047:0:7" + "src": "1072:0:7" }, - "scope": 1310, - "src": "995:113:7", + "scope": 1313, + "src": "1020:113:7", "stateMutability": "nonpayable", "virtual": false, "visibility": "public" }, { "body": { - "id": 1115, + "id": 1117, "nodeType": "Block", - "src": "1225:84:7", + "src": "1250:84:7", "statements": [ { "expression": { - "id": 1109, + "id": 1111, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { - "id": 1107, + "id": 1109, "name": "tokenAddress", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1050, - "src": "1231:12:7", + "src": "1256:12:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -1179,37 +1207,37 @@ "nodeType": "Assignment", "operator": "=", "rightHandSide": { - "id": 1108, + "id": 1110, "name": "_tokenAddress", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1102, - "src": "1246:13:7", + "referencedDeclaration": 1104, + "src": "1271:13:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, - "src": "1231:28:7", + "src": "1256:28:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, - "id": 1110, + "id": 1112, "nodeType": "ExpressionStatement", - "src": "1231:28:7" + "src": "1256:28:7" }, { "eventCall": { "arguments": [ { - "id": 1112, + "id": 1114, "name": "_tokenAddress", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1102, - "src": "1290:13:7", + "referencedDeclaration": 1104, + "src": "1315:13:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -1223,18 +1251,18 @@ "typeString": "address" } ], - "id": 1111, + "id": 1113, "name": "TokenAddressUpdated", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1070, - "src": "1270:19:7", + "referencedDeclaration": 1072, + "src": "1295:19:7", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, - "id": 1113, + "id": 1115, "isConstant": false, "isLValue": false, "isPure": false, @@ -1242,60 +1270,60 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "1270:34:7", + "src": "1295:34:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 1114, + "id": 1116, "nodeType": "EmitStatement", - "src": "1265:39:7" + "src": "1290:39:7" } ] }, "documentation": { - "id": 1100, + "id": 1102, "nodeType": "StructuredDocumentation", - "src": "1112:40:7", + "src": "1137:40:7", "text": " @dev Update token address" }, "functionSelector": "6691461a", - "id": 1116, + "id": 1118, "implemented": true, "kind": "function", "modifiers": [ { - "id": 1105, + "id": 1107, "kind": "modifierInvocation", "modifierName": { - "id": 1104, + "id": 1106, "name": "onlyOwner", "nodeType": "IdentifierPath", "referencedDeclaration": 31, - "src": "1215:9:7" + "src": "1240:9:7" }, "nodeType": "ModifierInvocation", - "src": "1215:9:7" + "src": "1240:9:7" } ], "name": "updateTokenAddress", - "nameLocation": "1164:18:7", + "nameLocation": "1189:18:7", "nodeType": "FunctionDefinition", "parameters": { - "id": 1103, + "id": 1105, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 1102, + "id": 1104, "mutability": "mutable", "name": "_tokenAddress", - "nameLocation": "1191:13:7", + "nameLocation": "1216:13:7", "nodeType": "VariableDeclaration", - "scope": 1116, - "src": "1183:21:7", + "scope": 1118, + "src": "1208:21:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1303,10 +1331,10 @@ "typeString": "address" }, "typeName": { - "id": 1101, + "id": 1103, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1183:7:7", + "src": "1208:7:7", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -1316,40 +1344,40 @@ "visibility": "internal" } ], - "src": "1182:23:7" + "src": "1207:23:7" }, "returnParameters": { - "id": 1106, + "id": 1108, "nodeType": "ParameterList", "parameters": [], - "src": "1225:0:7" + "src": "1250:0:7" }, - "scope": 1310, - "src": "1155:154:7", + "scope": 1313, + "src": "1180:154:7", "stateMutability": "nonpayable", "virtual": false, "visibility": "external" }, { "body": { - "id": 1132, + "id": 1134, "nodeType": "Block", - "src": "1415:60:7", + "src": "1440:60:7", "statements": [ { "expression": { - "id": 1126, + "id": 1128, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { - "id": 1124, + "id": 1126, "name": "seller", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1052, - "src": "1421:6:7", + "src": "1446:6:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -1358,37 +1386,37 @@ "nodeType": "Assignment", "operator": "=", "rightHandSide": { - "id": 1125, + "id": 1127, "name": "_seller", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1119, - "src": "1430:7:7", + "referencedDeclaration": 1121, + "src": "1455:7:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, - "src": "1421:16:7", + "src": "1446:16:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, - "id": 1127, + "id": 1129, "nodeType": "ExpressionStatement", - "src": "1421:16:7" + "src": "1446:16:7" }, { "eventCall": { "arguments": [ { - "id": 1129, + "id": 1131, "name": "_seller", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1119, - "src": "1462:7:7", + "referencedDeclaration": 1121, + "src": "1487:7:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -1402,18 +1430,18 @@ "typeString": "address" } ], - "id": 1128, + "id": 1130, "name": "SellerUpdated", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1074, - "src": "1448:13:7", + "referencedDeclaration": 1076, + "src": "1473:13:7", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, - "id": 1130, + "id": 1132, "isConstant": false, "isLValue": false, "isPure": false, @@ -1421,60 +1449,60 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "1448:22:7", + "src": "1473:22:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 1131, + "id": 1133, "nodeType": "EmitStatement", - "src": "1443:27:7" + "src": "1468:27:7" } ] }, "documentation": { - "id": 1117, + "id": 1119, "nodeType": "StructuredDocumentation", - "src": "1313:41:7", + "src": "1338:41:7", "text": " @dev Update seller address" }, "functionSelector": "dbbdae63", - "id": 1133, + "id": 1135, "implemented": true, "kind": "function", "modifiers": [ { - "id": 1122, + "id": 1124, "kind": "modifierInvocation", "modifierName": { - "id": 1121, + "id": 1123, "name": "onlyOwner", "nodeType": "IdentifierPath", "referencedDeclaration": 31, - "src": "1405:9:7" + "src": "1430:9:7" }, "nodeType": "ModifierInvocation", - "src": "1405:9:7" + "src": "1430:9:7" } ], "name": "updateSeller", - "nameLocation": "1366:12:7", + "nameLocation": "1391:12:7", "nodeType": "FunctionDefinition", "parameters": { - "id": 1120, + "id": 1122, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 1119, + "id": 1121, "mutability": "mutable", "name": "_seller", - "nameLocation": "1387:7:7", + "nameLocation": "1412:7:7", "nodeType": "VariableDeclaration", - "scope": 1133, - "src": "1379:15:7", + "scope": 1135, + "src": "1404:15:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1482,10 +1510,10 @@ "typeString": "address" }, "typeName": { - "id": 1118, + "id": 1120, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1379:7:7", + "src": "1404:7:7", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -1495,40 +1523,40 @@ "visibility": "internal" } ], - "src": "1378:17:7" + "src": "1403:17:7" }, "returnParameters": { - "id": 1123, + "id": 1125, "nodeType": "ParameterList", "parameters": [], - "src": "1415:0:7" + "src": "1440:0:7" }, - "scope": 1310, - "src": "1357:118:7", + "scope": 1313, + "src": "1382:118:7", "stateMutability": "nonpayable", "virtual": false, "visibility": "external" }, { "body": { - "id": 1161, + "id": 1163, "nodeType": "Block", - "src": "1610:130:7", + "src": "1635:130:7", "statements": [ { "assignments": [ - 1144 + 1146 ], "declarations": [ { "constant": false, - "id": 1144, + "id": 1146, "mutability": "mutable", "name": "pricePre", - "nameLocation": "1624:8:7", + "nameLocation": "1649:8:7", "nodeType": "VariableDeclaration", - "scope": 1161, - "src": "1616:16:7", + "scope": 1163, + "src": "1641:16:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1536,10 +1564,10 @@ "typeString": "uint256" }, "typeName": { - "id": 1143, + "id": 1145, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "1616:7:7", + "src": "1641:7:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1548,28 +1576,28 @@ "visibility": "internal" } ], - "id": 1148, + "id": 1150, "initialValue": { "baseExpression": { - "id": 1145, + "id": 1147, "name": "prices", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1056, - "src": "1635:6:7", + "src": "1660:6:7", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" } }, - "id": 1147, + "id": 1149, "indexExpression": { - "id": 1146, + "id": 1148, "name": "currency", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1136, - "src": "1642:8:7", + "referencedDeclaration": 1138, + "src": "1667:8:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -1580,43 +1608,43 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "1635:16:7", + "src": "1660:16:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", - "src": "1616:35:7" + "src": "1641:35:7" }, { "expression": { - "id": 1153, + "id": 1155, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "baseExpression": { - "id": 1149, + "id": 1151, "name": "prices", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1056, - "src": "1657:6:7", + "src": "1682:6:7", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" } }, - "id": 1151, + "id": 1153, "indexExpression": { - "id": 1150, + "id": 1152, "name": "currency", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1136, - "src": "1664:8:7", + "referencedDeclaration": 1138, + "src": "1689:8:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -1627,7 +1655,7 @@ "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", - "src": "1657:16:7", + "src": "1682:16:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1636,61 +1664,61 @@ "nodeType": "Assignment", "operator": "=", "rightHandSide": { - "id": 1152, + "id": 1154, "name": "price", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1138, - "src": "1676:5:7", + "referencedDeclaration": 1140, + "src": "1701:5:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "1657:24:7", + "src": "1682:24:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "id": 1154, + "id": 1156, "nodeType": "ExpressionStatement", - "src": "1657:24:7" + "src": "1682:24:7" }, { "eventCall": { "arguments": [ { - "id": 1156, + "id": 1158, "name": "currency", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1136, - "src": "1709:8:7", + "referencedDeclaration": 1138, + "src": "1734:8:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, { - "id": 1157, + "id": 1159, "name": "price", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1138, - "src": "1719:5:7", + "referencedDeclaration": 1140, + "src": "1744:5:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { - "id": 1158, + "id": 1160, "name": "pricePre", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1144, - "src": "1726:8:7", + "referencedDeclaration": 1146, + "src": "1751:8:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1712,18 +1740,18 @@ "typeString": "uint256" } ], - "id": 1155, + "id": 1157, "name": "UpdateTokenPrice", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1082, - "src": "1692:16:7", + "referencedDeclaration": 1084, + "src": "1717:16:7", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_uint256_$_t_uint256_$returns$__$", "typeString": "function (address,uint256,uint256)" } }, - "id": 1159, + "id": 1161, "isConstant": false, "isLValue": false, "isPure": false, @@ -1731,60 +1759,60 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "1692:43:7", + "src": "1717:43:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 1160, + "id": 1162, "nodeType": "EmitStatement", - "src": "1687:48:7" + "src": "1712:48:7" } ] }, "documentation": { - "id": 1134, + "id": 1136, "nodeType": "StructuredDocumentation", - "src": "1479:38:7", + "src": "1504:38:7", "text": " @dev Update token price" }, "functionSelector": "d4ee651b", - "id": 1162, + "id": 1164, "implemented": true, "kind": "function", "modifiers": [ { - "id": 1141, + "id": 1143, "kind": "modifierInvocation", "modifierName": { - "id": 1140, + "id": 1142, "name": "onlyOwner", "nodeType": "IdentifierPath", "referencedDeclaration": 31, - "src": "1600:9:7" + "src": "1625:9:7" }, "nodeType": "ModifierInvocation", - "src": "1600:9:7" + "src": "1625:9:7" } ], "name": "updateTokenPrice", - "nameLocation": "1529:16:7", + "nameLocation": "1554:16:7", "nodeType": "FunctionDefinition", "parameters": { - "id": 1139, + "id": 1141, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 1136, + "id": 1138, "mutability": "mutable", "name": "currency", - "nameLocation": "1559:8:7", + "nameLocation": "1584:8:7", "nodeType": "VariableDeclaration", - "scope": 1162, - "src": "1551:16:7", + "scope": 1164, + "src": "1576:16:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1792,10 +1820,10 @@ "typeString": "address" }, "typeName": { - "id": 1135, + "id": 1137, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1551:7:7", + "src": "1576:7:7", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -1806,13 +1834,13 @@ }, { "constant": false, - "id": 1138, + "id": 1140, "mutability": "mutable", "name": "price", - "nameLocation": "1581:5:7", + "nameLocation": "1606:5:7", "nodeType": "VariableDeclaration", - "scope": 1162, - "src": "1573:13:7", + "scope": 1164, + "src": "1598:13:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1820,10 +1848,10 @@ "typeString": "uint256" }, "typeName": { - "id": 1137, + "id": 1139, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "1573:7:7", + "src": "1598:7:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1832,25 +1860,25 @@ "visibility": "internal" } ], - "src": "1545:45:7" + "src": "1570:45:7" }, "returnParameters": { - "id": 1142, + "id": 1144, "nodeType": "ParameterList", "parameters": [], - "src": "1610:0:7" + "src": "1635:0:7" }, - "scope": 1310, - "src": "1520:220:7", + "scope": 1313, + "src": "1545:220:7", "stateMutability": "nonpayable", "virtual": false, "visibility": "external" }, { "body": { - "id": 1308, + "id": 1311, "nodeType": "Block", - "src": "1850:1405:7", + "src": "1875:1418:7", "statements": [ { "expression": { @@ -1860,18 +1888,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 1175, + "id": 1177, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 1173, + "id": 1175, "name": "amount", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1167, - "src": "1864:6:7", + "referencedDeclaration": 1169, + "src": "1889:6:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1881,21 +1909,21 @@ "operator": ">", "rightExpression": { "hexValue": "30", - "id": 1174, + "id": 1176, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "1873:1:7", + "src": "1898:1:7", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, - "src": "1864:10:7", + "src": "1889:10:7", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -1903,14 +1931,14 @@ }, { "hexValue": "4245546f6b656e4d616c6c3a20696e76616c696420616d6f756e74", - "id": 1176, + "id": 1178, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "1876:29:7", + "src": "1901:29:7", "typeDescriptions": { "typeIdentifier": "t_stringliteral_a2d21523123f6a5636f1f4f57c897909bc3f74962b6955ed8c6676563580d5be", "typeString": "literal_string \"BETokenMall: invalid amount\"" @@ -1929,7 +1957,7 @@ "typeString": "literal_string \"BETokenMall: invalid amount\"" } ], - "id": 1172, + "id": 1174, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ @@ -1937,13 +1965,13 @@ 4294967278 ], "referencedDeclaration": 4294967278, - "src": "1856:7:7", + "src": "1881:7:7", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 1177, + "id": 1179, "isConstant": false, "isLValue": false, "isPure": false, @@ -1951,41 +1979,41 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "1856:50:7", + "src": "1881:50:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 1178, + "id": 1180, "nodeType": "ExpressionStatement", - "src": "1856:50:7" + "src": "1881:50:7" }, { "expression": { "arguments": [ { "baseExpression": { - "id": 1180, + "id": 1182, "name": "erc20Supported", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1323, - "src": "1920:14:7", + "referencedDeclaration": 1326, + "src": "1945:14:7", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", "typeString": "mapping(address => bool)" } }, - "id": 1182, + "id": 1184, "indexExpression": { - "id": 1181, + "id": 1183, "name": "currency", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1165, - "src": "1935:8:7", + "referencedDeclaration": 1167, + "src": "1960:8:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -1996,7 +2024,7 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "1920:24:7", + "src": "1945:24:7", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -2004,14 +2032,14 @@ }, { "hexValue": "4245546f6b656e4d616c6c3a20696e76616c6964207061796d656e74206d6574686f64", - "id": 1183, + "id": 1185, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "1946:37:7", + "src": "1971:37:7", "typeDescriptions": { "typeIdentifier": "t_stringliteral_ce49507a01a15df79dff2538e31e6b4b37d348783463e336d10e68082f4288fa", "typeString": "literal_string \"BETokenMall: invalid payment method\"" @@ -2030,7 +2058,7 @@ "typeString": "literal_string \"BETokenMall: invalid payment method\"" } ], - "id": 1179, + "id": 1181, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ @@ -2038,13 +2066,13 @@ 4294967278 ], "referencedDeclaration": 4294967278, - "src": "1912:7:7", + "src": "1937:7:7", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 1184, + "id": 1186, "isConstant": false, "isLValue": false, "isPure": false, @@ -2052,16 +2080,16 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "1912:72:7", + "src": "1937:72:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 1185, + "id": 1187, "nodeType": "ExpressionStatement", - "src": "1912:72:7" + "src": "1937:72:7" }, { "expression": { @@ -2071,32 +2099,32 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 1191, + "id": 1193, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "baseExpression": { - "id": 1187, + "id": 1189, "name": "prices", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1056, - "src": "1998:6:7", + "src": "2023:6:7", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" } }, - "id": 1189, + "id": 1191, "indexExpression": { - "id": 1188, + "id": 1190, "name": "currency", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1165, - "src": "2005:8:7", + "referencedDeclaration": 1167, + "src": "2030:8:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -2107,7 +2135,7 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "1998:16:7", + "src": "2023:16:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -2117,21 +2145,21 @@ "operator": ">", "rightExpression": { "hexValue": "30", - "id": 1190, + "id": 1192, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "2017:1:7", + "src": "2042:1:7", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, - "src": "1998:20:7", + "src": "2023:20:7", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -2139,14 +2167,14 @@ }, { "hexValue": "4245546f6b656e4d616c6c3a20696e76616c696420746f6b656e207072696365", - "id": 1192, + "id": 1194, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2020:34:7", + "src": "2045:34:7", "typeDescriptions": { "typeIdentifier": "t_stringliteral_de0baa7be4f17d52c3048a4dab4dba816280e3b0920fda3f994482639c9555cd", "typeString": "literal_string \"BETokenMall: invalid token price\"" @@ -2165,7 +2193,7 @@ "typeString": "literal_string \"BETokenMall: invalid token price\"" } ], - "id": 1186, + "id": 1188, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ @@ -2173,13 +2201,13 @@ 4294967278 ], "referencedDeclaration": 4294967278, - "src": "1990:7:7", + "src": "2015:7:7", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 1193, + "id": 1195, "isConstant": false, "isLValue": false, "isPure": false, @@ -2187,31 +2215,31 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "1990:65:7", + "src": "2015:65:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 1194, + "id": 1196, "nodeType": "ExpressionStatement", - "src": "1990:65:7" + "src": "2015:65:7" }, { "assignments": [ - 1196 + 1198 ], "declarations": [ { "constant": false, - "id": 1196, + "id": 1198, "mutability": "mutable", "name": "currencyDecimal", - "nameLocation": "2097:15:7", + "nameLocation": "2122:15:7", "nodeType": "VariableDeclaration", - "scope": 1308, - "src": "2089:23:7", + "scope": 1311, + "src": "2114:23:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -2219,10 +2247,10 @@ "typeString": "uint256" }, "typeName": { - "id": 1195, + "id": 1197, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "2089:7:7", + "src": "2114:7:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -2231,7 +2259,7 @@ "visibility": "internal" } ], - "id": 1202, + "id": 1204, "initialValue": { "arguments": [], "expression": { @@ -2239,12 +2267,12 @@ "expression": { "arguments": [ { - "id": 1198, + "id": 1200, "name": "currency", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1165, - "src": "2125:8:7", + "referencedDeclaration": 1167, + "src": "2150:8:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -2258,18 +2286,18 @@ "typeString": "address" } ], - "id": 1197, + "id": 1199, "name": "ICurrency", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1034, - "src": "2115:9:7", + "src": "2140:9:7", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_ICurrency_$1034_$", "typeString": "type(contract ICurrency)" } }, - "id": 1199, + "id": 1201, "isConstant": false, "isLValue": false, "isPure": false, @@ -2277,14 +2305,14 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2115:19:7", + "src": "2140:19:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_contract$_ICurrency_$1034", "typeString": "contract ICurrency" } }, - "id": 1200, + "id": 1202, "isConstant": false, "isLValue": false, "isPure": false, @@ -2292,13 +2320,13 @@ "memberName": "decimals", "nodeType": "MemberAccess", "referencedDeclaration": 1033, - "src": "2115:28:7", + "src": "2140:28:7", "typeDescriptions": { "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)" } }, - "id": 1201, + "id": 1203, "isConstant": false, "isLValue": false, "isPure": false, @@ -2306,7 +2334,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2115:30:7", + "src": "2140:30:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", @@ -2314,22 +2342,22 @@ } }, "nodeType": "VariableDeclarationStatement", - "src": "2089:56:7" + "src": "2114:56:7" }, { "assignments": [ - 1204 + 1206 ], "declarations": [ { "constant": false, - "id": 1204, + "id": 1206, "mutability": "mutable", "name": "tokenAmount", - "nameLocation": "2159:11:7", + "nameLocation": "2184:11:7", "nodeType": "VariableDeclaration", - "scope": 1308, - "src": "2151:19:7", + "scope": 1311, + "src": "2176:19:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -2337,10 +2365,10 @@ "typeString": "uint256" }, "typeName": { - "id": 1203, + "id": 1205, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "2151:7:7", + "src": "2176:7:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -2349,13 +2377,13 @@ "visibility": "internal" } ], - "id": 1221, + "id": 1223, "initialValue": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 1220, + "id": 1222, "isConstant": false, "isLValue": false, "isPure": false, @@ -2367,7 +2395,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 1217, + "id": 1219, "isConstant": false, "isLValue": false, "isPure": false, @@ -2377,32 +2405,32 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 1209, + "id": 1211, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "baseExpression": { - "id": 1205, + "id": 1207, "name": "prices", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1056, - "src": "2174:6:7", + "src": "2199:6:7", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" } }, - "id": 1207, + "id": 1209, "indexExpression": { - "id": 1206, + "id": 1208, "name": "currency", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1165, - "src": "2181:8:7", + "referencedDeclaration": 1167, + "src": "2206:8:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -2413,7 +2441,7 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "2174:16:7", + "src": "2199:16:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -2422,18 +2450,18 @@ "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { - "id": 1208, + "id": 1210, "name": "amount", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1167, - "src": "2199:6:7", + "referencedDeclaration": 1169, + "src": "2224:6:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "2174:31:7", + "src": "2199:31:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -2448,21 +2476,21 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 1215, + "id": 1217, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "hexValue": "3130", - "id": 1210, + "id": 1212, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "2215:2:7", + "src": "2240:2:7", "typeDescriptions": { "typeIdentifier": "t_rational_10_by_1", "typeString": "int_const 10" @@ -2478,21 +2506,21 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 1213, + "id": 1215, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "hexValue": "3138", - "id": 1211, + "id": 1213, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "2222:2:7", + "src": "2247:2:7", "typeDescriptions": { "typeIdentifier": "t_rational_18_by_1", "typeString": "int_const 18" @@ -2502,72 +2530,72 @@ "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { - "id": 1212, + "id": 1214, "name": "currencyDecimal", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1196, - "src": "2227:15:7", + "referencedDeclaration": 1198, + "src": "2252:15:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "2222:20:7", + "src": "2247:20:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], - "id": 1214, + "id": 1216, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", - "src": "2221:22:7", + "src": "2246:22:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "2215:28:7", + "src": "2240:28:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], - "id": 1216, + "id": 1218, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", - "src": "2214:30:7", + "src": "2239:30:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "2174:70:7", + "src": "2199:70:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], - "id": 1218, + "id": 1220, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", - "src": "2173:72:7", + "src": "2198:72:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -2576,40 +2604,40 @@ "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { - "id": 1219, + "id": 1221, "name": "ROUND", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1048, - "src": "2248:5:7", + "src": "2273:5:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "2173:80:7", + "src": "2198:80:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", - "src": "2151:102:7" + "src": "2176:102:7" }, { "assignments": [ - 1223 + 1225 ], "declarations": [ { "constant": false, - "id": 1223, + "id": 1225, "mutability": "mutable", "name": "buyer", - "nameLocation": "2267:5:7", + "nameLocation": "2292:5:7", "nodeType": "VariableDeclaration", - "scope": 1308, - "src": "2259:13:7", + "scope": 1311, + "src": "2284:13:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -2617,10 +2645,10 @@ "typeString": "address" }, "typeName": { - "id": 1222, + "id": 1224, "name": "address", "nodeType": "ElementaryTypeName", - "src": "2259:7:7", + "src": "2284:7:7", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -2630,23 +2658,23 @@ "visibility": "internal" } ], - "id": 1226, + "id": 1228, "initialValue": { "arguments": [], "expression": { "argumentTypes": [], - "id": 1224, + "id": 1226, "name": "_msgSender", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1009, - "src": "2275:10:7", + "src": "2300:10:7", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$__$returns$_t_address_$", "typeString": "function () view returns (address)" } }, - "id": 1225, + "id": 1227, "isConstant": false, "isLValue": false, "isPure": false, @@ -2654,7 +2682,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2275:12:7", + "src": "2300:12:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_address", @@ -2662,7 +2690,7 @@ } }, "nodeType": "VariableDeclarationStatement", - "src": "2259:28:7" + "src": "2284:28:7" }, { "expression": { @@ -2672,7 +2700,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 1235, + "id": 1237, "isConstant": false, "isLValue": false, "isPure": false, @@ -2680,12 +2708,12 @@ "leftExpression": { "arguments": [ { - "id": 1232, + "id": 1234, "name": "seller", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1052, - "src": "2339:6:7", + "src": "2364:6:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -2702,12 +2730,12 @@ "expression": { "arguments": [ { - "id": 1229, + "id": 1231, "name": "tokenAddress", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1050, - "src": "2315:12:7", + "src": "2340:12:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -2721,18 +2749,18 @@ "typeString": "address" } ], - "id": 1228, + "id": 1230, "name": "IERC20", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 255, - "src": "2308:6:7", + "src": "2333:6:7", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_IERC20_$255_$", "typeString": "type(contract IERC20)" } }, - "id": 1230, + "id": 1232, "isConstant": false, "isLValue": false, "isPure": false, @@ -2740,14 +2768,14 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2308:20:7", + "src": "2333:20:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_contract$_IERC20_$255", "typeString": "contract IERC20" } }, - "id": 1231, + "id": 1233, "isConstant": false, "isLValue": false, "isPure": false, @@ -2755,13 +2783,13 @@ "memberName": "balanceOf", "nodeType": "MemberAccess", "referencedDeclaration": 212, - "src": "2308:30:7", + "src": "2333:30:7", "typeDescriptions": { "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$", "typeString": "function (address) view external returns (uint256)" } }, - "id": 1233, + "id": 1235, "isConstant": false, "isLValue": false, "isPure": false, @@ -2769,7 +2797,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2308:38:7", + "src": "2333:38:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", @@ -2779,18 +2807,18 @@ "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { - "id": 1234, + "id": 1236, "name": "tokenAmount", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1204, - "src": "2350:11:7", + "referencedDeclaration": 1206, + "src": "2375:11:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "2308:53:7", + "src": "2333:53:7", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -2798,14 +2826,14 @@ }, { "hexValue": "4245546f6b656e4d616c6c3a2073656c6c657220646f65736e2774206861766520656e6f75676820746f6b656e20746f2073656c6c2074686973206974656d", - "id": 1236, + "id": 1238, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2369:65:7", + "src": "2394:65:7", "typeDescriptions": { "typeIdentifier": "t_stringliteral_73f0bd8e523cff2e504592c44e9195f4613827bfc123cfd9764579cdf471a09e", "typeString": "literal_string \"BETokenMall: seller doesn't have enough token to sell this item\"" @@ -2824,7 +2852,7 @@ "typeString": "literal_string \"BETokenMall: seller doesn't have enough token to sell this item\"" } ], - "id": 1227, + "id": 1229, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ @@ -2832,13 +2860,13 @@ 4294967278 ], "referencedDeclaration": 4294967278, - "src": "2293:7:7", + "src": "2318:7:7", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 1237, + "id": 1239, "isConstant": false, "isLValue": false, "isPure": false, @@ -2846,16 +2874,16 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2293:147:7", + "src": "2318:147:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 1238, + "id": 1240, "nodeType": "ExpressionStatement", - "src": "2293:147:7" + "src": "2318:147:7" }, { "expression": { @@ -2865,7 +2893,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 1251, + "id": 1253, "isConstant": false, "isLValue": false, "isPure": false, @@ -2873,12 +2901,12 @@ "leftExpression": { "arguments": [ { - "id": 1244, + "id": 1246, "name": "seller", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1052, - "src": "2492:6:7", + "src": "2517:6:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -2887,14 +2915,14 @@ { "arguments": [ { - "id": 1247, + "id": 1249, "name": "this", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4294967268, - "src": "2508:4:7", + "src": "2533:4:7", "typeDescriptions": { - "typeIdentifier": "t_contract$_BETokenMall_$1310", + "typeIdentifier": "t_contract$_BETokenMall_$1313", "typeString": "contract BETokenMall" } } @@ -2902,30 +2930,30 @@ "expression": { "argumentTypes": [ { - "typeIdentifier": "t_contract$_BETokenMall_$1310", + "typeIdentifier": "t_contract$_BETokenMall_$1313", "typeString": "contract BETokenMall" } ], - "id": 1246, + "id": 1248, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", - "src": "2500:7:7", + "src": "2525:7:7", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": { - "id": 1245, + "id": 1247, "name": "address", "nodeType": "ElementaryTypeName", - "src": "2500:7:7", + "src": "2525:7:7", "typeDescriptions": {} } }, - "id": 1248, + "id": 1250, "isConstant": false, "isLValue": false, "isPure": false, @@ -2933,7 +2961,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2500:13:7", + "src": "2525:13:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_address", @@ -2955,12 +2983,12 @@ "expression": { "arguments": [ { - "id": 1241, + "id": 1243, "name": "tokenAddress", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1050, - "src": "2468:12:7", + "src": "2493:12:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -2974,18 +3002,18 @@ "typeString": "address" } ], - "id": 1240, + "id": 1242, "name": "IERC20", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 255, - "src": "2461:6:7", + "src": "2486:6:7", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_IERC20_$255_$", "typeString": "type(contract IERC20)" } }, - "id": 1242, + "id": 1244, "isConstant": false, "isLValue": false, "isPure": false, @@ -2993,14 +3021,14 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2461:20:7", + "src": "2486:20:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_contract$_IERC20_$255", "typeString": "contract IERC20" } }, - "id": 1243, + "id": 1245, "isConstant": false, "isLValue": false, "isPure": false, @@ -3008,13 +3036,13 @@ "memberName": "allowance", "nodeType": "MemberAccess", "referencedDeclaration": 232, - "src": "2461:30:7", + "src": "2486:30:7", "typeDescriptions": { "typeIdentifier": "t_function_external_view$_t_address_$_t_address_$returns$_t_uint256_$", "typeString": "function (address,address) view external returns (uint256)" } }, - "id": 1249, + "id": 1251, "isConstant": false, "isLValue": false, "isPure": false, @@ -3022,7 +3050,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2461:53:7", + "src": "2486:53:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", @@ -3032,18 +3060,18 @@ "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { - "id": 1250, + "id": 1252, "name": "tokenAmount", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1204, - "src": "2518:11:7", + "referencedDeclaration": 1206, + "src": "2543:11:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "2461:68:7", + "src": "2486:68:7", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -3051,14 +3079,14 @@ }, { "hexValue": "4245546f6b656e4d616c6c3a2073656c6c657220646f65736e277420617070726f766520656e6f75676820746f6b656e20746f2073656c6c2074686973206974656d", - "id": 1252, + "id": 1254, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2537:68:7", + "src": "2562:68:7", "typeDescriptions": { "typeIdentifier": "t_stringliteral_b12657b3b75653fe46056178646066dddbc146c37547191bc3f6947332d91116", "typeString": "literal_string \"BETokenMall: seller doesn't approve enough token to sell this item\"" @@ -3077,7 +3105,7 @@ "typeString": "literal_string \"BETokenMall: seller doesn't approve enough token to sell this item\"" } ], - "id": 1239, + "id": 1241, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ @@ -3085,13 +3113,13 @@ 4294967278 ], "referencedDeclaration": 4294967278, - "src": "2446:7:7", + "src": "2471:7:7", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 1253, + "id": 1255, "isConstant": false, "isLValue": false, "isPure": false, @@ -3099,16 +3127,16 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2446:165:7", + "src": "2471:165:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 1254, + "id": 1256, "nodeType": "ExpressionStatement", - "src": "2446:165:7" + "src": "2471:165:7" }, { "expression": { @@ -3118,7 +3146,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 1263, + "id": 1265, "isConstant": false, "isLValue": false, "isPure": false, @@ -3126,12 +3154,12 @@ "leftExpression": { "arguments": [ { - "id": 1260, + "id": 1262, "name": "buyer", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1223, - "src": "2707:5:7", + "referencedDeclaration": 1225, + "src": "2732:5:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -3148,12 +3176,12 @@ "expression": { "arguments": [ { - "id": 1257, + "id": 1259, "name": "currency", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1165, - "src": "2687:8:7", + "referencedDeclaration": 1167, + "src": "2712:8:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -3167,18 +3195,18 @@ "typeString": "address" } ], - "id": 1256, + "id": 1258, "name": "IERC20", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 255, - "src": "2680:6:7", + "src": "2705:6:7", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_IERC20_$255_$", "typeString": "type(contract IERC20)" } }, - "id": 1258, + "id": 1260, "isConstant": false, "isLValue": false, "isPure": false, @@ -3186,14 +3214,14 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2680:16:7", + "src": "2705:16:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_contract$_IERC20_$255", "typeString": "contract IERC20" } }, - "id": 1259, + "id": 1261, "isConstant": false, "isLValue": false, "isPure": false, @@ -3201,13 +3229,13 @@ "memberName": "balanceOf", "nodeType": "MemberAccess", "referencedDeclaration": 212, - "src": "2680:26:7", + "src": "2705:26:7", "typeDescriptions": { "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$", "typeString": "function (address) view external returns (uint256)" } }, - "id": 1261, + "id": 1263, "isConstant": false, "isLValue": false, "isPure": false, @@ -3215,7 +3243,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2680:33:7", + "src": "2705:33:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", @@ -3225,18 +3253,18 @@ "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { - "id": 1262, + "id": 1264, "name": "amount", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1167, - "src": "2717:6:7", + "referencedDeclaration": 1169, + "src": "2742:6:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "2680:43:7", + "src": "2705:43:7", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -3244,14 +3272,14 @@ }, { "hexValue": "4245546f6b656e4d616c6c3a20627579657220646f65736e2774206861766520656e6f75676820746f6b656e20746f206275792074686973206974656d", - "id": 1264, + "id": 1266, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2731:63:7", + "src": "2756:63:7", "typeDescriptions": { "typeIdentifier": "t_stringliteral_980c03874b76c6d251144dea5acdce60498a10f246b9b561224499303c2b93f7", "typeString": "literal_string \"BETokenMall: buyer doesn't have enough token to buy this item\"" @@ -3270,7 +3298,7 @@ "typeString": "literal_string \"BETokenMall: buyer doesn't have enough token to buy this item\"" } ], - "id": 1255, + "id": 1257, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ @@ -3278,13 +3306,13 @@ 4294967278 ], "referencedDeclaration": 4294967278, - "src": "2665:7:7", + "src": "2690:7:7", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 1265, + "id": 1267, "isConstant": false, "isLValue": false, "isPure": false, @@ -3292,16 +3320,16 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2665:135:7", + "src": "2690:135:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 1266, + "id": 1268, "nodeType": "ExpressionStatement", - "src": "2665:135:7" + "src": "2690:135:7" }, { "expression": { @@ -3311,7 +3339,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 1279, + "id": 1281, "isConstant": false, "isLValue": false, "isPure": false, @@ -3319,12 +3347,12 @@ "leftExpression": { "arguments": [ { - "id": 1272, + "id": 1274, "name": "buyer", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1223, - "src": "2848:5:7", + "referencedDeclaration": 1225, + "src": "2873:5:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -3333,14 +3361,14 @@ { "arguments": [ { - "id": 1275, + "id": 1277, "name": "this", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4294967268, - "src": "2863:4:7", + "src": "2888:4:7", "typeDescriptions": { - "typeIdentifier": "t_contract$_BETokenMall_$1310", + "typeIdentifier": "t_contract$_BETokenMall_$1313", "typeString": "contract BETokenMall" } } @@ -3348,30 +3376,30 @@ "expression": { "argumentTypes": [ { - "typeIdentifier": "t_contract$_BETokenMall_$1310", + "typeIdentifier": "t_contract$_BETokenMall_$1313", "typeString": "contract BETokenMall" } ], - "id": 1274, + "id": 1276, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", - "src": "2855:7:7", + "src": "2880:7:7", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": { - "id": 1273, + "id": 1275, "name": "address", "nodeType": "ElementaryTypeName", - "src": "2855:7:7", + "src": "2880:7:7", "typeDescriptions": {} } }, - "id": 1276, + "id": 1278, "isConstant": false, "isLValue": false, "isPure": false, @@ -3379,7 +3407,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2855:13:7", + "src": "2880:13:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_address", @@ -3401,12 +3429,12 @@ "expression": { "arguments": [ { - "id": 1269, + "id": 1271, "name": "currency", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1165, - "src": "2828:8:7", + "referencedDeclaration": 1167, + "src": "2853:8:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -3420,18 +3448,18 @@ "typeString": "address" } ], - "id": 1268, + "id": 1270, "name": "IERC20", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 255, - "src": "2821:6:7", + "src": "2846:6:7", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_IERC20_$255_$", "typeString": "type(contract IERC20)" } }, - "id": 1270, + "id": 1272, "isConstant": false, "isLValue": false, "isPure": false, @@ -3439,14 +3467,14 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2821:16:7", + "src": "2846:16:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_contract$_IERC20_$255", "typeString": "contract IERC20" } }, - "id": 1271, + "id": 1273, "isConstant": false, "isLValue": false, "isPure": false, @@ -3454,13 +3482,13 @@ "memberName": "allowance", "nodeType": "MemberAccess", "referencedDeclaration": 232, - "src": "2821:26:7", + "src": "2846:26:7", "typeDescriptions": { "typeIdentifier": "t_function_external_view$_t_address_$_t_address_$returns$_t_uint256_$", "typeString": "function (address,address) view external returns (uint256)" } }, - "id": 1277, + "id": 1279, "isConstant": false, "isLValue": false, "isPure": false, @@ -3468,7 +3496,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2821:48:7", + "src": "2846:48:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", @@ -3478,18 +3506,18 @@ "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { - "id": 1278, + "id": 1280, "name": "amount", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1167, - "src": "2873:6:7", + "referencedDeclaration": 1169, + "src": "2898:6:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "2821:58:7", + "src": "2846:58:7", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -3497,14 +3525,14 @@ }, { "hexValue": "4245546f6b656e4d616c6c3a20627579657220646f65736e277420617070726f766520656e6f75676820746f6b656e20746f206275792074686973206974656d", - "id": 1280, + "id": 1282, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2887:66:7", + "src": "2912:66:7", "typeDescriptions": { "typeIdentifier": "t_stringliteral_157fc5858d6b0d54de2cbea831cc967ea7927dd4aaad4520576b575909c099a9", "typeString": "literal_string \"BETokenMall: buyer doesn't approve enough token to buy this item\"" @@ -3523,7 +3551,7 @@ "typeString": "literal_string \"BETokenMall: buyer doesn't approve enough token to buy this item\"" } ], - "id": 1267, + "id": 1269, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ @@ -3531,13 +3559,13 @@ 4294967278 ], "referencedDeclaration": 4294967278, - "src": "2806:7:7", + "src": "2831:7:7", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 1281, + "id": 1283, "isConstant": false, "isLValue": false, "isPure": false, @@ -3545,51 +3573,51 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2806:153:7", + "src": "2831:153:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 1282, + "id": 1284, "nodeType": "ExpressionStatement", - "src": "2806:153:7" + "src": "2831:153:7" }, { "expression": { "arguments": [ { - "id": 1287, + "id": 1289, "name": "buyer", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1223, - "src": "3034:5:7", + "referencedDeclaration": 1225, + "src": "3059:5:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, { - "id": 1288, + "id": 1290, "name": "feeToAddress", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1319, - "src": "3041:12:7", + "referencedDeclaration": 1322, + "src": "3066:12:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, { - "id": 1289, + "id": 1291, "name": "amount", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1167, - "src": "3055:6:7", + "referencedDeclaration": 1169, + "src": "3080:6:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3614,12 +3642,12 @@ "expression": { "arguments": [ { - "id": 1284, + "id": 1286, "name": "currency", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1165, - "src": "3007:8:7", + "referencedDeclaration": 1167, + "src": "3032:8:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -3633,18 +3661,18 @@ "typeString": "address" } ], - "id": 1283, + "id": 1285, "name": "IERC20", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 255, - "src": "3000:6:7", + "src": "3025:6:7", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_IERC20_$255_$", "typeString": "type(contract IERC20)" } }, - "id": 1285, + "id": 1287, "isConstant": false, "isLValue": false, "isPure": false, @@ -3652,14 +3680,14 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "3000:16:7", + "src": "3025:16:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_contract$_IERC20_$255", "typeString": "contract IERC20" } }, - "id": 1286, + "id": 1288, "isConstant": false, "isLValue": false, "isPure": false, @@ -3667,13 +3695,13 @@ "memberName": "safeTransferFrom", "nodeType": "MemberAccess", "referencedDeclaration": 351, - "src": "3000:33:7", + "src": "3025:33:7", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20_$255_$_t_address_$_t_address_$_t_uint256_$returns$__$bound_to$_t_contract$_IERC20_$255_$", "typeString": "function (contract IERC20,address,address,uint256)" } }, - "id": 1290, + "id": 1292, "isConstant": false, "isLValue": false, "isPure": false, @@ -3681,51 +3709,51 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "3000:62:7", + "src": "3025:62:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 1291, + "id": 1293, "nodeType": "ExpressionStatement", - "src": "3000:62:7" + "src": "3025:62:7" }, { "expression": { "arguments": [ { - "id": 1296, + "id": 1298, "name": "seller", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1052, - "src": "3137:6:7", + "src": "3162:6:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, { - "id": 1297, + "id": 1299, "name": "buyer", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1223, - "src": "3145:5:7", + "referencedDeclaration": 1225, + "src": "3170:5:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, { - "id": 1298, + "id": 1300, "name": "tokenAmount", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1204, - "src": "3152:11:7", + "referencedDeclaration": 1206, + "src": "3177:11:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3750,12 +3778,12 @@ "expression": { "arguments": [ { - "id": 1293, + "id": 1295, "name": "tokenAddress", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1050, - "src": "3106:12:7", + "src": "3131:12:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -3769,18 +3797,18 @@ "typeString": "address" } ], - "id": 1292, + "id": 1294, "name": "IERC20", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 255, - "src": "3099:6:7", + "src": "3124:6:7", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_IERC20_$255_$", "typeString": "type(contract IERC20)" } }, - "id": 1294, + "id": 1296, "isConstant": false, "isLValue": false, "isPure": false, @@ -3788,14 +3816,14 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "3099:20:7", + "src": "3124:20:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_contract$_IERC20_$255", "typeString": "contract IERC20" } }, - "id": 1295, + "id": 1297, "isConstant": false, "isLValue": false, "isPure": false, @@ -3803,13 +3831,13 @@ "memberName": "safeTransferFrom", "nodeType": "MemberAccess", "referencedDeclaration": 351, - "src": "3099:37:7", + "src": "3124:37:7", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_contract$_IERC20_$255_$_t_address_$_t_address_$_t_uint256_$returns$__$bound_to$_t_contract$_IERC20_$255_$", "typeString": "function (contract IERC20,address,address,uint256)" } }, - "id": 1299, + "id": 1301, "isConstant": false, "isLValue": false, "isPure": false, @@ -3817,51 +3845,27 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "3099:65:7", + "src": "3124:65:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 1300, + "id": 1302, "nodeType": "ExpressionStatement", - "src": "3099:65:7" + "src": "3124:65:7" }, { "eventCall": { "arguments": [ { - "id": 1302, + "id": 1304, "name": "buyer", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1223, - "src": "3212:5:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "id": 1303, - "name": "tokenAddress", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1050, - "src": "3219:12:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "id": 1304, - "name": "currency", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1165, - "src": "3233:8:7", + "referencedDeclaration": 1225, + "src": "3237:5:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -3869,11 +3873,47 @@ }, { "id": 1305, - "name": "amount", + "name": "tokenAddress", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1050, + "src": "3244:12:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 1306, + "name": "currency", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1167, - "src": "3243:6:7", + "src": "3258:8:7", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 1307, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1169, + "src": "3268:6:7", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 1308, + "name": "tokenAmount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1206, + "src": "3276:11:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3894,23 +3934,27 @@ "typeIdentifier": "t_address", "typeString": "address" }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], - "id": 1301, + "id": 1303, "name": "BuyTransaction", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1066, - "src": "3197:14:7", + "referencedDeclaration": 1068, + "src": "3222:14:7", "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,address,address,uint256)" + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_uint256_$returns$__$", + "typeString": "function (address,address,address,uint256,uint256)" } }, - "id": 1306, + "id": 1309, "isConstant": false, "isLValue": false, "isPure": false, @@ -3918,60 +3962,60 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "3197:53:7", + "src": "3222:66:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 1307, + "id": 1310, "nodeType": "EmitStatement", - "src": "3192:58:7" + "src": "3217:71:7" } ] }, "documentation": { - "id": 1163, + "id": 1165, "nodeType": "StructuredDocumentation", - "src": "1744:29:7", + "src": "1769:29:7", "text": " @dev Buy token" }, "functionSelector": "68f8fc10", - "id": 1309, + "id": 1312, "implemented": true, "kind": "function", "modifiers": [ { - "id": 1170, + "id": 1172, "kind": "modifierInvocation", "modifierName": { - "id": 1169, + "id": 1171, "name": "nonReentrant", "nodeType": "IdentifierPath", "referencedDeclaration": 142, - "src": "1837:12:7" + "src": "1862:12:7" }, "nodeType": "ModifierInvocation", - "src": "1837:12:7" + "src": "1862:12:7" } ], "name": "buyToken", - "nameLocation": "1785:8:7", + "nameLocation": "1810:8:7", "nodeType": "FunctionDefinition", "parameters": { - "id": 1168, + "id": 1170, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 1165, + "id": 1167, "mutability": "mutable", "name": "currency", - "nameLocation": "1802:8:7", + "nameLocation": "1827:8:7", "nodeType": "VariableDeclaration", - "scope": 1309, - "src": "1794:16:7", + "scope": 1312, + "src": "1819:16:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -3979,10 +4023,10 @@ "typeString": "address" }, "typeName": { - "id": 1164, + "id": 1166, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1794:7:7", + "src": "1819:7:7", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -3993,13 +4037,13 @@ }, { "constant": false, - "id": 1167, + "id": 1169, "mutability": "mutable", "name": "amount", - "nameLocation": "1820:6:7", + "nameLocation": "1845:6:7", "nodeType": "VariableDeclaration", - "scope": 1309, - "src": "1812:14:7", + "scope": 1312, + "src": "1837:14:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -4007,10 +4051,10 @@ "typeString": "uint256" }, "typeName": { - "id": 1166, + "id": 1168, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "1812:7:7", + "src": "1837:7:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -4019,27 +4063,27 @@ "visibility": "internal" } ], - "src": "1793:34:7" + "src": "1818:34:7" }, "returnParameters": { - "id": 1171, + "id": 1173, "nodeType": "ParameterList", "parameters": [], - "src": "1850:0:7" + "src": "1875:0:7" }, - "scope": 1310, - "src": "1776:1479:7", + "scope": 1313, + "src": "1801:1492:7", "stateMutability": "nonpayable", "virtual": false, "visibility": "external" } ], - "scope": 1311, - "src": "387:2870:7", + "scope": 1314, + "src": "387:2908:7", "usedErrors": [] } ], - "src": "32:3226:7" + "src": "32:3264:7" }, "compiler": { "name": "solc", @@ -4047,7 +4091,7 @@ }, "networks": {}, "schemaVersion": "3.4.11", - "updatedAt": "2023-07-27T08:09:28.498Z", + "updatedAt": "2023-07-27T08:36:07.468Z", "devdoc": { "kind": "dev", "methods": { diff --git a/out_arbitrum_testnet_dev.json b/out_arbitrum_testnet_dev.json index e1e4514..6650abc 100644 --- a/out_arbitrum_testnet_dev.json +++ b/out_arbitrum_testnet_dev.json @@ -123,6 +123,6 @@ "name": "BETokenMall", "type": "logic", "json": "assets/contracts/BETokenMall.json", - "address": "0x9110Bc91942E559eebBF19B91cdAf67eEee3F93D" + "address": "0x22557f3fe7fbA53C66a35a3D70527D014704fd4D" } ]