false
true
0
PulseChain Testnet v4
Blockchain
Blocks
Blocks
Uncles
Forked Blocks (Reorgs)
Transactions
Confirmed
Pending
Verified contracts
Tokens
All
tPLS
APIs
GraphQL
RPC
Eth RPC
Apps
Testnet V4 Beacon Explorer
PulseX
PulseChain Bridge
Testnet V4 Faucet
Become a Validator
PulseChain
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
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
/* * @title REFLUX - Earn reflections in native token * @author Ra Murd <pulselorian@gmail.com> * @notice https://pulselorian.com/ * @notice https://t.me/ThePulselorian * @notice https://twitter.com/ThePulseLorian * * It's deflationary, burns portion of the fees, reflects rest of the fees in native tokens * * ( ( ( ( ( (( ( . ( ( (( ( (( * )\ )\ )\ )\ )\ (\())\ . )\ )\ ))\)\ ))\ * ((_)((_)(_)(_) ((_))(_)(_) ((_)((_)(((_)_()((_))) * | _ \ | | | | / __| __| | / _ \| _ \_ _| \ \| | * | _/ |_| | |__\__ \ _|| |__| (_) | /| || - | . | * |_| \___/|____|___/___|____|\___/|_|_\___|_|_|_|\_| * * Tokenomics (initial fees): * Buy Sell Transfer * Rfi 1.75% 1.75% 0.0% * Burn 0.25% 0.25% 0.0% * * SPDX-License-Identifier: MIT */ pragma solidity 0.8.21; import "./@openzeppelin/access/AccessControl.sol"; import "./@openzeppelin/access/Ownable.sol"; import "./@openzeppelin/token/ERC20/ERC20.sol"; import "./@uniswap/v2-core/interfaces/IUniswapV2Factory.sol"; import "./@uniswap/v2-core/interfaces/IUniswapV2Pair.sol"; import "./@uniswap/v2-periphery/interfaces/IUniswapV2Router02.sol"; import "./lib/RfiHelper.sol"; import "./lib/Utils.sol"; contract Reflux is ERC20, Ownable, Utils, AccessControl { enum Fees { BuyRfiFee, BuyBurnFee, SellRfiFee, SellBurnFee } IUniswapV2Pair public plsV2LP; IUniswapV2Router02 public plsxV2Router; RfiHelper public rfiHelper; address private _prevFrom; address private _prevTo; address public burnAddr; address public rfiHelperAddr; bool private _swapping; bool public payoutEnabled = true; bytes32 public constant MANAGER_ROLE = keccak256("MANAGER_ROLE"); mapping(address => bool) public isAMMPair; mapping(address => bool) public noFee; mapping(address => bool) public noRfi; uint256 private constant _BIPS = 10000; uint256 private constant _MAX_FEE = 500; uint256 public lpRewardBips = 20000; uint256 public maxGas = 200000; uint256 public swapFactor = 1e5; uint256[] public fees = new uint256[](uint256(type(Fees).max) + 1); event UpdatedNoFeeWallet(address wallet, bool status); event SwapFactorUpdated(uint256 newFactor); event FeesUpdated( uint256 buyRfiFee, uint256 buyBurnFee, uint256 sellRfiFee, uint256 sellBurnFee ); constructor(address plsxV2Router_) ERC20("REFLUX | Interest", "RFX") { burnAddr = address(0x369); plsxV2Router = IUniswapV2Router02(plsxV2Router_); address plsLPAddr = IUniswapV2Factory(plsxV2Router.factory()) .createPair(address(this), plsxV2Router.WPLS()); plsV2LP = IUniswapV2Pair(plsLPAddr); rfiHelper = new RfiHelper(); rfiHelperAddr = address(rfiHelper); fees[uint256(Fees.BuyRfiFee)] = 175; fees[uint256(Fees.BuyBurnFee)] = 25; fees[uint256(Fees.SellRfiFee)] = 175; fees[uint256(Fees.SellBurnFee)] = 25; noFee[address(this)] = true; noFee[msg.sender] = true; noRfi[address(this)] = true; noRfi[burnAddr] = true; noRfi[plsLPAddr] = true; noRfi[address(0)] = true; isAMMPair[plsLPAddr] = true; _mint(msg.sender, 1e27); // 1 billion _grantRole(MANAGER_ROLE, msg.sender); } receive() external payable {} function _calcShares( address target_ ) private view returns (uint256 shares) { return balanceOf(target_) + (lpRewardBips * plsV2LP.balanceOf(target_)) / _BIPS; } function _checkIfAMMPair(address target_) private { if (target_.code.length == 0) return; if (!isAMMPair[target_]) { (address token0, address token1) = Utils._getTokens(target_); if (token0 != address(0) && token1 != address(0)) { isAMMPair[target_] = true; noRfi[target_] = true; } } } function _swapTokensForPLS( uint256 tknAmt_ ) private returns (uint256 plsFromSwap) { address[] memory path = new address[](2); path[0] = address(this); path[1] = plsxV2Router.WPLS(); uint256 plsBalBefore = address(rfiHelperAddr).balance; _approve(address(this), address(plsxV2Router), tknAmt_); plsxV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tknAmt_, 0, path, rfiHelperAddr, block.timestamp ); plsFromSwap = address(rfiHelperAddr).balance - plsBalBefore; } function _transfer( address from_, address to_, uint256 amt_ ) internal override(ERC20) { _checkIfAMMPair(from_); _checkIfAMMPair(to_); uint256 rfiTknBal = balanceOf(address(this)); bool swapReady = rfiTknBal >= (totalSupply() / swapFactor); // Sell transaction when _swapping is enabled and _swapping is not in progress if (swapReady && !_swapping && isAMMPair[to_]) { _swapping = true; uint256 plsFromSwap = _swapTokensForPLS(totalSupply() / swapFactor); rfiHelper.deposit(plsFromSwap); _swapping = false; } if (noFee[from_] || noFee[to_]) { super._transfer(from_, to_, amt_); } else { (uint256 burnFee, uint256 rfiFee) = calcFees( amt_, isAMMPair[from_], isAMMPair[to_] ); if (burnFee > 0) { super._transfer(from_, address(burnAddr), burnFee); } if (rfiFee > 0) { super._transfer(from_, address(this), rfiFee); } super._transfer(from_, to_, amt_ - burnFee - rfiFee); } _transferPost(from_, to_); } function _transferPost(address from_, address to_) private { if (!noRfi[_prevFrom]) { try rfiHelper.setShare(_prevFrom, _calcShares(_prevFrom)) {} catch {} } if (!noRfi[_prevTo]) { try rfiHelper.setShare(_prevTo, _calcShares(_prevTo)) {} catch {} } if (!noRfi[from_]) { _prevFrom = from_; try rfiHelper.setShare(from_, _calcShares(from_)) {} catch {} } if (!noRfi[to_]) { _prevTo = to_; try rfiHelper.setShare(to_, _calcShares(to_)) {} catch {} } if (payoutEnabled) { try rfiHelper.process(maxGas) {} catch {} } } function calcFees( uint256 amt_, bool isFromAMM_, bool isToAMM_ ) private view returns (uint256 burnFee, uint256 rfiFee) { if (isFromAMM_) { // Buying burnFee = (amt_ * fees[uint256(Fees.BuyBurnFee)]) / _BIPS; rfiFee = (amt_ * fees[uint256(Fees.BuyRfiFee)]) / _BIPS; } else { if (isToAMM_) { // Selling burnFee = (amt_ * fees[uint256(Fees.SellBurnFee)]) / _BIPS; rfiFee = (amt_ * fees[uint256(Fees.SellRfiFee)]) / _BIPS; } } return (burnFee, rfiFee); } function setFees( uint256 buyRfiFee_, uint256 buyBurnFee_, uint256 sellRfiFee_, uint256 sellBurnFee_ ) external onlyRole(MANAGER_ROLE) { require( buyRfiFee_ <= _MAX_FEE && buyBurnFee_ <= _MAX_FEE && sellRfiFee_ <= _MAX_FEE && sellBurnFee_ <= _MAX_FEE, "Fee must be <= MAX_FEE" ); fees[uint256(Fees.BuyRfiFee)] = buyRfiFee_; fees[uint256(Fees.BuyBurnFee)] = buyBurnFee_; fees[uint256(Fees.SellRfiFee)] = sellRfiFee_; fees[uint256(Fees.SellBurnFee)] = sellBurnFee_; emit FeesUpdated(buyRfiFee_, buyBurnFee_, sellRfiFee_, sellBurnFee_); } function setLPRewardBips( uint256 newLPRewardBips_ ) external onlyRole(MANAGER_ROLE) { lpRewardBips = newLPRewardBips_; } function setMaxGas(uint256 gas_) external onlyRole(MANAGER_ROLE) { maxGas = gas_; } function setNoFee( address wallet_, bool flag_ ) external onlyRole(MANAGER_ROLE) { require(noFee[wallet_] != flag_, "Wallet already set"); noFee[wallet_] = flag_; emit UpdatedNoFeeWallet(wallet_, flag_); } function setNoRfi( address wallet_, bool flag_ ) external onlyRole(MANAGER_ROLE) { noRfi[wallet_] = flag_; if (flag_) { rfiHelper.setShare(wallet_, 0); } else { rfiHelper.setShare(wallet_, _calcShares(wallet_)); } } function setPayoutEnabled(bool enabled_) external onlyRole(MANAGER_ROLE) { payoutEnabled = enabled_; } function setPayoutPolicy( uint256 minDurSec_, uint256 minReward_ ) external onlyRole(MANAGER_ROLE) { rfiHelper.setPayoutPolicy(minDurSec_, minReward_); } function setSwapFactor(uint256 newFac_) external onlyRole(MANAGER_ROLE) { require(newFac_ <= 1e12, "Too big factor"); require(newFac_ >= 1e3, "Too small factor"); swapFactor = newFac_; emit SwapFactorUpdated(newFac_); } }
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)
0x000000000000000000000000636f6407b90661b73b1c0f7e24f4c79f624d0738
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