Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/x/evm/embeds/secp256…
Browse files Browse the repository at this point in the history
…k1-4.0.4
  • Loading branch information
Unique-Divine authored Oct 24, 2024
2 parents f932df9 + dd27f4b commit baaa950
Show file tree
Hide file tree
Showing 86 changed files with 1,756 additions and 403 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/e2e-evm.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: EVM e2e tests
name: EVM E2E tests

on:
pull_request:
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:

- name: "just install"
run: just install
working-directory: "e2e/evm"
working-directory: "evm-e2e"

- name: "Launch localnet"
run: |
Expand All @@ -78,7 +78,7 @@ jobs:
- name: "Run tests (just test)"
run: just test
working-directory: "e2e/evm"
working-directory: "evm-e2e"
env:
JSON_RPC_ENDPOINT: http://127.0.0.1:8545
MNEMONIC: guard cream sadness conduct invite crumble clock pudding hole grit liar hotel maid produce squeeze return argue turtle know drive eight casino maze host
2 changes: 1 addition & 1 deletion .github/workflows/e2e-wasm.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CosmWasm e2e tests
name: Wasm E2E tests

on:
# On normal PRs or when workflow goreleaser finishes, as it gets the last release tag.
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
Use effective gas price in RefundGas and make sure that units are properly
reflected on all occurences of "base fee" in the codebase. This fixes [#2059](https://github.com/NibiruChain/nibiru/issues/2059)
and the [related comments from @Unique-Divine and @berndartmueller](https://github.com/NibiruChain/nibiru/issues/2059#issuecomment-2408625724).
- [#2084](https://github.com/NibiruChain/nibiru/pull/2084) - feat(evm-forge): foundry support and template for Nibiru EVM develoment
- [#2088](https://github.com/NibiruChain/nibiru/pull/2088) - refactor(evm): remove outdated comment and improper error message text
- [#2089](https://github.com/NibiruChain/nibiru/pull/2089) - better handling of gas consumption within erc20 contract execution


#### Dapp modules: perp, spot, oracle, etc
Expand Down
10 changes: 5 additions & 5 deletions app/evmante/evmante_gas_consume.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,18 +157,18 @@ func (anteDec AnteDecEthGasConsume) AnteHandle(
return next(newCtx, tx, simulate)
}

// deductFee checks if the fee payer has enough funds to pay for the fees and deducts them.
// If the spendable balance is not enough, it tries to claim enough staking rewards to cover the fees.
// deductFee checks if the fee payer has enough funds to pay for the fees and
// deducts them.
func (anteDec AnteDecEthGasConsume) deductFee(
ctx sdk.Context, fees sdk.Coins, feePayer sdk.AccAddress,
) error {
if fees.IsZero() {
return nil
}

// If the account balance is not sufficient, try to withdraw enough staking rewards

if err := anteDec.evmKeeper.DeductTxCostsFromUserBalance(ctx, fees, gethcommon.BytesToAddress(feePayer)); err != nil {
if err := anteDec.evmKeeper.DeductTxCostsFromUserBalance(
ctx, fees, gethcommon.BytesToAddress(feePayer),
); err != nil {
return errors.Wrapf(err, "failed to deduct transaction costs from user balance")
}
return nil
Expand Down
64 changes: 0 additions & 64 deletions docs/adr/00-adr-template.md

This file was deleted.

107 changes: 0 additions & 107 deletions docs/adr/01-adr-msg-server-keeper.md

This file was deleted.

50 changes: 0 additions & 50 deletions docs/adr/README.md

This file was deleted.

10 changes: 6 additions & 4 deletions eth/indexer.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* accordingly.
*
* The methods tested are from the smart contract,
* "e2e/evm/contracts/SendReceiveNibi.sol".
* "evm-e2e/contracts/SendReceiveNibi.sol".
*/
import { describe, expect, it } from "@jest/globals"
import { parseEther, toBigInt, Wallet } from "ethers"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 19 additions & 0 deletions evm-forge/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# EditorConfig http://EditorConfig.org

# top-most EditorConfig file
root = true

# All files
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.sol]
indent_size = 4

[*.tree]
indent_size = 1
11 changes: 11 additions & 0 deletions evm-forge/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export API_KEY_ALCHEMY="YOUR_API_KEY_ALCHEMY"
export API_KEY_ARBISCAN="YOUR_API_KEY_ARBISCAN"
export API_KEY_BSCSCAN="YOUR_API_KEY_BSCSCAN"
export API_KEY_ETHERSCAN="YOUR_API_KEY_ETHERSCAN"
export API_KEY_GNOSISSCAN="YOUR_API_KEY_GNOSISSCAN"
export API_KEY_INFURA="YOUR_API_KEY_INFURA"
export API_KEY_OPTIMISTIC_ETHERSCAN="YOUR_API_KEY_OPTIMISTIC_ETHERSCAN"
export API_KEY_POLYGONSCAN="YOUR_API_KEY_POLYGONSCAN"
export API_KEY_SNOWTRACE="YOUR_API_KEY_SNOWTRACE"
export MNEMONIC="YOUR_MNEMONIC"
export FOUNDRY_PROFILE="default"
2 changes: 2 additions & 0 deletions evm-forge/.github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
custom: "https://3cities.xyz/#/pay?c=CAESFAKY9DMuOFdjE4Wzl2YyUFipPiSfIgICATICCAJaFURvbmF0aW9uIHRvIFBhdWwgQmVyZw"
github: "PaulRBerg"
38 changes: 38 additions & 0 deletions evm-forge/.github/scripts/rename.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash

# https://gist.github.com/vncsna/64825d5609c146e80de8b1fd623011ca
set -euo pipefail

# Define the input vars
GITHUB_REPOSITORY=${1?Error: Please pass username/repo, e.g. prb/foundry-template}
GITHUB_REPOSITORY_OWNER=${2?Error: Please pass username, e.g. prb}
GITHUB_REPOSITORY_DESCRIPTION=${3:-""} # If null then replace with empty string

echo "GITHUB_REPOSITORY: $GITHUB_REPOSITORY"
echo "GITHUB_REPOSITORY_OWNER: $GITHUB_REPOSITORY_OWNER"
echo "GITHUB_REPOSITORY_DESCRIPTION: $GITHUB_REPOSITORY_DESCRIPTION"

# jq is like sed for JSON data
JQ_OUTPUT=`jq \
--arg NAME "@$GITHUB_REPOSITORY" \
--arg AUTHOR_NAME "$GITHUB_REPOSITORY_OWNER" \
--arg URL "https://github.com/$GITHUB_REPOSITORY_OWNER" \
--arg DESCRIPTION "$GITHUB_REPOSITORY_DESCRIPTION" \
'.name = $NAME | .description = $DESCRIPTION | .author |= ( .name = $AUTHOR_NAME | .url = $URL )' \
package.json
`

# Overwrite package.json
echo "$JQ_OUTPUT" > package.json

# Make sed command compatible in both Mac and Linux environments
# Reference: https://stackoverflow.com/a/38595160/8696958
sedi () {
sed --version >/dev/null 2>&1 && sed -i -- "$@" || sed -i "" "$@"
}

# Rename instances of "PaulRBerg/foundry-template" to the new repo name in README.md for badges only
sedi "/gitpod/ s|PaulRBerg/foundry-template|"${GITHUB_REPOSITORY}"|;" "README.md"
sedi "/gitpod-badge/ s|PaulRBerg/foundry-template|"${GITHUB_REPOSITORY}"|;" "README.md"
sedi "/gha/ s|PaulRBerg/foundry-template|"${GITHUB_REPOSITORY}"|;" "README.md"
sedi "/gha-badge/ s|PaulRBerg/foundry-template|"${GITHUB_REPOSITORY}"|;" "README.md"
Loading

0 comments on commit baaa950

Please sign in to comment.