I have a simple ERC20 token, and I would like to transfer the ownership of this contract onto a new address using the Ownable.sol transferOwnership() function
When I run this contract, it seems that this function call is going to cost me approximately 1.5 ETH (!!!) if I use a competitive Gas Price (215 GWEI). That seems very expensive considering its my understanding that all that is happening is one variable is being updated on the blockchain.
Am I running something wrong? Here is the etherscan information, I have tried to run it with a very low gas fee but it still seems to cost 0.15ETH (it will probably never be added to a block at this price)
https://etherscan.io/tx/0xb9c184899d8d19e53464509aabd3383508a2320ea67613d3f327a393d8961999
Here is my code:
const Web3 = require('web3');
const TestToken= artifacts.require('TestToken.sol');
const web3 = new Web3('https://ropsten.infura.io/v3/<MYKEY>');
module.exports = async function (deployer, network, accounts) {
const ADMIN_ADDRESS = "...";
const NEW_ADMIN = "...";
const TEST_TOKEN= await TestToken.at("...");
console.log('TEST governance token address: ' + TEST_TOKEN.address);
const TEST_OWNER = await TEST_TOKEN.owner();
console.log('The owner of the TEST governance token is: ' + TEST_OWNER);
console.log('Transferring Ownership Now');
let result = await TEST_TOKEN.transferOwnership(NEW_ADMIN);
const NEW_TEST_OWNER = await TEST_TOKEN.owner();
console.log('The new owner of the TEST governance token is: ' + NEW_TEST_OWNER);