Copy const mint = async () => {
const WETH = '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6'
const UNI = '0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984'
const uniswapV3NftManagerAddress = '0xc36442b4a4522e871399cd717abdd847ab11fe88'
const abi = [{
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "token0",
"type": "address"
},
{
"internalType": "address",
"name": "token1",
"type": "address"
},
{
"internalType": "uint24",
"name": "fee",
"type": "uint24"
},
{
"internalType": "int24",
"name": "tickLower",
"type": "int24"
},
{
"internalType": "int24",
"name": "tickUpper",
"type": "int24"
},
{
"internalType": "uint256",
"name": "amount0Desired",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amount1Desired",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amount0Min",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amount1Min",
"type": "uint256"
},
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"internalType": "struct INonfungiblePositionManager.MintParams",
"name": "params",
"type": "tuple"
}
],
"name": "mint",
"outputs": [
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
},
{
"internalType": "uint128",
"name": "liquidity",
"type": "uint128"
},
{
"internalType": "uint256",
"name": "amount0",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amount1",
"type": "uint256"
}
],
"stateMutability": "payable",
"type": "function"
},]
const web3 = new Web3(provider)
const uniswapV3NftManagerContract = new web3.eth.Contract(abi as AbiItem[], uniswapV3NftManagerAddress)
const deadline = Math.floor(Date.now() / 1000) + 60 * 10; // 10 minutes from now
const params = {
token0: UNI,
token1: WETH,
fee: 10000,
tickLower: -16000,
tickUpper: 16000,
amount0Desired: 10000000000000000,
amount1Desired: 1,
amount0Min: 10000000000000000,
amount1Min: 0,
recipient: safeAddress,
deadline,
}
const mintData = uniswapV3NftManagerContract.methods['mint'](params).encodeABI()
const name = 'ROLE_NAME'
const roleName = ethers.utils.formatBytes32String(name);
const receipt = await execTransactionFromModule(roleName, uniswapV3NftManagerAddress, '0', mintData, Operation.Call)
console.log('receipt: ', receipt)
}