Transaction Hash:
Block:
19516842 at Mar-26-2024 06:30:23 AM +UTC
Transaction Fee:
0.001281826628735886 ETH
$3.16
Gas Used:
70,803 Gas / 18.104128762 Gwei
Emitted Events:
271 |
veAllocate.AllocationSetMultiple( sender=[Sender] 0x9f76ff4176bd5b51799827faaca8a0d8b4a0d343, nft=[0xa27ADe300DCCbA670a3343f149795D242A15aAd3, 0xE6e9ED0f55060770cD81d275d0bD27E9e8a52C3A, 0xd2eA3C7eb474dca37E4a3c1D63658bcDEBF86a64], chainId=[23294, 23294, 23294], amount=[4000, 4000, 2000] )
|
Account State Difference:
Address | Before | After | State Difference | ||
---|---|---|---|---|---|
0x4838B106...B0BAD5f97
Miner
| (Titan Builder) | 6.243323319437775011 Eth | 6.243324750310612247 Eth | 0.000001430872837236 | |
0x55567E03...5029822d3 | |||||
0x9F76FF41...8B4a0d343 |
0.099613974221066396 Eth
Nonce: 50
|
0.09833214759233051 Eth
Nonce: 51
| 0.001281826628735886 |
Execution Trace
veAllocate.setBatchAllocation( amount=[4000, 4000, 2000], nft=[0xa27ADe300DCCbA670a3343f149795D242A15aAd3, 0xE6e9ED0f55060770cD81d275d0bD27E9e8a52C3A, 0xd2eA3C7eb474dca37E4a3c1D63658bcDEBF86a64], chainId=[23294, 23294, 23294] )
setBatchAllocation[veAllocate (ln:48)]
AllocationSetMultiple[veAllocate (ln:64)]
pragma solidity ^0.8.12; // Copyright BigchainDB GmbH and Ocean Protocol contributors // SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0) // Code is Apache-2.0 and docs are CC-BY-4.0 contract veAllocate { mapping(address => mapping(address => mapping(uint256 => uint256))) private veAllocation; mapping(address => uint256) private _totalAllocation; event AllocationSet( address indexed sender, address indexed nft, uint256 indexed chainId, uint256 amount ); event AllocationSetMultiple( address indexed sender, address[] nft, uint256[] chainId, uint256[] amount ); function getveAllocation( address user, address nft, uint256 chainid ) external view returns (uint256) { return veAllocation[user][nft][chainid]; } function getTotalAllocation(address user) public view returns (uint256) { return _totalAllocation[user]; } function setAllocation( uint256 amount, address nft, uint256 chainId ) external { _totalAllocation[msg.sender] = _totalAllocation[msg.sender] + amount - veAllocation[msg.sender][nft][chainId]; require(_totalAllocation[msg.sender] <= 10000, "Max Allocation"); veAllocation[msg.sender][nft][chainId] = amount; emit AllocationSet(msg.sender, nft, chainId, amount); } function setBatchAllocation( uint256[] calldata amount, address[] calldata nft, uint256[] calldata chainId ) external { require(amount.length <= 150, 'Too Many Operations'); require(amount.length == nft.length, 'Nft array size missmatch'); require(amount.length == chainId.length, 'Chain array size missmatch'); for (uint256 i = 0; i < amount.length; i++) { _totalAllocation[msg.sender] = _totalAllocation[msg.sender] + amount[i] - veAllocation[msg.sender][nft[i]][chainId[i]]; veAllocation[msg.sender][nft[i]][chainId[i]] = amount[i]; } require(_totalAllocation[msg.sender] <= 10000, "Max Allocation"); emit AllocationSetMultiple(msg.sender, nft, chainId, amount); } }