Last active
July 23, 2022 05:54
-
-
Save snowkidind/c759e82677b7a77dc70548943730acd9 to your computer and use it in GitHub Desktop.
RouterDifferences.sol - Differences between Uniswap v3 routers SwapRouter and SwapRouter02
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const env = require('node-env-file') | |
env(__dirname + '/../.env') | |
const hre = require('hardhat') | |
const ethers = hre.ethers | |
const provider = hre.network.provider | |
const BigNumber = ethers.BigNumber | |
const usdcAbi = require('./usdc.json') | |
const usdcAddr = '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48' // USDC | |
const usdc = new ethers.Contract(usdcAddr, usdcAbi, ethers.provider) | |
let differencesAddr, to | |
const run = async () => { | |
try { | |
const [owner] = await ethers.getSigners() | |
to = owner.address | |
await getFunds() | |
// broadcast the contract | |
const Differences = await ethers.getContractFactory("RouterDifferences") | |
const differences = await Differences.deploy() | |
await differences.deployed() | |
differencesAddr = differences.address | |
console.log("Differences contract deployed to:", differencesAddr) | |
await status('opening balance') | |
// send usdc to the contract | |
const usdcBal = await usdc.balanceOf(to) | |
await usdc.connect(owner).transfer(differencesAddr, usdcBal) | |
await status('sent usdc') | |
// call the function | |
tx = await differences.routerDifferences() | |
await status('after contract call') | |
} catch (error) { | |
console.log(error) | |
} | |
} | |
const status = async (title) => { | |
const b = ethers.provider.getBalance(differencesAddr) | |
const c = ethers.provider.getBalance(to) | |
const dd = usdc.balanceOf(to) | |
const e = usdc.balanceOf(differencesAddr) | |
const [flashBalEth, ownerEth, ownerUsdc, flashUsdc] = await Promise.all([b, c, dd, e]) | |
console.log('\n' + title) | |
console.log('flash: ' + d(flashBalEth, 18) + ' ETH ' + d(flashUsdc, 6) + ' USDC') | |
console.log('owner: ' + d(ownerEth, 18) + ' ETH ' + d(ownerUsdc, 6) + ' USDC') | |
} | |
const getFunds = async () => { | |
const usdcWhale = '0x5E0e8B4E3e793E2CF534aa66CD8a5e4eEB62813b' | |
const wethWhale = '0x821A96fbD4465D02726EDbAa936A0d6d1032dE46' | |
// get usdc | |
await provider.request({ | |
method: "hardhat_impersonateAccount", | |
params: [usdcWhale] | |
}) | |
const usdcSigner = await ethers.provider.getSigner(usdcWhale) | |
let toBalUsdc = await usdc.balanceOf(to) | |
await usdc.connect(usdcSigner).transfer(to, BigNumber.from("1000000000")) // 1000 usdc | |
await provider.request({ | |
method: "hardhat_stopImpersonatingAccount", | |
params: [usdcWhale] | |
}) | |
// get eth for tx fees | |
await provider.request({ | |
method: "hardhat_impersonateAccount", | |
params: [wethWhale] | |
}) | |
const signer = await ethers.provider.getSigner(wethWhale) | |
let balance = await ethers.provider.getBalance(wethWhale) | |
let gasCost = BigNumber.from("21000") | |
const gasOracle = BigNumber.from("46000000000") | |
balance = balance.sub(gasCost.mul(gasOracle)) | |
const txRequest = { | |
to: to, | |
gasLimit: gasCost, | |
gasPrice: gasOracle, | |
value: balance | |
} | |
populatedTx = await signer.populateTransaction(txRequest) | |
tx = await signer.sendTransaction(populatedTx) | |
await provider.request({ | |
method: "hardhat_stopImpersonatingAccount", | |
params: [wethWhale] | |
}) | |
} | |
const d = (_amount, decimals, precision) => { | |
const amount = String(_amount) | |
if (precision) { | |
return Math.round(ethers.utils.formatUnits(amount, decimals), precision) | |
} | |
return ethers.utils.formatUnits(amount, decimals) | |
} | |
;(async () => { | |
await run() | |
})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: UNLICENSED" for non-open-source code | |
pragma solidity ^0.8.0; | |
import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | |
import '@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol'; | |
import '@uniswap/v3-periphery/contracts/libraries/TransferHelper.sol'; | |
// The SwapRouter02 (1.1.0) router combines v2 and v3 pools. There isnt a good doc that explains when to use | |
// it vs the SwapRouter contract. The 02 paramaters arent the same as the imported libraries, to use the | |
// ISwapRouter02 contract, create your own interface. | |
// Note: Not sure how the other methods are but I suspect similar, untested | |
interface ISwapRouter02 is IUniswapV3SwapCallback { | |
struct ExactInputSingleParamsR2 { | |
address tokenIn; | |
address tokenOut; | |
uint24 fee; | |
address recipient; | |
uint256 amountIn; | |
uint256 amountOutMinimum; | |
uint160 sqrtPriceLimitX96; | |
} | |
function exactInputSingle(ExactInputSingleParamsR2 calldata params) external payable returns (uint256 amountOut); | |
} | |
contract RouterDifferences { | |
address public constant usdc = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48; | |
address public constant dai = 0x6B175474E89094C44Da98b954EedeAC495271d0F; | |
IERC20 public usdcContract = IERC20(usdc); | |
IERC20 public daiContract = IERC20(dai); | |
// https://docs.uniswap.org/protocol/reference/deployments | |
address public constant swap_router02_address = 0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45; // SwapRouter02 (1.1.0) | |
address public constant swap_router_address = 0xE592427A0AEce92De3Edee1F18E0157C05861564; // SwapRouter | |
// The 02 router is a combination router which auto routes to v2 pools as well | |
// connect via the 02 router | |
ISwapRouter02 public immutable swapRouter02 = ISwapRouter02(swap_router02_address); | |
ISwapRouter public immutable swapRouter = ISwapRouter(swap_router_address); | |
function routerDifferences() public { | |
uint256 _amount = usdcContract.balanceOf(address(this)); | |
usdcContract.approve(swap_router02_address, _amount); | |
uint24 poolFee = 100; // dai/usdc pool at 0x5777d92f208679db4b9778590fa3cab3ac9e2168 | |
// SwapRouter02 | |
uint256 amountOut = swapRouter02.exactInputSingle( | |
ISwapRouter02.ExactInputSingleParamsR2({ | |
tokenIn: usdc, | |
tokenOut: dai, | |
fee: poolFee, | |
recipient: address(this), | |
amountIn: _amount, | |
amountOutMinimum: 0, | |
sqrtPriceLimitX96: 0 | |
}) | |
); | |
uint256 _amountDai = daiContract.balanceOf(address(this)); | |
daiContract.approve(swap_router_address, _amountDai); | |
// SwapRouter | |
uint256 amountReturned = swapRouter.exactInputSingle( | |
ISwapRouter.ExactInputSingleParams({ | |
tokenIn: dai, | |
tokenOut: usdc, | |
fee: poolFee, | |
recipient: address(this), | |
deadline: block.timestamp, | |
amountIn: _amountDai, | |
amountOutMinimum: 0, | |
sqrtPriceLimitX96: 0 | |
}) | |
); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"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": true, | |
"internalType": "address", | |
"name": "authorizer", | |
"type": "address" | |
}, | |
{ | |
"indexed": true, | |
"internalType": "bytes32", | |
"name": "nonce", | |
"type": "bytes32" | |
} | |
], | |
"name": "AuthorizationCanceled", | |
"type": "event" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"indexed": true, | |
"internalType": "address", | |
"name": "authorizer", | |
"type": "address" | |
}, | |
{ | |
"indexed": true, | |
"internalType": "bytes32", | |
"name": "nonce", | |
"type": "bytes32" | |
} | |
], | |
"name": "AuthorizationUsed", | |
"type": "event" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"indexed": true, | |
"internalType": "address", | |
"name": "_account", | |
"type": "address" | |
} | |
], | |
"name": "Blacklisted", | |
"type": "event" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"indexed": true, | |
"internalType": "address", | |
"name": "newBlacklister", | |
"type": "address" | |
} | |
], | |
"name": "BlacklisterChanged", | |
"type": "event" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"indexed": true, | |
"internalType": "address", | |
"name": "burner", | |
"type": "address" | |
}, | |
{ | |
"indexed": false, | |
"internalType": "uint256", | |
"name": "amount", | |
"type": "uint256" | |
} | |
], | |
"name": "Burn", | |
"type": "event" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"indexed": true, | |
"internalType": "address", | |
"name": "newMasterMinter", | |
"type": "address" | |
} | |
], | |
"name": "MasterMinterChanged", | |
"type": "event" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"indexed": true, | |
"internalType": "address", | |
"name": "minter", | |
"type": "address" | |
}, | |
{ | |
"indexed": true, | |
"internalType": "address", | |
"name": "to", | |
"type": "address" | |
}, | |
{ | |
"indexed": false, | |
"internalType": "uint256", | |
"name": "amount", | |
"type": "uint256" | |
} | |
], | |
"name": "Mint", | |
"type": "event" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"indexed": true, | |
"internalType": "address", | |
"name": "minter", | |
"type": "address" | |
}, | |
{ | |
"indexed": false, | |
"internalType": "uint256", | |
"name": "minterAllowedAmount", | |
"type": "uint256" | |
} | |
], | |
"name": "MinterConfigured", | |
"type": "event" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"indexed": true, | |
"internalType": "address", | |
"name": "oldMinter", | |
"type": "address" | |
} | |
], | |
"name": "MinterRemoved", | |
"type": "event" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"indexed": false, | |
"internalType": "address", | |
"name": "previousOwner", | |
"type": "address" | |
}, | |
{ | |
"indexed": false, | |
"internalType": "address", | |
"name": "newOwner", | |
"type": "address" | |
} | |
], | |
"name": "OwnershipTransferred", | |
"type": "event" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [], | |
"name": "Pause", | |
"type": "event" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"indexed": true, | |
"internalType": "address", | |
"name": "newAddress", | |
"type": "address" | |
} | |
], | |
"name": "PauserChanged", | |
"type": "event" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"indexed": true, | |
"internalType": "address", | |
"name": "newRescuer", | |
"type": "address" | |
} | |
], | |
"name": "RescuerChanged", | |
"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" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"indexed": true, | |
"internalType": "address", | |
"name": "_account", | |
"type": "address" | |
} | |
], | |
"name": "UnBlacklisted", | |
"type": "event" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [], | |
"name": "Unpause", | |
"type": "event" | |
}, | |
{ | |
"inputs": [], | |
"name": "CANCEL_AUTHORIZATION_TYPEHASH", | |
"outputs": [ | |
{ | |
"internalType": "bytes32", | |
"name": "", | |
"type": "bytes32" | |
} | |
], | |
"stateMutability": "view", | |
"type": "function" | |
}, | |
{ | |
"inputs": [], | |
"name": "DOMAIN_SEPARATOR", | |
"outputs": [ | |
{ | |
"internalType": "bytes32", | |
"name": "", | |
"type": "bytes32" | |
} | |
], | |
"stateMutability": "view", | |
"type": "function" | |
}, | |
{ | |
"inputs": [], | |
"name": "PERMIT_TYPEHASH", | |
"outputs": [ | |
{ | |
"internalType": "bytes32", | |
"name": "", | |
"type": "bytes32" | |
} | |
], | |
"stateMutability": "view", | |
"type": "function" | |
}, | |
{ | |
"inputs": [], | |
"name": "RECEIVE_WITH_AUTHORIZATION_TYPEHASH", | |
"outputs": [ | |
{ | |
"internalType": "bytes32", | |
"name": "", | |
"type": "bytes32" | |
} | |
], | |
"stateMutability": "view", | |
"type": "function" | |
}, | |
{ | |
"inputs": [], | |
"name": "TRANSFER_WITH_AUTHORIZATION_TYPEHASH", | |
"outputs": [ | |
{ | |
"internalType": "bytes32", | |
"name": "", | |
"type": "bytes32" | |
} | |
], | |
"stateMutability": "view", | |
"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": "value", | |
"type": "uint256" | |
} | |
], | |
"name": "approve", | |
"outputs": [ | |
{ | |
"internalType": "bool", | |
"name": "", | |
"type": "bool" | |
} | |
], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "authorizer", | |
"type": "address" | |
}, | |
{ | |
"internalType": "bytes32", | |
"name": "nonce", | |
"type": "bytes32" | |
} | |
], | |
"name": "authorizationState", | |
"outputs": [ | |
{ | |
"internalType": "bool", | |
"name": "", | |
"type": "bool" | |
} | |
], | |
"stateMutability": "view", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "account", | |
"type": "address" | |
} | |
], | |
"name": "balanceOf", | |
"outputs": [ | |
{ | |
"internalType": "uint256", | |
"name": "", | |
"type": "uint256" | |
} | |
], | |
"stateMutability": "view", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "_account", | |
"type": "address" | |
} | |
], | |
"name": "blacklist", | |
"outputs": [], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [], | |
"name": "blacklister", | |
"outputs": [ | |
{ | |
"internalType": "address", | |
"name": "", | |
"type": "address" | |
} | |
], | |
"stateMutability": "view", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "uint256", | |
"name": "_amount", | |
"type": "uint256" | |
} | |
], | |
"name": "burn", | |
"outputs": [], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "authorizer", | |
"type": "address" | |
}, | |
{ | |
"internalType": "bytes32", | |
"name": "nonce", | |
"type": "bytes32" | |
}, | |
{ | |
"internalType": "uint8", | |
"name": "v", | |
"type": "uint8" | |
}, | |
{ | |
"internalType": "bytes32", | |
"name": "r", | |
"type": "bytes32" | |
}, | |
{ | |
"internalType": "bytes32", | |
"name": "s", | |
"type": "bytes32" | |
} | |
], | |
"name": "cancelAuthorization", | |
"outputs": [], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "minter", | |
"type": "address" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "minterAllowedAmount", | |
"type": "uint256" | |
} | |
], | |
"name": "configureMinter", | |
"outputs": [ | |
{ | |
"internalType": "bool", | |
"name": "", | |
"type": "bool" | |
} | |
], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [], | |
"name": "currency", | |
"outputs": [ | |
{ | |
"internalType": "string", | |
"name": "", | |
"type": "string" | |
} | |
], | |
"stateMutability": "view", | |
"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": "decrement", | |
"type": "uint256" | |
} | |
], | |
"name": "decreaseAllowance", | |
"outputs": [ | |
{ | |
"internalType": "bool", | |
"name": "", | |
"type": "bool" | |
} | |
], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "spender", | |
"type": "address" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "increment", | |
"type": "uint256" | |
} | |
], | |
"name": "increaseAllowance", | |
"outputs": [ | |
{ | |
"internalType": "bool", | |
"name": "", | |
"type": "bool" | |
} | |
], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "string", | |
"name": "tokenName", | |
"type": "string" | |
}, | |
{ | |
"internalType": "string", | |
"name": "tokenSymbol", | |
"type": "string" | |
}, | |
{ | |
"internalType": "string", | |
"name": "tokenCurrency", | |
"type": "string" | |
}, | |
{ | |
"internalType": "uint8", | |
"name": "tokenDecimals", | |
"type": "uint8" | |
}, | |
{ | |
"internalType": "address", | |
"name": "newMasterMinter", | |
"type": "address" | |
}, | |
{ | |
"internalType": "address", | |
"name": "newPauser", | |
"type": "address" | |
}, | |
{ | |
"internalType": "address", | |
"name": "newBlacklister", | |
"type": "address" | |
}, | |
{ | |
"internalType": "address", | |
"name": "newOwner", | |
"type": "address" | |
} | |
], | |
"name": "initialize", | |
"outputs": [], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "string", | |
"name": "newName", | |
"type": "string" | |
} | |
], | |
"name": "initializeV2", | |
"outputs": [], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "lostAndFound", | |
"type": "address" | |
} | |
], | |
"name": "initializeV2_1", | |
"outputs": [], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "_account", | |
"type": "address" | |
} | |
], | |
"name": "isBlacklisted", | |
"outputs": [ | |
{ | |
"internalType": "bool", | |
"name": "", | |
"type": "bool" | |
} | |
], | |
"stateMutability": "view", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "account", | |
"type": "address" | |
} | |
], | |
"name": "isMinter", | |
"outputs": [ | |
{ | |
"internalType": "bool", | |
"name": "", | |
"type": "bool" | |
} | |
], | |
"stateMutability": "view", | |
"type": "function" | |
}, | |
{ | |
"inputs": [], | |
"name": "masterMinter", | |
"outputs": [ | |
{ | |
"internalType": "address", | |
"name": "", | |
"type": "address" | |
} | |
], | |
"stateMutability": "view", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "_to", | |
"type": "address" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "_amount", | |
"type": "uint256" | |
} | |
], | |
"name": "mint", | |
"outputs": [ | |
{ | |
"internalType": "bool", | |
"name": "", | |
"type": "bool" | |
} | |
], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "minter", | |
"type": "address" | |
} | |
], | |
"name": "minterAllowance", | |
"outputs": [ | |
{ | |
"internalType": "uint256", | |
"name": "", | |
"type": "uint256" | |
} | |
], | |
"stateMutability": "view", | |
"type": "function" | |
}, | |
{ | |
"inputs": [], | |
"name": "name", | |
"outputs": [ | |
{ | |
"internalType": "string", | |
"name": "", | |
"type": "string" | |
} | |
], | |
"stateMutability": "view", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "owner", | |
"type": "address" | |
} | |
], | |
"name": "nonces", | |
"outputs": [ | |
{ | |
"internalType": "uint256", | |
"name": "", | |
"type": "uint256" | |
} | |
], | |
"stateMutability": "view", | |
"type": "function" | |
}, | |
{ | |
"inputs": [], | |
"name": "owner", | |
"outputs": [ | |
{ | |
"internalType": "address", | |
"name": "", | |
"type": "address" | |
} | |
], | |
"stateMutability": "view", | |
"type": "function" | |
}, | |
{ | |
"inputs": [], | |
"name": "pause", | |
"outputs": [], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [], | |
"name": "paused", | |
"outputs": [ | |
{ | |
"internalType": "bool", | |
"name": "", | |
"type": "bool" | |
} | |
], | |
"stateMutability": "view", | |
"type": "function" | |
}, | |
{ | |
"inputs": [], | |
"name": "pauser", | |
"outputs": [ | |
{ | |
"internalType": "address", | |
"name": "", | |
"type": "address" | |
} | |
], | |
"stateMutability": "view", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "owner", | |
"type": "address" | |
}, | |
{ | |
"internalType": "address", | |
"name": "spender", | |
"type": "address" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "value", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "deadline", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint8", | |
"name": "v", | |
"type": "uint8" | |
}, | |
{ | |
"internalType": "bytes32", | |
"name": "r", | |
"type": "bytes32" | |
}, | |
{ | |
"internalType": "bytes32", | |
"name": "s", | |
"type": "bytes32" | |
} | |
], | |
"name": "permit", | |
"outputs": [], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "from", | |
"type": "address" | |
}, | |
{ | |
"internalType": "address", | |
"name": "to", | |
"type": "address" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "value", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "validAfter", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "validBefore", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "bytes32", | |
"name": "nonce", | |
"type": "bytes32" | |
}, | |
{ | |
"internalType": "uint8", | |
"name": "v", | |
"type": "uint8" | |
}, | |
{ | |
"internalType": "bytes32", | |
"name": "r", | |
"type": "bytes32" | |
}, | |
{ | |
"internalType": "bytes32", | |
"name": "s", | |
"type": "bytes32" | |
} | |
], | |
"name": "receiveWithAuthorization", | |
"outputs": [], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "minter", | |
"type": "address" | |
} | |
], | |
"name": "removeMinter", | |
"outputs": [ | |
{ | |
"internalType": "bool", | |
"name": "", | |
"type": "bool" | |
} | |
], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "contract IERC20", | |
"name": "tokenContract", | |
"type": "address" | |
}, | |
{ | |
"internalType": "address", | |
"name": "to", | |
"type": "address" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "amount", | |
"type": "uint256" | |
} | |
], | |
"name": "rescueERC20", | |
"outputs": [], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [], | |
"name": "rescuer", | |
"outputs": [ | |
{ | |
"internalType": "address", | |
"name": "", | |
"type": "address" | |
} | |
], | |
"stateMutability": "view", | |
"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": "value", | |
"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": "value", | |
"type": "uint256" | |
} | |
], | |
"name": "transferFrom", | |
"outputs": [ | |
{ | |
"internalType": "bool", | |
"name": "", | |
"type": "bool" | |
} | |
], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "newOwner", | |
"type": "address" | |
} | |
], | |
"name": "transferOwnership", | |
"outputs": [], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "from", | |
"type": "address" | |
}, | |
{ | |
"internalType": "address", | |
"name": "to", | |
"type": "address" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "value", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "validAfter", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "validBefore", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "bytes32", | |
"name": "nonce", | |
"type": "bytes32" | |
}, | |
{ | |
"internalType": "uint8", | |
"name": "v", | |
"type": "uint8" | |
}, | |
{ | |
"internalType": "bytes32", | |
"name": "r", | |
"type": "bytes32" | |
}, | |
{ | |
"internalType": "bytes32", | |
"name": "s", | |
"type": "bytes32" | |
} | |
], | |
"name": "transferWithAuthorization", | |
"outputs": [], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "_account", | |
"type": "address" | |
} | |
], | |
"name": "unBlacklist", | |
"outputs": [], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [], | |
"name": "unpause", | |
"outputs": [], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "_newBlacklister", | |
"type": "address" | |
} | |
], | |
"name": "updateBlacklister", | |
"outputs": [], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "_newMasterMinter", | |
"type": "address" | |
} | |
], | |
"name": "updateMasterMinter", | |
"outputs": [], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "_newPauser", | |
"type": "address" | |
} | |
], | |
"name": "updatePauser", | |
"outputs": [], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "newRescuer", | |
"type": "address" | |
} | |
], | |
"name": "updateRescuer", | |
"outputs": [], | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [], | |
"name": "version", | |
"outputs": [ | |
{ | |
"internalType": "string", | |
"name": "", | |
"type": "string" | |
} | |
], | |
"stateMutability": "view", | |
"type": "function" | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment