false
true
0
PulseChain
Blockchain
Blocks
Blocks
Uncles
Forked Blocks (Reorgs)
Transactions
Confirmed
Pending
Verified contracts
Tokens
All
PLS
APIs
GraphQL
RPC
Eth RPC
Apps
PulseChain Beacon Explorer
PulseX
PulseChain Bridge
Become a Validator
PulseChain
Mainnets
PulseChain Mainnet
Testnets
Testnet V4
/
Search
/
Search
Connection Lost
New Solidity Smart Contract Verification
Contract Address
The 0x address supplied on contract creation.
Is Yul contract
No
Yes
Select Yes if you want to verify Yul contract.
Contract Name
Must match the name specified in the code. For example, in
contract MyContract {..}
MyContract
is the contract name.
Include nightly builds
No
Yes
Select yes if you want to show nightly builds.
Compiler
v0.8.35-pre.1+commit.a99b6d8c
v0.8.34+commit.80d5c536
v0.8.33+commit.64118f21
v0.8.32+commit.ebbd65e5
v0.8.31+commit.fd3a2265
v0.8.31-pre.1+commit.b59566f6
v0.8.30+commit.73712a01
v0.8.29+commit.ab55807c
v0.8.28+commit.7893614a
v0.8.27+commit.40a35a09
v0.8.26+commit.8a97fa7a
v0.8.25+commit.b61c2a91
v0.8.24+commit.e11b9ed9
v0.8.23+commit.f704f362
v0.8.22+commit.4fc1097e
v0.8.21+commit.d9974bed
v0.8.20+commit.a1b79de6
v0.8.19+commit.7dd6d404
v0.8.18+commit.87f61d96
v0.8.17+commit.8df45f5f
v0.8.16+commit.07a7930e
v0.8.15+commit.e14f2714
v0.8.14+commit.80d49f37
v0.8.13+commit.abaa5c0e
v0.8.12+commit.f00d7308
v0.8.11+commit.d7f03943
v0.8.10+commit.fc410830
v0.8.9+commit.e5eed63a
v0.8.8+commit.dddeac2f
v0.8.7+commit.e28d00a7
v0.8.6+commit.11564f7e
v0.8.5+commit.a4f2e591
v0.8.4+commit.c7e474f2
v0.8.3+commit.8d00100c
v0.8.2+commit.661d1103
v0.8.1+commit.df193b15
v0.8.0+commit.c7dfd78e
v0.7.6+commit.7338295f
v0.7.5+commit.eb77ed08
v0.7.4+commit.3f05b770
v0.7.3+commit.9bfce1f6
v0.7.2+commit.51b20bc0
v0.7.1+commit.f4a555be
v0.7.0+commit.9e61f92b
v0.6.12+commit.27d51765
v0.6.11+commit.5ef660b1
v0.6.10+commit.00c0fcaf
v0.6.9+commit.3e3065ac
v0.6.8+commit.0bbfe453
v0.6.7+commit.b8d736ae
v0.6.6+commit.6c089d02
v0.6.5+commit.f956cc89
v0.6.4+commit.1dca32f3
v0.6.3+commit.8dda9521
v0.6.2+commit.bacdbe57
v0.6.1+commit.e6f7d5a4
v0.6.0+commit.26b70077
v0.5.17+commit.d19bba13
v0.5.16+commit.9c3226ce
v0.5.15+commit.6a57276f
v0.5.14+commit.01f1aaa4
v0.5.13+commit.5b0b510c
v0.5.12+commit.7709ece9
v0.5.11+commit.22be8592
v0.5.10+commit.5a6ea5b1
v0.5.9+commit.c68bc34e
v0.5.8+commit.23d335f2
v0.5.7+commit.6da8b019
v0.5.6+commit.b259423e
v0.5.5+commit.47a71e8f
v0.5.4+commit.9549d8ff
v0.5.3+commit.10d17f24
v0.5.2+commit.1df8f40c
v0.5.1+commit.c8a2cb62
v0.5.0+commit.1d4f565a
v0.4.26+commit.4563c3fc
v0.4.25+commit.59dbf8f1
v0.4.24+commit.e67f0147
v0.4.23+commit.124ca40d
v0.4.22+commit.4cb486ee
v0.4.21+commit.dfe3193c
v0.4.20+commit.3155dd80
v0.4.19+commit.c4cbbb05
v0.4.18+commit.9cf6e910
v0.4.17+commit.bdeb9e52
v0.4.16+commit.d7661dd9
v0.4.15+commit.8b45bddb
v0.4.14+commit.c2215d46
v0.4.13+commit.0fb4cb1a
v0.4.12+commit.194ff033
v0.4.11+commit.68ef5810
v0.4.10+commit.9e8cc01b
The compiler version is specified in
pragma solidity X.X.X
. Use the compiler version rather than the nightly build. If using the Solidity compiler, run
solc —version
to check.
EVM Version
homestead
tangerineWhistle
spuriousDragon
byzantium
constantinople
petersburg
istanbul
berlin
london
paris
shanghai
default
The EVM version the contract is written for. If the bytecode does not match the version, we try to verify using the latest EVM version.
EVM version details
.
Optimization
No
Yes
If you enabled optimization during compilation, select yes.
Optimization runs
Enter the Solidity Contract Code
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IUniswapV2Pair { function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function token0() external view returns (address); function token1() external view returns (address); } interface IERC20Decimals { function decimals() external view returns (uint8); } library FixedPoint { struct uq112x112 { uint224 _x; } struct uq144x112 { uint _x; } uint8 private constant RESOLUTION = 112; function encode(uint112 x) internal pure returns (uq112x112 memory) { return uq112x112(uint224(x) << RESOLUTION); } function mul(uq112x112 memory self, uint y) internal pure returns (uq144x112 memory) { return uq144x112(self._x * y); } function fraction(uint112 numerator, uint112 denominator) internal pure returns (uq112x112 memory) { if (denominator == 0) revert("FixedPoint: DIV_BY_ZERO"); return uq112x112((uint224(numerator) << RESOLUTION) / denominator); } function decode144(uq144x112 memory self) internal pure returns (uint144) { return uint144(self._x >> RESOLUTION); } // Optimized RPower for reward calculation (Logarithmic time complexity) // Calculates x^n with 1e18 precision to match contract constants function rpow(uint x, uint n) internal pure returns (uint z) { z = n % 2 != 0 ? x : 1e18; for (n /= 2; n != 0; n /= 2) { x = (x * x) / 1e18; if (n % 2 != 0) z = (z * x) / 1e18; } } } library UniswapV2OracleLibrary { using FixedPoint for *; function currentBlockTimestamp() internal view returns (uint) { return block.timestamp; } function currentCumulativePrices(address pair) internal view returns (uint price0Cumulative, uint price1Cumulative, uint blockTimestamp) { blockTimestamp = currentBlockTimestamp(); price0Cumulative = IUniswapV2Pair(pair).price0CumulativeLast(); price1Cumulative = IUniswapV2Pair(pair).price1CumulativeLast(); (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast) = IUniswapV2Pair(pair).getReserves(); if (blockTimestampLast != blockTimestamp) { uint32 timeElapsed = uint32(blockTimestamp - blockTimestampLast); unchecked { price0Cumulative += uint(FixedPoint.fraction(reserve1, reserve0)._x) * timeElapsed; price1Cumulative += uint(FixedPoint.fraction(reserve0, reserve1)._x) * timeElapsed; } } } struct PriceData { uint price0Cumulative; uint price1Cumulative; } function batchCumulativePrices(address[] memory pairs) internal view returns (PriceData[] memory prices, uint blockTimestamp) { blockTimestamp = currentBlockTimestamp(); prices = new PriceData[](pairs.length); for (uint i; i < pairs.length; ) { IUniswapV2Pair pair = IUniswapV2Pair(pairs[i]); uint price0Cumulative = pair.price0CumulativeLast(); uint price1Cumulative = pair.price1CumulativeLast(); (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast) = pair.getReserves(); if (blockTimestampLast != blockTimestamp) { uint32 timeElapsed = uint32(blockTimestamp - blockTimestampLast); unchecked { price0Cumulative += uint(FixedPoint.fraction(reserve1, reserve0)._x) * timeElapsed; price1Cumulative += uint(FixedPoint.fraction(reserve0, reserve1)._x) * timeElapsed; } } prices[i] = PriceData(price0Cumulative, price1Cumulative); unchecked { ++i; } } } } contract TWAPOracle { using FixedPoint for *; struct Observation { uint timestamp; uint price0Cumulative; uint price1Cumulative; } struct ReferenceStable { address stable; address pair; bool isWplsToken0; uint8 stableDecimals; bool active; } struct PairInfo { address pair; bool isToken0; } error UnknownPair(); error PairAlreadyAdded(); error InvalidPair(); error InvalidTWAPWindow(); error Unauthorized(); error PeriodNotElapsed(); error RewardsNotEnabled(); error InsufficientBalanceForReward(); error AlreadyLaunched(); error NoValidReferences(); error StalePrice(); address public immutable wpls; mapping(address => uint) public wards; function rely(address usr) external auth { wards[usr] = 1; emit Rely(usr); } function deny(address usr) external auth { wards[usr] = 0; emit Deny(usr); } modifier auth() { if (wards[msg.sender] != 1) revert Unauthorized(); _; } bool public rewardsEnabled; uint public constant PERIOD_SIZE = 3600; uint public constant MIN_WINDOW = 3600; uint public constant MAX_WINDOW = 18000; uint public constant REWARD_WINDOW = 5400; // Peak at 1.5hr total (0.5hr effective) uint public constant UPDATE_THRESHOLD = 7200; uint public constant DECAY_RATE = 500000000000000000; // 0.5 uint public constant DECAY_PERIOD = 900; string public constant name = "TWAP"; string public constant symbol = "TWAP"; uint8 public constant decimals = 18; uint public totalSupply; mapping(address => uint) public balanceOf; mapping(address => mapping(address => uint)) public allowance; uint public constant BASE_REWARD_RATE = 13888888888888888; uint public constant INITIAL_SUPPLY = 1_000_000 * 10 ** 18; uint public constant MIN_HOLDING_DIVISOR = 555; // OPTIMIZED: Circular Buffer Data mapping(address => Observation[5]) public observations; // pair => observations mapping(address => uint8) public observationHeads; // pair => next write index (0-4) // OPTIMIZED: Unified List for Updates address[] public livePairs; mapping(address => PairInfo) public tokenToPairInfo; address[] public pricedTokens; // REMOVED: mapping(address => uint) public lastUpdateTimestamp; (Redundant, use observation timestamp) ReferenceStable[] public referenceStables; event PriceUpdated(address indexed token, address indexed pair, uint price0Cumulative, uint price1Cumulative, uint timestamp); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); event Reward(address indexed updater, uint amount); event RewardsLaunched(); event Rely(address indexed usr); event Deny(address indexed usr); event ReferenceAdded(address indexed stable, address indexed pair, bool isWplsToken0, uint8 stableDecimals); event ReferenceUpdated(uint indexed index, bool active); event DirectPairAdded(address indexed token, address indexed pair, bool isToken0); event DirectPairRemoved(address indexed token); event SuperUpdate(uint timestamp, uint updatedPairs); uint public lastSuperUpdateTimestamp; constructor(address _wpls) { wpls = _wpls; wards[msg.sender] = 1; emit Rely(msg.sender); totalSupply = INITIAL_SUPPLY; balanceOf[msg.sender] = INITIAL_SUPPLY; emit Transfer(address(0), msg.sender, INITIAL_SUPPLY); } function getMinHoldingForReward() public view returns (uint) { return totalSupply / MIN_HOLDING_DIVISOR; } function launch() external auth { if (rewardsEnabled) revert AlreadyLaunched(); rewardsEnabled = true; emit RewardsLaunched(); } // === REFERENCE STABLES === function addReferenceStable(address stable, address pair, bool isWplsToken0) external auth { address token0 = IUniswapV2Pair(pair).token0(); address token1 = IUniswapV2Pair(pair).token1(); if ((isWplsToken0 && token0 != wpls) || (!isWplsToken0 && token1 != wpls)) revert InvalidPair(); uint8 stableDecimals = IERC20Decimals(stable).decimals(); if (stableDecimals > 18) revert("Stable decimals >18"); referenceStables.push(ReferenceStable(stable, pair, isWplsToken0, stableDecimals, true)); // Initialize Observation (uint price0Cumulative, uint price1Cumulative, ) = UniswapV2OracleLibrary.currentCumulativePrices(pair); observations[pair][0] = Observation(block.timestamp, price0Cumulative, price1Cumulative); observationHeads[pair] = 1; // Next write goes to index 1 // OPTIMIZATION: Add to unified list livePairs.push(pair); emit ReferenceAdded(stable, pair, isWplsToken0, stableDecimals); } function updateReference(uint index, bool active) external auth { if (index >= referenceStables.length) revert("Invalid index"); referenceStables[index].active = active; emit ReferenceUpdated(index, active); } // === DIRECT PAIRS === function addDirectPair(address token, address pair, bool isToken0) external auth { if (tokenToPairInfo[token].pair != address(0)) revert PairAlreadyAdded(); address token0 = IUniswapV2Pair(pair).token0(); address token1 = IUniswapV2Pair(pair).token1(); if ((isToken0 && token0 != token) || (!isToken0 && token1 != token)) revert InvalidPair(); tokenToPairInfo[token] = PairInfo(pair, isToken0); pricedTokens.push(token); // Initialize Observation (uint price0Cumulative, uint price1Cumulative, ) = UniswapV2OracleLibrary.currentCumulativePrices(pair); observations[pair][0] = Observation(block.timestamp, price0Cumulative, price1Cumulative); observationHeads[pair] = 1; // OPTIMIZATION: Add to unified list livePairs.push(pair); emit DirectPairAdded(token, pair, isToken0); } function removeDirectPair(address token) external auth { PairInfo memory info = tokenToPairInfo[token]; if (info.pair == address(0)) revert UnknownPair(); delete tokenToPairInfo[token]; // OPTIMIZATION: Remove from livePairs _removeLivePair(info.pair); // Clean up storage for gas refund delete observations[info.pair]; delete observationHeads[info.pair]; // Remove from pricedTokens for (uint i = 0; i < pricedTokens.length; i++) { if (pricedTokens[i] == token) { pricedTokens[i] = pricedTokens[pricedTokens.length - 1]; pricedTokens.pop(); break; } } emit DirectPairRemoved(token); } // Helper to remove from livePairs array function _removeLivePair(address pair) internal { for (uint i = 0; i < livePairs.length; i++) { if (livePairs[i] == pair) { livePairs[i] = livePairs[livePairs.length - 1]; livePairs.pop(); break; } } } // === OPTIMIZED: superUpdate === function superUpdate() public { uint currentTimestamp = block.timestamp; if (currentTimestamp - lastSuperUpdateTimestamp < MIN_WINDOW) { revert PeriodNotElapsed(); } // OPTIMIZATION: Single Pass Collection // We allocate max memory size to avoid resizing costs. // Since we have < 100 pairs, this is acceptable gas wise vs dynamic pushing. uint totalPairs = livePairs.length; address[] memory pairsToUpdate = new address[](totalPairs); uint updateCount = 0; for (uint i = 0; i < totalPairs; ) { address pair = livePairs[i]; // Get the index of the most recently written observation uint8 head = observationHeads[pair]; uint8 lastIdx = (head == 0) ? 4 : head - 1; // Check timestamp of the latest observation instead of a separate mapping if (currentTimestamp - observations[pair][lastIdx].timestamp >= PERIOD_SIZE) { pairsToUpdate[updateCount] = pair; unchecked { ++updateCount; } } unchecked { ++i; } } if (updateCount > 0) { // Create a properly sized array for the batch call address[] memory activeBatch = new address[](updateCount); for (uint i = 0; i < updateCount; i++) { activeBatch[i] = pairsToUpdate[i]; } (UniswapV2OracleLibrary.PriceData[] memory prices, ) = UniswapV2OracleLibrary.batchCumulativePrices(activeBatch); for (uint i = 0; i < updateCount; i++) { _applyUpdate(activeBatch[i], prices[i], currentTimestamp); } if (rewardsEnabled && balanceOf[msg.sender] >= getMinHoldingForReward()) { uint reward = calculateReward(currentTimestamp); if (reward > 0) _mintReward(msg.sender, reward); } } lastSuperUpdateTimestamp = currentTimestamp; emit SuperUpdate(currentTimestamp, updateCount); } // === OPTIMIZED: Circular Buffer Update === function _applyUpdate(address pair, UniswapV2OracleLibrary.PriceData memory price, uint blockTimestamp) private { uint8 head = observationHeads[pair]; // Overwrite the oldest observation observations[pair][head] = Observation( block.timestamp, price.price0Cumulative, price.price1Cumulative ); // Move head forward (0 -> 1 -> 2 -> 3 -> 4 -> 0) observationHeads[pair] = (head + 1) % 5; emit PriceUpdated(address(0), pair, price.price0Cumulative, price.price1Cumulative, blockTimestamp); } // === OPTIMIZED: Read & Sort === function getMedianPrice(address pair, bool needPrice0, uint currentCumulative, uint currentTimestamp) internal view returns (uint224 medianPrice) { // 1. Load all 5 observations into memory Observation[5] memory obsArray; for(uint i=0; i<5; i++) { obsArray[i] = observations[pair][i]; } // 2. Sort by timestamp (Descending: Newest first) // Using insertion sort for efficiency on small arrays for (uint i = 1; i < 5; ) { Observation memory key = obsArray[i]; uint j = i; while (j > 0 && obsArray[j-1].timestamp < key.timestamp) { obsArray[j] = obsArray[j-1]; j--; } obsArray[j] = key; unchecked { ++i; } } // 3. Calculate Segment TWAPs uint224[] memory segmentPrices = new uint224[](5); uint count = 0; uint prevCum = currentCumulative; uint prevTs = currentTimestamp; for (uint i = 0; i < 5; i++) { if (obsArray[i].timestamp == 0) continue; uint timeElapsed = prevTs - obsArray[i].timestamp; if (timeElapsed < MIN_WINDOW || timeElapsed > MAX_WINDOW) continue; uint obsCum = needPrice0 ? obsArray[i].price0Cumulative : obsArray[i].price1Cumulative; uint segmentTWAP = (prevCum - obsCum) / timeElapsed; segmentPrices[count] = uint224(segmentTWAP); count++; prevCum = obsCum; prevTs = obsArray[i].timestamp; } if (count == 0) revert InvalidTWAPWindow(); // Sort Segment Prices for (uint i = 1; i < count; ) { uint224 key = segmentPrices[i]; uint j = i; while (j > 0 && segmentPrices[j - 1] > key) { segmentPrices[j] = segmentPrices[j - 1]; j--; } segmentPrices[j] = key; unchecked { ++i; } } if (count % 2 == 1) { medianPrice = segmentPrices[count / 2]; } else { medianPrice = (segmentPrices[count / 2 - 1] + segmentPrices[count / 2]) / 2; } } function _getNormalizedPriceFromRef(ReferenceStable memory ref) internal view returns (uint priceNormalized) { (uint112 reserve0, uint112 reserve1, ) = IUniswapV2Pair(ref.pair).getReserves(); uint wplsReserve = ref.isWplsToken0 ? uint(reserve0) : uint(reserve1); if (wplsReserve == 0) return 0; (uint price0Cumulative, uint price1Cumulative, uint blockTimestamp) = UniswapV2OracleLibrary.currentCumulativePrices(ref.pair); bool needPrice0 = ref.isWplsToken0; uint224 medianPrice = getMedianPrice(ref.pair, needPrice0, needPrice0 ? price0Cumulative : price1Cumulative, blockTimestamp); FixedPoint.uq144x112 memory fullPrice = FixedPoint.uq112x112(medianPrice).mul(1e18); uint priceNative = FixedPoint.decode144(fullPrice); uint decimalAdjustment = 10 ** (18 - ref.stableDecimals); priceNormalized = priceNative * decimalAdjustment; } function getWplsPriceInUsd() public view returns (uint priceWad) { uint validCount = 0; uint[] memory prices = new uint[](referenceStables.length); for (uint i = 0; i < referenceStables.length; i++) { ReferenceStable memory ref = referenceStables[i]; if (!ref.active) continue; uint price = _getNormalizedPriceFromRef(ref); if (price == 0) continue; prices[validCount] = price; validCount++; } if (validCount == 0) revert NoValidReferences(); // Sort Prices for (uint i = 0; i < validCount; i++) { for (uint j = i + 1; j < validCount; j++) { if (prices[i] > prices[j]) { uint temp = prices[i]; prices[i] = prices[j]; prices[j] = temp; } } } if (validCount % 2 == 1) { priceWad = prices[validCount / 2]; } else { priceWad = (prices[validCount / 2 - 1] + prices[validCount / 2]) / 2; } } function getPriceInUsd(address token, uint amountIn) public view returns (uint amountOutUsd) { if (token == wpls) { return (amountIn * getWplsPriceInUsd()) / 1e18; } PairInfo memory info = tokenToPairInfo[token]; if (info.pair != address(0)) { (uint price0Cumulative, uint price1Cumulative, uint blockTimestamp) = UniswapV2OracleLibrary.currentCumulativePrices(info.pair); uint224 medianPrice = getMedianPrice(info.pair, info.isToken0, info.isToken0 ? price0Cumulative : price1Cumulative, blockTimestamp); FixedPoint.uq144x112 memory temp = FixedPoint.uq112x112(medianPrice).mul(amountIn); uint amountInWpls = FixedPoint.decode144(temp); amountOutUsd = (amountInWpls * getWplsPriceInUsd()) / 1e18; } else { revert UnknownPair(); } } function _mintReward(address updater, uint reward) private { if (!rewardsEnabled) revert RewardsNotEnabled(); uint holding = balanceOf[updater]; uint minHolding = getMinHoldingForReward(); if (holding < minHolding) revert InsufficientBalanceForReward(); if (reward == 0) return; totalSupply += reward; balanceOf[updater] += reward; emit Reward(updater, reward); } // === OPTIMIZED REWARD MATH === function calculateReward(uint currentTime) internal view returns (uint) { if (!rewardsEnabled) return 0; uint timeSinceLast = currentTime - lastSuperUpdateTimestamp; if (timeSinceLast < MIN_WINDOW) return 0; uint effectiveTime = timeSinceLast - MIN_WINDOW; uint peakEffectiveTime = REWARD_WINDOW - MIN_WINDOW; uint timeBasedReward; if (effectiveTime <= peakEffectiveTime) { timeBasedReward = BASE_REWARD_RATE * effectiveTime; } else { uint cappedExtra = effectiveTime - peakEffectiveTime; // OPTIMIZATION: Use Logarithmic Power function instead of loop uint decayIntervals = cappedExtra / DECAY_PERIOD; // rpow calculates (DECAY_RATE ^ decayIntervals) // DECAY_RATE is 5e17 (0.5), rpow expects 1e18 precision uint decayFactor = FixedPoint.rpow(DECAY_RATE, decayIntervals); uint peakReward = BASE_REWARD_RATE * peakEffectiveTime; timeBasedReward = (peakReward * decayFactor) / 1e18; } uint supplyFactor = 1e18; if (totalSupply > INITIAL_SUPPLY) { uint a = INITIAL_SUPPLY; uint b = totalSupply; supplyFactor = (2 * a * 1e18) / (a + b); } return (timeBasedReward * supplyFactor) / 1e18; } // === ERC20 IMPLEMENTATION === function transfer(address to, uint256 value) external returns (bool) { require(to != address(0), "ERC20: transfer to the zero address"); require(balanceOf[msg.sender] >= value, "ERC20: transfer amount exceeds balance"); balanceOf[msg.sender] -= value; balanceOf[to] += value; emit Transfer(msg.sender, to, value); return true; } function transferFrom(address from, address to, uint256 value) external returns (bool) { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(balanceOf[from] >= value, "ERC20: transfer amount exceeds balance"); require(allowance[from][msg.sender] >= value, "ERC20: insufficient allowance"); balanceOf[from] -= value; balanceOf[to] += value; allowance[from][msg.sender] -= value; emit Transfer(from, to, value); return true; } function approve(address spender, uint256 value) external returns (bool) { allowance[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } // === VIEW HELPERS === function getTokens() external view returns (address[] memory) { return pricedTokens; } function getReferenceCount() external view returns (uint) { return referenceStables.length; } function getPricedTokenCount() external view returns (uint) { return pricedTokens.length; } function getCurrentReward() external view returns (uint) { return calculateReward(block.timestamp); } }
We recommend using flattened code. This is necessary if your code utilizes a library or inherits dependencies. Use the
POA solidity flattener or the
truffle flattener
.
Try to fetch constructor arguments automatically
No
Yes
ABI-encoded Constructor Arguments (if required by the contract)
0x000000000000000000000000a1077a294dde1b09bb078844df40758a5d0f9a27
Add arguments in
ABI hex encoded form
. Constructor arguments are written right to left, and will be found at the end of the input created bytecode. They may also be
parsed here.
Add Contract Libraries
Contract Libraries
Library 1 Name
A library name called in the .sol file. Multiple libraries (up to 10) may be added for each contract. Click the Add Library button to add an additional one.
Library 1 Address
The 0x library address. This can be found in the generated json file or Truffle output (if using truffle).
Library 2 Name
Library 2 Address
Library 3 Name
Library 3 Address
Library 4 Name
Library 4 Address
Library 5 Name
Library 5 Address
Library 6 Name
Library 6 Address
Library 7 Name
Library 7 Address
Library 8 Name
Library 8 Address
Library 9 Name
Library 9 Address
Library 10 Name
Library 10 Address
Add Library
Loading...
Verify & publish
Cancel
Ok
Ok
Ok
No
Yes