There’s an error when I set sponsor for collateral. It said that the smart contract execution error or insufficient gas fee. Is this due to gaslimit?
Gas fee sponsorship may fail in Conflux Studio v0.5.0
We tested and located the issue, and confirmed that the reason is that the function name of SponsorWhitelistControl in Conflux v1.0 or higher changed from “snake case” into “camel case”, while in the latest Conflux Studio (v0.5.0), the default SponsorWhitelistControl function name is still “snake case”.
We will fix this issue in the next version. Before that, we set a temporary solution for sponsorship:
- Change the SponsorWhitelistControl.sol into https://github.com/Conflux-Chain/conflux-rust/blob/master/internal_contract/contracts/SponsorWhitelistControl.sol in the contract. This is to change “snake case” into “camel case”
- Replace the “add_privilege” and “remove_privilege” in Coin.sol with “addPrivilege” and “removePrivilege” in the camel case
- Open the ABI Storage in Contract page, click New, and enter the following information:
Name: SponsorWhitelistControl
Code hash/address: 0x0888000000000000000000000000000000000001
ABI:
[ { "constant": false, "inputs": [ { "internalType": "address[]", "name": "", "type": "address[]" } ], "name": "addPrivilege", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address[]", "name": "", "type": "address[]" } ], "name": "removePrivilege", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "contract_addr", "type": "address" } ], "name": "setSponsorForCollateral", "outputs": [], "payable": true, "stateMutability": "payable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "contract_addr", "type": "address" }, { "internalType": "uint256", "name": "upper_bound", "type": "uint256" } ], "name": "setSponsorForGas", "outputs": [], "payable": true, "stateMutability": "payable", "type": "function" } ]
Meanwhile, you need to know that you should enter a value in “CFX to Transfer”. If you leave it blank, it will fail.