Whilst developing the ENS-1155 solution there were issues found when trying to renew a tokens expiry, to mimic the same functionality via the ENS-721 solution.
Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (reason="execution reverted", method="estimateGas", transaction={"from":"0x7abaEd470E89820738B5e58874dFa7a77F9Cd44d","to":"0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85","data":"0xc475abff22bc263f964cc8eb063fab871e2501b69d210341f05969918ff6e3afd73f92060000000000000000000000000000000000000000000000000000000001e13380","accessList":null}, error={"code":-32000,"message":"execution reverted"}, code=UNPREDICTABLE_GAS_LIMIT, version=providers/5.7.2)
Towards investigating this issue - when re-creating this scenario with Ethers JS the transaction can reach the wallet for confirmation.
const contractAddress = '0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85';
const contractABI = [
{
"constant": false,
"inputs": [
{ "internalType": "uint256", "name": "id", "type": "uint256" },
{ "internalType": "uint256", "name": "duration", "type": "uint256" }
],
"name": "renew",
"outputs": [
{ "internalType": "uint256", "name": "", "type": "uint256" }
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
];
async function renewContract() {
var wallet = 'YOUR_WALLET_SIGNER';
const contract = new _ethers.Contract(contractAddress, contractABI, wallet);
const id = 'token id'; (decimal)
const duration = 31536000n;
try {
const transaction = await contract.renew(id, duration, { gasLimit: 200000 });
await transaction.wait();
console.log('Transaction successful:', transaction.hash);
} catch (error) {
console.error('Transaction failed:', error.message);
}
}
renewContract();
At this time, I'm unsure if this is a TS issue or if there is a misconfiguration on my side.