Back to Home

IterableAddressBalanceMapping

0xe4f9d75ab37b...362f771c53de
HomesteadExact Bytecode MatchEdit this contract
Deployed June 30, 2016 (10 years ago)Block 1,799,087

IterableAddressBalanceMapping, a Solidity library from the GX-Coin (GreatCoin) trading platform that keeps an iterable map of trader addresses to coin and dollar balances.

Homestead EraVerified Source
Key Facts
Deployment Block
1,799,087
Deployment Date
Jun 30, 2016, 12:59 PM
Code Size
1.3 KB

Description

IterableAddressBalanceMapping is a library used by the GX-Coin (GreatCoin) contracts. It operates on a caller's storage struct holding a mapping from address to an entry (key index, a uint32 coin balance and an int160 dollar balance), an array of keys and a size counter, so the GreatCoin contracts could both look up a trader's balances and iterate over every trader. add() inserts an address with starting balances, remove() deletes it, contains(), valueOf(), valueOfCoinBalance() and valueOfDollarBalance() read entries, setCoinBalance(), setDollarBalance(), addCoinAmount() and addDollarAmount() update them, and iterateStart(), iterateValid(), iterateNext(), iterateGet() and length() walk the key array. iterateNext() uses a post-increment, so it returns the index it was given rather than the next one. GX-Coin's 1.5.2 gooseberry release file names this address as its iterableAddressBalanceMapping library, linked into the GreatCoin, traders, admins and orders contracts deployed alongside it.

Source Verified

SolidityExact bytecode match(1,374 bytes)
Compiler: v0.2.2-

Original source: https://github.com/GX-Coin/SmartContract/blob/ea5162c0ed05af53122ddaf94a41057503b66aec/contracts/libraries.sol (optimizer on). Exact creation and runtime match. Verified on Etherscan.

Bytecode Overview

Opcodes1,374
Unique Opcodes117
Jump Instructions82
Storage Operations45

External Links