编译器
0.8.21+commit.d9974bed
文件 1 的 13:Address.sol
pragma solidity ^0.8.1;
library Address {
function isContract(address account) internal view returns (bool) {
return account.code.length > 0;
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
文件 2 的 13:Context.sol
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
文件 3 的 13:ERC20.sol
pragma solidity ^0.8.0;
import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function decimals() public view virtual override returns (uint8) {
return 18;
}
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
function transfer(address to, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_approve(owner, spender, amount);
return true;
}
function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, allowance(owner, spender) + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = allowance(owner, spender);
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
function _transfer(address from, address to, uint256 amount) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[from] = fromBalance - amount;
_balances[to] += amount;
}
emit Transfer(from, to, amount);
_afterTokenTransfer(from, to, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
unchecked {
_balances[account] += amount;
}
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
}
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(owner, spender, currentAllowance - amount);
}
}
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}
function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}
}
文件 4 的 13:IERC20.sol
pragma solidity ^0.8.0;
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}
文件 5 的 13:IERC20Metadata.sol
pragma solidity ^0.8.0;
import "../IERC20.sol";
interface IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
文件 6 的 13:IERC20Permit.sol
pragma solidity ^0.8.0;
interface IERC20Permit {
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
function nonces(address owner) external view returns (uint256);
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
文件 7 的 13:IUniswapV2Factory.sol
pragma solidity 0.8.21;
interface IUniswapV2Factory {
function createPair(
address tokenA,
address tokenB
) external returns (address pair);
function getPair(
address tokenA,
address tokenB
) external view returns (address pair);
}
文件 8 的 13:IUniswapV2Router02.sol
pragma solidity 0.8.21;
interface IUniswapV2Router02 {
function factory() external view returns (address);
function WETH() external view returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
function removeLiquidityETH(
address token,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external returns (uint256 amountToken, uint256 amountETH);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
文件 9 的 13:OnChainPolitics.sol
pragma solidity ^0.8.21;
import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import './interfaces/IUniswapV2Factory.sol';
import './interfaces/IUniswapV2Router02.sol';
import './libraries/PoolAddress.sol';
import './Rewards.sol';
import './WrappedTokenWithRewards.sol';
contract OnChainPolitics is ERC20 {
using SafeERC20 for IERC20;
address immutable V2_ROUTER;
address immutable V3_FACTORY;
address immutable WETH9;
Rewards public rewards;
address public multisig;
mapping(address => bool) public wrappers;
mapping(address => bool) _excluded;
address _v2Pool;
bool _swapping;
bool _swapTaxOn = true;
event CreateWrapped(address _newToken, string _name, string _symbol);
modifier noSwapTax() {
_swapTaxOn = false;
_;
_swapTaxOn = true;
}
modifier onlyMultisig() {
require(_msgSender() == multisig, 'AUTH');
_;
}
constructor(
address _multisig,
address _v2Router,
address _v3Factory
) ERC20('OnChainPolitics', 'OCP') {
multisig = _multisig;
V2_ROUTER = _v2Router;
V3_FACTORY = _v3Factory;
WETH9 = IUniswapV2Router02(V2_ROUTER).WETH();
rewards = new Rewards(address(this));
_v2Pool = IUniswapV2Factory(IUniswapV2Router02(V2_ROUTER).factory())
.createPair(address(this), WETH9);
_excluded[address(0)] = true;
_excluded[address(this)] = true;
_excluded[address(0xdead)] = true;
_excluded[_v2Pool] = true;
_excluded[_v3Pool(500)] = true;
_excluded[_v3Pool(3000)] = true;
_excluded[_v3Pool(10000)] = true;
_mint(_msgSender(), 1_000_000_000 * 10 ** 18);
}
function createWrapped(
string memory _name,
string memory _symbol
) external onlyMultisig {
WrappedTokenWithRewards _newToken = new WrappedTokenWithRewards(
_name,
_symbol,
address(this)
);
wrappers[address(_newToken)] = true;
emit CreateWrapped(address(_newToken), _name, _symbol);
}
function setMultisig(address _multisig) external onlyMultisig {
multisig = _multisig;
}
function transferFrom(
address _from,
address _to,
uint256 _amount
) public virtual override returns (bool) {
if (wrappers[_msgSender()]) {
_transfer(_from, _to, _amount);
return true;
}
return super.transferFrom(_from, _to, _amount);
}
function addLiquidityETH(
uint256 _tokens,
uint256 _slippage
) external payable noSwapTax {
uint256 _lpETH = msg.value;
require(_tokens > 0 && _lpETH > 0, 'LPFUNDS');
uint256 _tokensBefore = balanceOf(address(this));
uint256 _ethBefore = address(this).balance - _lpETH;
_transfer(_msgSender(), address(this), _tokens);
_approve(address(this), V2_ROUTER, _tokens);
IUniswapV2Router02(V2_ROUTER).addLiquidityETH{ value: _lpETH }(
address(this),
_tokens,
(_tokens * (1000 - _slippage)) / 1000,
(_lpETH * (1000 - _slippage)) / 1000,
_msgSender(),
block.timestamp
);
if (balanceOf(address(this)) > _tokensBefore) {
_transfer(
address(this),
_msgSender(),
balanceOf(address(this)) - _tokensBefore
);
}
if (address(this).balance > _ethBefore) {
(bool _refund, ) = payable(_msgSender()).call{
value: address(this).balance - _ethBefore
}('');
require(_refund, 'ETHREFUND');
}
}
function removeLiquidityETH(
uint256 _lpTokens,
uint256 _minTokens,
uint256 _minETH
) external noSwapTax {
_lpTokens = _lpTokens == 0
? IERC20(_v2Pool).balanceOf(_msgSender())
: _lpTokens;
require(_lpTokens > 0, 'LPREMOVE');
uint256 _lpBalBefore = IERC20(_v2Pool).balanceOf(address(this));
IERC20(_v2Pool).safeTransferFrom(_msgSender(), address(this), _lpTokens);
IERC20(_v2Pool).approve(V2_ROUTER, _lpTokens);
IUniswapV2Router02(V2_ROUTER).removeLiquidityETH(
address(this),
_lpTokens,
_minTokens,
_minETH,
_msgSender(),
block.timestamp
);
if (IERC20(_v2Pool).balanceOf(address(this)) > _lpBalBefore) {
IERC20(_v2Pool).safeTransfer(
_msgSender(),
IERC20(_v2Pool).balanceOf(address(this)) - _lpBalBefore
);
}
}
function _transfer(
address _from,
address _to,
uint256 _amount
) internal virtual override {
bool _buying = _from == _v2Pool && _to != V2_ROUTER;
bool _selling = _to == _v2Pool;
uint256 _tax = 0;
if (_swapTaxOn) {
uint256 _bal = balanceOf(address(this));
uint256 _min = (totalSupply() * 5) / 100000;
if (!_swapping && _from != _v2Pool && _bal >= _min) {
_swapping = true;
_swap(_bal >= _min * 10 ? _min * 10 : _min);
_swapping = false;
}
if (!_swapping && (_buying || _selling)) {
_tax = (_amount * 142069) / 10000000;
super._transfer(_from, address(this), _tax);
}
}
super._transfer(_from, _to, _amount - _tax);
}
function _swap(uint256 _amount) internal {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = WETH9;
_approve(address(this), V2_ROUTER, _amount);
IUniswapV2Router02(V2_ROUTER)
.swapExactTokensForETHSupportingFeeOnTransferTokens(
_amount,
0,
path,
multisig,
block.timestamp
);
}
function _v3Pool(uint24 _poolFee) internal view returns (address) {
(address _token0, address _token1) = _lpTokensOrdered();
PoolAddress.PoolKey memory _key = PoolAddress.PoolKey({
token0: _token0,
token1: _token1,
fee: _poolFee
});
return PoolAddress.computeAddress(V3_FACTORY, _key);
}
function _lpTokensOrdered() internal view returns (address, address) {
return
WETH9 < address(this) ? (WETH9, address(this)) : (address(this), WETH9);
}
function _afterTokenTransfer(
address _from,
address _to,
uint256 _amount
) internal override {
if (!_excluded[_from]) {
try rewards.setShare(_from, _amount, true) {} catch {}
}
if (!_excluded[_to]) {
try rewards.setShare(_to, _amount, false) {} catch {}
}
}
}
文件 10 的 13:PoolAddress.sol
pragma solidity >=0.5.0;
library PoolAddress {
bytes32 internal constant POOL_INIT_CODE_HASH =
0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54;
struct PoolKey {
address token0;
address token1;
uint24 fee;
}
function getPoolKey(
address tokenA,
address tokenB,
uint24 fee
) internal pure returns (PoolKey memory) {
if (tokenA > tokenB) (tokenA, tokenB) = (tokenB, tokenA);
return PoolKey({ token0: tokenA, token1: tokenB, fee: fee });
}
function computeAddress(
address factory,
PoolKey memory key
) internal pure returns (address pool) {
require(key.token0 < key.token1);
pool = address(
uint160(
uint256(
keccak256(
abi.encodePacked(
hex'ff',
factory,
keccak256(abi.encode(key.token0, key.token1, key.fee)),
POOL_INIT_CODE_HASH
)
)
)
)
);
}
}
文件 11 的 13:Rewards.sol
pragma solidity ^0.8.21;
import '@openzeppelin/contracts/utils/Context.sol';
contract Rewards is Context {
uint256 constant PRECISION = 10 ** 36;
address public trackingToken;
uint256 public totalUsers;
uint256 public totalShares;
struct Reward {
uint256 excluded;
uint256 realized;
}
mapping(address => uint256) public shares;
mapping(address => Reward) public rewards;
uint256 _rewardsPerShare;
uint256 public totalDistributed;
uint256 public totalDeposited;
event AddShares(address indexed user, uint256 amount);
event RemoveShares(address indexed user, uint256 amount);
event ClaimReward(address user);
event DistributeReward(address indexed user, uint256 amount);
event DepositRewards(address indexed user, uint256 amountTokens);
modifier onlyTrackingToken() {
require(_msgSender() == trackingToken, 'TOKEN');
_;
}
constructor(address _trackingToken) {
trackingToken = _trackingToken;
}
function setShare(
address _wallet,
uint256 _balanceUpdate,
bool _removing
) public onlyTrackingToken {
_setShare(_wallet, _balanceUpdate, _removing);
}
function _setShare(
address _wallet,
uint256 _balanceUpdate,
bool _removing
) internal {
if (_removing) {
_removeShares(_wallet, _balanceUpdate);
emit RemoveShares(_wallet, _balanceUpdate);
} else {
_addShares(_wallet, _balanceUpdate);
emit AddShares(_wallet, _balanceUpdate);
}
}
function _addShares(address _wallet, uint256 _amount) private {
if (shares[_wallet] > 0) {
_distributeReward(_wallet);
}
uint256 sharesBefore = shares[_wallet];
totalShares += _amount;
shares[_wallet] += _amount;
if (sharesBefore == 0 && shares[_wallet] > 0) {
totalUsers++;
}
rewards[_wallet].excluded = _cumulativeRewards(shares[_wallet]);
}
function _removeShares(address _wallet, uint256 _amount) private {
require(shares[_wallet] > 0 && _amount <= shares[_wallet], 'REMOVE');
_distributeReward(_wallet);
totalShares -= _amount;
shares[_wallet] -= _amount;
if (shares[_wallet] == 0) {
totalUsers--;
}
rewards[_wallet].excluded = _cumulativeRewards(shares[_wallet]);
}
function depositRewards() external payable {
_depositRewards(msg.value);
}
function _depositRewards(uint256 _amount) internal {
require(_amount > 0, 'DEPOSIT0');
require(totalShares > 0, 'DEPOSIT1');
totalDeposited += _amount;
_rewardsPerShare += (PRECISION * _amount) / totalShares;
emit DepositRewards(_msgSender(), _amount);
}
function _distributeReward(address _wallet) internal {
if (shares[_wallet] == 0) {
return;
}
uint256 amount = getUnpaid(_wallet);
rewards[_wallet].realized += amount;
rewards[_wallet].excluded = _cumulativeRewards(shares[_wallet]);
if (amount > 0) {
totalDistributed += amount;
uint256 _balBefore = address(this).balance;
(bool success, ) = payable(_wallet).call{ value: amount }('');
require(success, 'DIST0');
require(address(this).balance >= _balBefore - amount, 'DIST1');
emit DistributeReward(_wallet, amount);
}
}
function claimReward() external {
_distributeReward(_msgSender());
emit ClaimReward(_msgSender());
}
function getUnpaid(address _wallet) public view returns (uint256) {
if (shares[_wallet] == 0) {
return 0;
}
uint256 earnedRewards = _cumulativeRewards(shares[_wallet]);
uint256 rewardsExcluded = rewards[_wallet].excluded;
if (earnedRewards <= rewardsExcluded) {
return 0;
}
return earnedRewards - rewardsExcluded;
}
function _cumulativeRewards(uint256 _share) internal view returns (uint256) {
return (_share * _rewardsPerShare) / PRECISION;
}
receive() external payable {
_depositRewards(msg.value);
}
}
文件 12 的 13:SafeERC20.sol
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/IERC20Permit.sol";
import "../../../utils/Address.sol";
library SafeERC20 {
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
}
}
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
_callOptionalReturn(token, approvalCall);
}
}
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
function _callOptionalReturn(IERC20 token, bytes memory data) private {
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
(bool success, bytes memory returndata) = address(token).call(data);
return
success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
}
}
文件 13 的 13:WrappedTokenWithRewards.sol
pragma solidity ^0.8.21;
import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import './Rewards.sol';
contract WrappedTokenWithRewards is ERC20 {
using SafeERC20 for IERC20;
address public wrappedToken;
Rewards public rewards;
constructor(
string memory _name,
string memory _symbol,
address _wrappedToken
) ERC20(_name, _symbol) {
wrappedToken = _wrappedToken;
rewards = new Rewards(address(this));
}
function deposit(uint256 _amount) external {
_mint(_msgSender(), _amount);
IERC20(wrappedToken).safeTransferFrom(_msgSender(), address(this), _amount);
}
function withdraw(uint256 _amount) external {
_burn(_msgSender(), _amount);
IERC20(wrappedToken).safeTransfer(_msgSender(), _amount);
}
function _afterTokenTransfer(
address _from,
address _to,
uint256 _amount
) internal override {
try rewards.setShare(_from, _amount, true) {} catch {}
try rewards.setShare(_to, _amount, false) {} catch {}
}
}
{
"compilationTarget": {
"contracts/OnChainPolitics.sol": "OnChainPolitics"
},
"evmVersion": "shanghai",
"libraries": {},
"metadata": {
"bytecodeHash": "none"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"address","name":"_multisig","type":"address"},{"internalType":"address","name":"_v2Router","type":"address"},{"internalType":"address","name":"_v3Factory","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"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":false,"internalType":"address","name":"_newToken","type":"address"},{"indexed":false,"internalType":"string","name":"_name","type":"string"},{"indexed":false,"internalType":"string","name":"_symbol","type":"string"}],"name":"CreateWrapped","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":"uint256","name":"_tokens","type":"uint256"},{"internalType":"uint256","name":"_slippage","type":"uint256"}],"name":"addLiquidityETH","outputs":[],"stateMutability":"payable","type":"function"},{"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":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"}],"name":"createWrapped","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"multisig","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lpTokens","type":"uint256"},{"internalType":"uint256","name":"_minTokens","type":"uint256"},{"internalType":"uint256","name":"_minETH","type":"uint256"}],"name":"removeLiquidityETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewards","outputs":[{"internalType":"contract Rewards","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_multisig","type":"address"}],"name":"setMultisig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"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"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"wrappers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]