I have deployed a PoA network using Hyperledger Besu and I'm using Remix in order to code a very simple smart contract.
Here is the smart contract code:
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.8;
contract management {
address [] public addressArray; // List of accounts agents
constructor( ) public {
addressArray.push (0x5170147D2e73C876Ab19dA687fBBC0fDD7d5C24B);
addressArray.push (0x81537B2D16C0107E4E5368a96C34CddE631f6574);
addressArray.push (0x3A1efCfF3C76BF5a4EF07264C7b13097f3111d8e);
addressArray.push (0x4048cA94C733470FD968C849Df0BD61C4d472550);
addressArray.push (0xa021Fbd79c01419F1867058597713D25fEb0cC91);
addressArray.push (0x4637EC7fe8C8Eb7Dd6B5B087070B99b4c4b86137);
}
function removeAgent () public {
addressArray.pop();
}
function addAgent (address _newAddress) public {
addressArray.push(_newAddress);
}
}
When I deploy the smart contract, I can access to array elements and I can use addAgent method, but if I try to send the transaction of removeAgent method, I get this error on Remix:
transact to management.removeAgent errored: Error: Returned error: Intrinsic gas exceeds gas limit
I have tried to use a large number of gas (6000000000), but the error persists. If I comment the addressArray.pop() code line, I can use the method.
So, what's the problem with addressArray.pop()? Any idea?