Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(evm): gas usage in precompiles: limits, local gas meters #2093

Merged
merged 33 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
87355c8
feat(evm): gas usage in precompiles: limits, local gas meters
onikonychev Oct 25, 2024
c27bdad
fix: local precompile gas meters
onikonychev Oct 26, 2024
abd2d91
test(precompile): tests for precompile local gas meters
onikonychev Oct 28, 2024
f3e3b87
fix: increased funtoken precompile gas limit in favor to heavy user c…
onikonychev Oct 28, 2024
67de775
chore: moved evm grpc calls back to msg_server.go
onikonychev Oct 29, 2024
6845613
chore: resolve conflicts
onikonychev Oct 31, 2024
84c63b6
cleanup
onikonychev Oct 31, 2024
362ed5a
test: added sad test for precompile local gas
onikonychev Oct 31, 2024
3c9a984
Merge branch 'main' into fix/local-gas
k-yang Oct 31, 2024
c37446a
Merge branch 'main' into fix/local-gas
k-yang Oct 31, 2024
f602811
fix: duplicate import
k-yang Oct 31, 2024
3dc8f2c
chore: cleanup
onikonychev Oct 31, 2024
50c8247
Merge branch 'main' into fix/local-gas
k-yang Oct 31, 2024
947ddce
refactor: clean up imports
k-yang Oct 31, 2024
10fac9e
fix: bad merge
k-yang Oct 31, 2024
3ee5f59
cleanup
onikonychev Oct 31, 2024
df34075
Merge branch 'fix/local-gas' of github.com:NibiruChain/nibiru into fi…
onikonychev Oct 31, 2024
8151d98
fix: force switched precompile ctx gas configs
onikonychev Oct 31, 2024
3b94b1b
cleanup
onikonychev Oct 31, 2024
6ff8739
fix: gas used discrepancy in estimate gas vs actual execution gas
onikonychev Nov 1, 2024
c43219e
chore: cleaned up solidity contracts calling bankSend precompile
onikonychev Nov 1, 2024
e53d6ad
refactor(gas): simplify estimate gas error handling
k-yang Nov 2, 2024
dfaf522
refactor(gas): simplify EstimateGasForEvmCallType
k-yang Nov 2, 2024
cdeb00d
Merge branch 'main' of github.com:NibiruChain/nibiru into fix/local-gas
onikonychev Nov 4, 2024
f688bae
fix: comment on HandleOutOfGasPanic
onikonychev Nov 4, 2024
fe15859
Merge branch 'fix/local-gas' of github.com:NibiruChain/nibiru into fi…
onikonychev Nov 4, 2024
e67045e
Merge branch 'main' into fix/local-gas
k-yang Nov 4, 2024
f5d37ac
fix: missing gas limit call
k-yang Nov 4, 2024
667aec8
test: add WasmGasLimitQuery
k-yang Nov 4, 2024
fcaa604
refactor: update CallContractWIthInput
k-yang Nov 4, 2024
fa8063c
refactor(evm): prefer CallContract over CallContractWithInput
k-yang Nov 4, 2024
6d0deb8
refactor: add clarifying context to error messages
k-yang Nov 5, 2024
8d0e2fb
fix: eth api test
onikonychev Nov 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ for (1) ERC20 transfers with tokens that return false success values instead of
throwing an error and (2) ERC20 transfers with other operations that don't bring
about the expected resulting balance for the transfer recipient.
- [#2091](https://github.com/NibiruChain/nibiru/pull/2091) - feat(evm): add fun token creation fee validation
- [#2093](https://github.com/NibiruChain/nibiru/pull/2093) - feat(evm): gas usage in precompiles: limits, local gas meters
- [#2092](https://github.com/NibiruChain/nibiru/pull/2092) - feat(evm): add validation for wasm multi message execution
- [#2094](https://github.com/NibiruChain/nibiru/pull/2094) - fix(evm): Following
from the changs in #2086, this pull request implements a new `JournalChange`
Expand All @@ -92,15 +93,14 @@ The `NibiruBankKeeper` holds a reference to the current EVM `StateDB` and record
balance changes in wei as journal changes automatically. This guarantees that
commits and reversions of the `StateDB` do not misalign with the state of the
Bank module. This code change uses the `NibiruBankKeeper` on all modules that
depend on x/bank, such as the EVM and Wasm modules.
depend on x/bank, such as the EVM and Wasm modules.
- [#2097](https://github.com/NibiruChain/nibiru/pull/2097) - feat(evm): Add new query to get dated price from the oracle precompile
- [#2098](https://github.com/NibiruChain/nibiru/pull/2098) - test(evm): statedb
tests for race conditions within funtoken precompile
- [#2100](https://github.com/NibiruChain/nibiru/pull/2100) - refactor: cleanup statedb and precompile sections
- [#2101](https://github.com/NibiruChain/nibiru/pull/2101) - fix(evm): tx receipt proper marshalling
- [#2105](https://github.com/NibiruChain/nibiru/pull/2105) - test(evm): precompile call with revert


#### Nibiru EVM | Before Audit 1 - 2024-10-18

- [#1837](https://github.com/NibiruChain/nibiru/pull/1837) - feat(eth): protos, eth types, and evm module types
Expand Down
6 changes: 3 additions & 3 deletions eth/rpc/backend/call_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,10 @@ func (b *Backend) DoCall(
}

if res.Failed() {
if res.VmError != vm.ErrExecutionReverted.Error() {
return nil, status.Error(codes.Internal, res.VmError)
if res.VmError == vm.ErrExecutionReverted.Error() {
return nil, evm.NewRevertError(res.Ret)
}
return nil, evm.NewExecErrorWithReason(res.Ret)
return nil, status.Error(codes.Internal, res.VmError)
}

return res, nil
Expand Down
4 changes: 4 additions & 0 deletions evm-e2e/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
types
artifacts
cache
.env

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"_format": "hh-sol-artifact-1",
"contractName": "TestFunTokenPrecompileLocalGas",
"sourceName": "contracts/TestFunTokenPrecompileLocalGas.sol",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "erc20_",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"internalType": "string",
"name": "bech32Recipient",
"type": "string"
}
],
"name": "callBankSend",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"internalType": "string",
"name": "bech32Recipient",
"type": "string"
},
{
"internalType": "uint256",
"name": "customGas",
"type": "uint256"
}
],
"name": "callBankSendLocalGas",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"bytecode": "0x608060405234801561001057600080fd5b50604051610b6a380380610b6a833981810160405281019061003291906100db565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610108565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a88261007d565b9050919050565b6100b88161009d565b81146100c357600080fd5b50565b6000815190506100d5816100af565b92915050565b6000602082840312156100f1576100f0610078565b5b60006100ff848285016100c6565b91505092915050565b610a53806101176000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806359b6ed891461003b57806390d2b5e714610057575b600080fd5b6100556004803603810190610050919061066b565b610073565b005b610071600480360381019061006c91906106da565b610198565b005b600061080073ffffffffffffffffffffffffffffffffffffffff166303003bc58360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1687876040518563ffffffff1660e01b81526004016100d593929190610805565b60206040518083038160008887f11580156100f4573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906101199190610858565b9050838114610127826102ba565b610130866102ba565b60405160200161014192919061097f565b60405160208183030381529060405290610191576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018891906109cc565b60405180910390fd5b5050505050565b600061080073ffffffffffffffffffffffffffffffffffffffff166303003bc560008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685856040518463ffffffff1660e01b81526004016101f993929190610805565b6020604051808303816000875af1158015610218573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061023c9190610858565b905082811461024a826102ba565b610253856102ba565b60405160200161026492919061097f565b604051602081830303815290604052906102b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102ab91906109cc565b60405180910390fd5b50505050565b6060600060016102c984610388565b01905060008167ffffffffffffffff8111156102e8576102e7610540565b5b6040519080825280601f01601f19166020018201604052801561031a5781602001600182028036833780820191505090505b509050600082602001820190505b60011561037d578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8581610371576103706109ee565b5b04945060008503610328575b819350505050919050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106103e6577a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083816103dc576103db6109ee565b5b0492506040810190505b6d04ee2d6d415b85acef81000000008310610423576d04ee2d6d415b85acef81000000008381610419576104186109ee565b5b0492506020810190505b662386f26fc10000831061045257662386f26fc100008381610448576104476109ee565b5b0492506010810190505b6305f5e100831061047b576305f5e1008381610471576104706109ee565b5b0492506008810190505b61271083106104a0576127108381610496576104956109ee565b5b0492506004810190505b606483106104c357606483816104b9576104b86109ee565b5b0492506002810190505b600a83106104d2576001810190505b80915050919050565b6000604051905090565b600080fd5b600080fd5b6000819050919050565b610502816104ef565b811461050d57600080fd5b50565b60008135905061051f816104f9565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6105788261052f565b810181811067ffffffffffffffff8211171561059757610596610540565b5b80604052505050565b60006105aa6104db565b90506105b6828261056f565b919050565b600067ffffffffffffffff8211156105d6576105d5610540565b5b6105df8261052f565b9050602081019050919050565b82818337600083830152505050565b600061060e610609846105bb565b6105a0565b90508281526020810184848401111561062a5761062961052a565b5b6106358482856105ec565b509392505050565b600082601f83011261065257610651610525565b5b81356106628482602086016105fb565b91505092915050565b600080600060608486031215610684576106836104e5565b5b600061069286828701610510565b935050602084013567ffffffffffffffff8111156106b3576106b26104ea565b5b6106bf8682870161063d565b92505060406106d086828701610510565b9150509250925092565b600080604083850312156106f1576106f06104e5565b5b60006106ff85828601610510565b925050602083013567ffffffffffffffff8111156107205761071f6104ea565b5b61072c8582860161063d565b9150509250929050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061076182610736565b9050919050565b61077181610756565b82525050565b610780816104ef565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b838110156107c05780820151818401526020810190506107a5565b60008484015250505050565b60006107d782610786565b6107e18185610791565b93506107f18185602086016107a2565b6107fa8161052f565b840191505092915050565b600060608201905061081a6000830186610768565b6108276020830185610777565b818103604083015261083981846107cc565b9050949350505050565b600081519050610852816104f9565b92915050565b60006020828403121561086e5761086d6104e5565b5b600061087c84828501610843565b91505092915050565b600081905092915050565b7f4946756e546f6b656e2e62616e6b53656e64207375636365656465642062757460008201527f207472616e73666572726564207468652077726f6e6720616d6f756e74000000602082015250565b60006108ec603d83610885565b91506108f782610890565b603d82019050919050565b7f73656e74416d6f756e7420000000000000000000000000000000000000000000815250565b600061093382610786565b61093d8185610885565b935061094d8185602086016107a2565b80840191505092915050565b7f6578706563746564200000000000000000000000000000000000000000000000815250565b600061098a826108df565b915061099582610902565b600b820191506109a58285610928565b91506109b082610959565b6009820191506109c08284610928565b91508190509392505050565b600060208201905081810360008301526109e681846107cc565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fdfea26469706673582212203b80aa046928bf6b13cd29898611f9a4f048688dc21bfd44094fd59d8080e66064736f6c63430008180033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c806359b6ed891461003b57806390d2b5e714610057575b600080fd5b6100556004803603810190610050919061066b565b610073565b005b610071600480360381019061006c91906106da565b610198565b005b600061080073ffffffffffffffffffffffffffffffffffffffff166303003bc58360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1687876040518563ffffffff1660e01b81526004016100d593929190610805565b60206040518083038160008887f11580156100f4573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906101199190610858565b9050838114610127826102ba565b610130866102ba565b60405160200161014192919061097f565b60405160208183030381529060405290610191576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018891906109cc565b60405180910390fd5b5050505050565b600061080073ffffffffffffffffffffffffffffffffffffffff166303003bc560008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685856040518463ffffffff1660e01b81526004016101f993929190610805565b6020604051808303816000875af1158015610218573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061023c9190610858565b905082811461024a826102ba565b610253856102ba565b60405160200161026492919061097f565b604051602081830303815290604052906102b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102ab91906109cc565b60405180910390fd5b50505050565b6060600060016102c984610388565b01905060008167ffffffffffffffff8111156102e8576102e7610540565b5b6040519080825280601f01601f19166020018201604052801561031a5781602001600182028036833780820191505090505b509050600082602001820190505b60011561037d578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8581610371576103706109ee565b5b04945060008503610328575b819350505050919050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106103e6577a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083816103dc576103db6109ee565b5b0492506040810190505b6d04ee2d6d415b85acef81000000008310610423576d04ee2d6d415b85acef81000000008381610419576104186109ee565b5b0492506020810190505b662386f26fc10000831061045257662386f26fc100008381610448576104476109ee565b5b0492506010810190505b6305f5e100831061047b576305f5e1008381610471576104706109ee565b5b0492506008810190505b61271083106104a0576127108381610496576104956109ee565b5b0492506004810190505b606483106104c357606483816104b9576104b86109ee565b5b0492506002810190505b600a83106104d2576001810190505b80915050919050565b6000604051905090565b600080fd5b600080fd5b6000819050919050565b610502816104ef565b811461050d57600080fd5b50565b60008135905061051f816104f9565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6105788261052f565b810181811067ffffffffffffffff8211171561059757610596610540565b5b80604052505050565b60006105aa6104db565b90506105b6828261056f565b919050565b600067ffffffffffffffff8211156105d6576105d5610540565b5b6105df8261052f565b9050602081019050919050565b82818337600083830152505050565b600061060e610609846105bb565b6105a0565b90508281526020810184848401111561062a5761062961052a565b5b6106358482856105ec565b509392505050565b600082601f83011261065257610651610525565b5b81356106628482602086016105fb565b91505092915050565b600080600060608486031215610684576106836104e5565b5b600061069286828701610510565b935050602084013567ffffffffffffffff8111156106b3576106b26104ea565b5b6106bf8682870161063d565b92505060406106d086828701610510565b9150509250925092565b600080604083850312156106f1576106f06104e5565b5b60006106ff85828601610510565b925050602083013567ffffffffffffffff8111156107205761071f6104ea565b5b61072c8582860161063d565b9150509250929050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061076182610736565b9050919050565b61077181610756565b82525050565b610780816104ef565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b838110156107c05780820151818401526020810190506107a5565b60008484015250505050565b60006107d782610786565b6107e18185610791565b93506107f18185602086016107a2565b6107fa8161052f565b840191505092915050565b600060608201905061081a6000830186610768565b6108276020830185610777565b818103604083015261083981846107cc565b9050949350505050565b600081519050610852816104f9565b92915050565b60006020828403121561086e5761086d6104e5565b5b600061087c84828501610843565b91505092915050565b600081905092915050565b7f4946756e546f6b656e2e62616e6b53656e64207375636365656465642062757460008201527f207472616e73666572726564207468652077726f6e6720616d6f756e74000000602082015250565b60006108ec603d83610885565b91506108f782610890565b603d82019050919050565b7f73656e74416d6f756e7420000000000000000000000000000000000000000000815250565b600061093382610786565b61093d8185610885565b935061094d8185602086016107a2565b80840191505092915050565b7f6578706563746564200000000000000000000000000000000000000000000000815250565b600061098a826108df565b915061099582610902565b600b820191506109a58285610928565b91506109b082610959565b6009820191506109c08284610928565b91508190509392505050565b600060208201905081810360008301526109e681846107cc565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fdfea26469706673582212203b80aa046928bf6b13cd29898611f9a4f048688dc21bfd44094fd59d8080e66064736f6c63430008180033",
"linkReferences": {},
"deployedLinkReferences": {}
}
22 changes: 14 additions & 8 deletions x/evm/embeds/contracts/TestERC20TransferThenPrecompileSend.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,21 @@ contract TestERC20TransferThenPrecompileSend {
"ERC-20 transfer failed"
);

(bool success, ) = FUNTOKEN_PRECOMPILE_ADDRESS.call(
abi.encodeWithSignature(
"bankSend(address,uint256,string)",
erc20,
uint256(precompileAmount),
precompileRecipient
)
uint256 sentAmount = FUNTOKEN_PRECOMPILE.bankSend(
erc20,
precompileAmount,
precompileRecipient
);

require(success, string.concat("Failed to call bankSend"));
require(
sentAmount == precompileAmount,
string.concat(
"IFunToken.bankSend succeeded but transferred the wrong amount",
"sentAmount ",
Strings.toString(sentAmount),
"expected ",
Strings.toString(precompileAmount)
)
);
Comment on lines +34 to +43
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Optimize error handling using custom errors.

The current string concatenation approach for error messages is gas-intensive. Consider using custom errors, which are more gas-efficient and provide the same level of detail.

Here's how you could optimize this:

+error InvalidSentAmount(uint256 sent, uint256 expected);

 function erc20TransferThenPrecompileSend(
     address payable transferRecipient,
     uint256 transferAmount,
     string memory precompileRecipient,
     uint256 precompileAmount
 ) public {
     require(
         ERC20(erc20).transfer(transferRecipient, transferAmount),
         "ERC-20 transfer failed"
     );

     uint256 sentAmount = FUNTOKEN_PRECOMPILE.bankSend(
         erc20,
         precompileAmount,
         precompileRecipient
     );

-    require(
-        sentAmount == precompileAmount,
-        string.concat(
-            "IFunToken.bankSend succeeded but transferred the wrong amount",
-            "sentAmount ",
-            Strings.toString(sentAmount),
-            "expected ",
-            Strings.toString(precompileAmount)
-        )
-    );
+    if (sentAmount != precompileAmount) {
+        revert InvalidSentAmount(sentAmount, precompileAmount);
+    }
 }

Committable suggestion skipped: line range outside the PR's diff.

}
}
60 changes: 60 additions & 0 deletions x/evm/embeds/contracts/TestFunTokenPrecompileLocalGas.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./IFunToken.sol";
import "@openzeppelin/contracts/utils/Strings.sol";

contract TestFunTokenPrecompileLocalGas {
address erc20;

constructor(address erc20_) {
erc20 = erc20_;
}
onikonychev marked this conversation as resolved.
Show resolved Hide resolved

// Calls bankSend of the FunToken Precompile with the default gas.
// Internal call could use all the gas for the parent call.
function callBankSend(
uint256 amount,
string memory bech32Recipient
) public {
uint256 sentAmount = FUNTOKEN_PRECOMPILE.bankSend(
erc20,
amount,
bech32Recipient
);
require(
sentAmount == amount,
string.concat(
"IFunToken.bankSend succeeded but transferred the wrong amount",
"sentAmount ",
Strings.toString(sentAmount),
"expected ",
Strings.toString(amount)
)
);
}

// Calls bankSend of the FunToken Precompile with the gas amount set in parameter.
// Internal call should fail if the gas provided is insufficient.
function callBankSendLocalGas(
uint256 amount,
string memory bech32Recipient,
uint256 customGas
) public {
uint256 sentAmount = FUNTOKEN_PRECOMPILE.bankSend{gas: customGas}(
erc20,
amount,
bech32Recipient
);
require(
sentAmount == amount,
string.concat(
"IFunToken.bankSend succeeded but transferred the wrong amount",
"sentAmount ",
Strings.toString(sentAmount),
"expected ",
Strings.toString(amount)
)
);
}
}
9 changes: 9 additions & 0 deletions x/evm/embeds/embeds.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ var (
testErc20MaliciousNameJson []byte
//go:embed artifacts/contracts/TestERC20MaliciousTransfer.sol/TestERC20MaliciousTransfer.json
testErc20MaliciousTransferJson []byte
//go:embed artifacts/contracts/TestFunTokenPrecompileLocalGas.sol/TestFunTokenPrecompileLocalGas.json
testFunTokenPrecompileLocalGasJson []byte
//go:embed artifacts/contracts/TestERC20TransferThenPrecompileSend.sol/TestERC20TransferThenPrecompileSend.json
testERC20TransferThenPrecompileSendJson []byte
//go:embed artifacts/contracts/TestNativeSendThenPrecompileSend.sol/TestNativeSendThenPrecompileSend.json
Expand Down Expand Up @@ -82,6 +84,12 @@ var (
Name: "TestERC20MaliciousTransfer.sol",
EmbedJSON: testErc20MaliciousTransferJson,
}
// SmartContract_TestFunTokenPrecompileLocalGas is a test contract
// which allows precompile execution with custom local gas set (calling precompile within contract)
SmartContract_TestFunTokenPrecompileLocalGas = CompiledEvmContract{
Name: "TestFunTokenPrecompileLocalGas.sol",
EmbedJSON: testFunTokenPrecompileLocalGasJson,
}
// SmartContract_TestNativeSendThenPrecompileSendJson is a test contract
// that performs two sends in a single call: a native nibi send and a precompile bankSend.
// It tests a race condition where the state DB commit
Expand Down Expand Up @@ -118,6 +126,7 @@ func init() {
SmartContract_TestERC20.MustLoad()
SmartContract_TestERC20MaliciousName.MustLoad()
SmartContract_TestERC20MaliciousTransfer.MustLoad()
SmartContract_TestFunTokenPrecompileLocalGas.MustLoad()
SmartContract_TestNativeSendThenPrecompileSendJson.MustLoad()
SmartContract_TestERC20TransferThenPrecompileSend.MustLoad()
SmartContract_TestPrecompileSelfCallRevert.MustLoad()
Expand Down
1 change: 1 addition & 0 deletions x/evm/embeds/embeds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ func TestLoadContracts(t *testing.T) {
embeds.SmartContract_TestERC20.MustLoad()
embeds.SmartContract_TestERC20MaliciousName.MustLoad()
embeds.SmartContract_TestERC20MaliciousTransfer.MustLoad()
embeds.SmartContract_TestFunTokenPrecompileLocalGas.MustLoad()
embeds.SmartContract_TestNativeSendThenPrecompileSendJson.MustLoad()
embeds.SmartContract_TestERC20TransferThenPrecompileSend.MustLoad()
})
Expand Down
Loading
Loading