Skip to content

Commit

Permalink
chore: merge main to v13 release branch (#1632)
Browse files Browse the repository at this point in the history
* chore: add precompile params init (to `main`) (#1544)

chore: add precompile params init

* fix (ci): fix bsr push action (#1547)

fix bsr push action

* fix: remove linux/836 from docker image CI  (#1546)

* fix docker build

* fix lint issues

* add changelog entry

* fix md lint issues

---------

Co-authored-by: tom <tomasguerraalda@hotmail.com>
Co-authored-by: Tom <54514587+GAtom22@users.noreply.github.com>

* build(deps): bump golang from 1.20.3-bullseye to 1.20.4-bullseye (#1550)

Bumps golang from 1.20.3-bullseye to 1.20.4-bullseye.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* docs(readme): improve structure (#1552)

* build(deps): bump bufbuild/buf-setup-action from 1.17.0 to 1.18.0 (#1559)

Bumps [bufbuild/buf-setup-action](https://github.com/bufbuild/buf-setup-action) from 1.17.0 to 1.18.0.
- [Release notes](https://github.com/bufbuild/buf-setup-action/releases)
- [Commits](bufbuild/buf-setup-action@v1.17.0...v1.18.0)

---
updated-dependencies:
- dependency-name: bufbuild/buf-setup-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com>

* chore: run make proto-all  (#1551)

Run make proto-all to regenerate .pb.go files

Co-authored-by: Tom <54514587+GAtom22@users.noreply.github.com>

* chore(evm): fix typo in EVM utils comment (#1560)

* fix typo

* some more typos

---------

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* build(deps): bump bufbuild/buf-setup-action from 1.18.0 to 1.19.0 (#1565)

Bumps [bufbuild/buf-setup-action](https://github.com/bufbuild/buf-setup-action) from 1.18.0 to 1.19.0.
- [Release notes](https://github.com/bufbuild/buf-setup-action/releases)
- [Commits](bufbuild/buf-setup-action@v1.18.0...v1.19.0)

---
updated-dependencies:
- dependency-name: bufbuild/buf-setup-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* deps: bump sdk version to v0.46.11-alpha.ledger.7 (#1567)

* deps: bump sdk version

* add changelog entry

* imp(tests) add commit function to keep ctx settings for tests (#1517)

* add commit function to keep ctx settings for tests

* fix lint issues

* reset gas meter

* rename func

* update based on review comments

---------

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* feat(client): add subcommand debug legacy-eip712 (#1556)

* feat(client): add subcommand debug legacy-eip712

Signed-off-by: Shane <im.xianying@gmail.com>

* refactor(client): use wrap instead of wrapf

* chore(client): add comment

---------

Signed-off-by: Shane <im.xianying@gmail.com>
Co-authored-by: Tom <54514587+GAtom22@users.noreply.github.com>
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* chore: update changelog w/ v12.1.3 (#1570)

* deps: bump ibc-go version (#1571)

* chore: update changelog with v12.1.4 (#1576)

update changelog with v12.1.4

* chore(deps): bump ibc-go version to v6.2.0 (#1581)

* build(deps): bump golang from 1.20.4-bullseye to 1.20.5-bullseye (#1584)

Bumps golang from 1.20.4-bullseye to 1.20.5-bullseye.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump bufbuild/buf-setup-action from 1.19.0 to 1.21.0 (#1583)

Bumps [bufbuild/buf-setup-action](https://github.com/bufbuild/buf-setup-action) from 1.19.0 to 1.21.0.
- [Release notes](https://github.com/bufbuild/buf-setup-action/releases)
- [Commits](bufbuild/buf-setup-action@v1.19.0...v1.21.0)

---
updated-dependencies:
- dependency-name: bufbuild/buf-setup-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com>

* build(deps): bump @openzeppelin/contracts from 4.8.3 to 4.9.1 in /contracts (#1587)

build(deps): bump @openzeppelin/contracts in /contracts

Bumps [@openzeppelin/contracts](https://github.com/OpenZeppelin/openzeppelin-contracts) from 4.8.3 to 4.9.1.
- [Release notes](https://github.com/OpenZeppelin/openzeppelin-contracts/releases)
- [Changelog](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.1/CHANGELOG.md)
- [Commits](OpenZeppelin/openzeppelin-contracts@v4.8.3...v4.9.1)

---
updated-dependencies:
- dependency-name: "@openzeppelin/contracts"
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com>
Co-authored-by: Vladislav Varadinov <vladislav.varadinov@gmail.com>

* [Snyk] Security upgrade @openzeppelin/contracts from 4.8.3 to 4.9.1 (#1588)

fix: contracts/package.json & contracts/package-lock.json to reduce vulnerabilities

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-OPENZEPPELINCONTRACTS-5672116

Co-authored-by: Vladislav Varadinov <vladislav.varadinov@gmail.com>

* build(deps): bump golangci/golangci-lint-action from 3.4.0 to 3.5.0 (#1582)

* build(deps): bump golangci/golangci-lint-action from 3.4.0 to 3.5.0

Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3.4.0 to 3.5.0.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](golangci/golangci-lint-action@v3.4.0...v3.5.0)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* remove depguard linter

* address nakedret linter

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: MalteHerrmann <malte@evmos.org>
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* chore: add ics20 precompile (#1578)

* chore: add ics20 precompile

* update dependencies

* go mod tidy

* Update x/evm/keeper/precompiles.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* fix: update go.mod and params comments

* CHANGELOG

---------

Co-authored-by: Vladislav Varadinov <vladislav.varadinov@gmail.com>
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Update Makefile. enable CGO (#1590)

Update Makefile

* Update cometbft & goleveldb (#1595)

* update cometbft & goleveldb

* fix: run go mod tidy

---------

Co-authored-by: Vladislav Varadinov <vladislav.varadinov@gmail.com>

* fix: add MsgCreateClawbackVestingAccount period validation (#1596)

* fix: add MsgCreateClawbackVestingAccount period validation

* add correct err message

---------

Co-authored-by: Vladislav <vladislav.varadinov@gmail.com>

* fix: update geth fork (#1597)

* fix: update geth fork

* CHANGELOG

* build(deps): bump golangci/golangci-lint-action from 3.5.0 to 3.6.0 (#1591)

Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3.5.0 to 3.6.0.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](golangci/golangci-lint-action@v3.5.0...v3.6.0)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Upstream changelog changes from v13.0.0-rc2 (#1601)

* upstream changelog changes

* remove unnecessary log

* fix: Fixed the BaseDenom and wrong comparison for MaxUint256 (#1602)

* update precompiles version

* fix: bump precompiles repo

* fix linter

* Update Dockerfile (#1606)

* Update Dockerfile

* pin ca-certificates version

---------

Co-authored-by: DevOps <devops@nowhere.com>

* feat(revenue): route gas fees paid from calling precompiles to community pool (#1607)

* feat(revenue): route gas fees paid from calling precompiles to community pool

* lint and format

* fix: added problematic test case

* fix: cleanup check

* fix: added account keeper and problematic test case

* fix tests

* fix tests

* fix: lint

* refactor post processing hooks

* refractor hooks

* avoid performing unnesary logic

* fix lint

---------

Co-authored-by: Freddy Caceres <facs95@gmail.com>

* build(deps): bump @openzeppelin/contracts from 4.9.1 to 4.9.2 in /contracts (#1608)

build(deps): bump @openzeppelin/contracts in /contracts

Bumps [@openzeppelin/contracts](https://github.com/OpenZeppelin/openzeppelin-contracts) from 4.9.1 to 4.9.2.
- [Release notes](https://github.com/OpenZeppelin/openzeppelin-contracts/releases)
- [Changelog](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.2/CHANGELOG.md)
- [Commits](OpenZeppelin/openzeppelin-contracts@v4.9.1...v4.9.2)

---
updated-dependencies:
- dependency-name: "@openzeppelin/contracts"
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Freddy Caceres <facs95@gmail.com>
Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com>

* build(deps): bump bufbuild/buf-setup-action from 1.21.0 to 1.22.0 (#1614)

Bumps [bufbuild/buf-setup-action](https://github.com/bufbuild/buf-setup-action) from 1.21.0 to 1.22.0.
- [Release notes](https://github.com/bufbuild/buf-setup-action/releases)
- [Commits](bufbuild/buf-setup-action@v1.21.0...v1.22.0)

---
updated-dependencies:
- dependency-name: bufbuild/buf-setup-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com>

* update Makefile (#1618)

* add snapshot cmds (#1619)

Co-authored-by: Marko Baricevic <markobaricevic3778@gmail.com>

* tests: add timeout packet case for registered erc20 (#1615)

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* chore(server): adjust default app configuration to disable all server options (#1623)

adjust default app configuration to disable all server options

* imp(ci): add license checker (#1624)

* add license checker script

* add make command

* add GitHub workflow

* adjust printed string

* only run GH action on relevant changes

* address linter comments

* address more linter comments

* build(deps): bump bufbuild/buf-setup-action from 1.22.0 to 1.23.0 (#1622)

Bumps [bufbuild/buf-setup-action](https://github.com/bufbuild/buf-setup-action) from 1.22.0 to 1.23.0.
- [Release notes](https://github.com/bufbuild/buf-setup-action/releases)
- [Commits](bufbuild/buf-setup-action@v1.22.0...v1.23.0)

---
updated-dependencies:
- dependency-name: bufbuild/buf-setup-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(changelog): add missing changelog entries (#1628)

add missing changelog entries

* fix(app): dereference the pointer for the app config (#1626)

dereference the pointer for the app config

Co-authored-by: Tom <54514587+GAtom22@users.noreply.github.com>

* chore(proto): add licenses to proto files (#1627)

* add proto files to license checker LGPL3 files

* add license comments to proto files

* chore: update changelog with v12.1.5 (#1630)

update changelog with v12.1.5

* chore: move precompiles to repo (#1625)

* move precompiles to repo

* add changelog entry

* add lic

* fix chlog

* add licenses

* fix test

* enable json-rpc on local_node.sh

* enable json-rpc on tests scripts

* enable json-rpc on init-node script

* enable api on init-node script

* revert changes in script

* enable buildKit on build-docker cmd

* fix: added missing default value for query unbondingDelegation

---------

Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com>
Co-authored-by: Vladislav Varadinov <vladislav.varadinov@gmail.com>

* fix changelog

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Shane <im.xianying@gmail.com>
Co-authored-by: Tom <54514587+GAtom22@users.noreply.github.com>
Co-authored-by: Freddy Caceres <facs95@gmail.com>
Co-authored-by: tom <tomasguerraalda@hotmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Daniel Burckhardt <daniel.m.burckhardt@gmail.com>
Co-authored-by: Austin Chandra <austinchandra@berkeley.edu>
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Shane <im.xianying@gmail.com>
Co-authored-by: Vladislav Varadinov <vladislav.varadinov@gmail.com>
Co-authored-by: Snyk bot <github+bot@snyk.io>
Co-authored-by: Vingurzhou <zwz0123460218@icloud.com>
Co-authored-by: devops-evmos <133777505+devops-evmos@users.noreply.github.com>
Co-authored-by: DevOps <devops@nowhere.com>
Co-authored-by: Marko <marko@baricevic.me>
Co-authored-by: Marko Baricevic <markobaricevic3778@gmail.com>
  • Loading branch information
16 people committed Jul 3, 2023
1 parent 7668a77 commit dffe97e
Show file tree
Hide file tree
Showing 147 changed files with 23,549 additions and 88 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bsr-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
BUF_TOKEN: ${{ secrets.BUF_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: bufbuild/buf-setup-action@v1.21.0
- uses: bufbuild/buf-setup-action@v1.23.0
# Push Evmos protos to the Buf Schema Registry
- uses: bufbuild/buf-push-action@v1.1.1
18 changes: 18 additions & 0 deletions .github/workflows/check-licenses.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Check Licenses
on:
pull_request

jobs:
check-licenses:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6.1.2
id: git_diff
with:
PATTERNS: |
**/**.go
**/**.proto
- run: |
make check-licenses
if: env.GIT_DIFF
4 changes: 2 additions & 2 deletions .github/workflows/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: bufbuild/buf-setup-action@v1.21.0
- uses: bufbuild/buf-setup-action@v1.23.0
- uses: bufbuild/buf-lint-action@v1
with:
input: "proto"
Expand All @@ -37,7 +37,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: bufbuild/buf-setup-action@v1.21.0
- uses: bufbuild/buf-setup-action@v1.23.0
- uses: bufbuild/buf-breaking-action@v1
with:
input: "proto"
Expand Down
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,22 @@ Ref: https://keepachangelog.com/en/1.0.0/

# Changelog

## Unreleased

- (app) [#1623](https://github.com/evmos/evmos/pull/1623) Adjust default app config to disable all server options
- (app) [#1619](https://github.com/evmos/evmos/pull/1619) Add snapshot commands to CLI
- (revenue) [#1607](https://github.com/evmos/evmos/pull/1607) Route gas fees from calling EVM extensions to community pool
- (docker) [#1606](https://github.com/evmos/evmos/pull/1606) Improve Dockerfile to reduce image size

### State Machine Breaking

- (evm) [#1625](https://github.com/evmos/evmos/pull/1625) Migrate updated EVM extensions

## [v13.0.0-rc3] - 2023-06-15

### Bug Fixes

- (evm) [160](https://github.com/evmos/precompiles/pull/160) Fixed hard coded BaseDenom and wrong comparison for MaxUint256
- (evm) [1602](https://github.com/evmos/evmos/pull/1602) Fixed hard coded BaseDenom and wrong comparison for MaxUint256

## [v13.0.0-rc2] - 2023-06-13

Expand All @@ -64,6 +75,12 @@ Ref: https://keepachangelog.com/en/1.0.0/
- (deps) [#1567](https://github.com/evmos/evmos/pull/1567) Bump cosmos-sdk version to `v0.46.11-alpha.ledger.7`.
Fix memory leak in `cosmos/iavl` package.

## [v12.1.5] - 2023-06-08

### Bug Fixes

- (vesting) [GHSA-2q3r-p2m3-898g](https://github.com/evmos/evmos/commit/39b750cdaf1d69158ab93da85bd43ae4a7da1456) Apply ClawbackVestingAccount Barberry patch & Bump SDK to v0.46.13

## [v12.1.4] - 2023-05-26

### Improvements
Expand Down
23 changes: 19 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,34 @@
FROM golang:1.20.5-bullseye AS build-env
FROM golang:1.20.5-alpine3.18 AS build-env

WORKDIR /go/src/github.com/evmos/evmos

COPY go.mod go.sum ./

RUN set -eux; apk add --no-cache ca-certificates=20230506-r0 build-base=0.5-r3 git=2.40.1-r0 linux-headers=6.3-r0

RUN --mount=type=bind,target=. --mount=type=secret,id=GITHUB_TOKEN \
git config --global url."https://$(cat /run/secrets/GITHUB_TOKEN)@github.com/".insteadOf "https://github.com/"; \
go mod download

COPY . .

RUN make build

FROM golang:1.20.5-bullseye
RUN go install github.com/MinseokOh/toml-cli@latest

RUN apt-get update \
&& apt-get install ca-certificates jq=1.6-2.1 -y --no-install-recommends
FROM alpine:3.18

WORKDIR /root

COPY --from=build-env /go/src/github.com/evmos/evmos/build/evmosd /usr/bin/evmosd
COPY --from=build-env /go/bin/toml-cli /usr/bin/toml-cli

RUN apk add --no-cache ca-certificates=20230506-r0 jq=1.6-r3 curl=8.1.2-r0 bash=5.2.15-r5 vim=9.0.1568-r0 lz4=1.9.4-r4 \
&& addgroup -g 1000 evmos \
&& adduser -S -h /home/evmos -D evmos -u 1000 -G evmos

USER 1000
WORKDIR /home/evmos

EXPOSE 26656 26657 1317 9090 8545 8546

Expand Down
29 changes: 22 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ EVMOS_DIR = evmos
BUILDDIR ?= $(CURDIR)/build
HTTPS_GIT := https://github.com/evmos/evmos.git
DOCKER := $(shell which docker)
DOCKER_BUILDKIT=1
DOCKER_ARGS=
ifdef GITHUB_TOKEN
ifneq ($(strip $(GITHUB_TOKEN)),)
DOCKER_ARGS += --secret id=GITHUB_TOKEN
endif
endif
NAMESPACE := tharsishq
PROJECT := evmos
DOCKER_IMAGE := $(NAMESPACE)/$(PROJECT)
Expand Down Expand Up @@ -144,16 +151,16 @@ build-reproducible: go.sum

build-docker:
# TODO replace with kaniko
$(DOCKER) build -t ${DOCKER_IMAGE}:${DOCKER_TAG} .
DOCKER_BUILDKIT=1 $(DOCKER) build -t ${DOCKER_IMAGE}:${DOCKER_TAG} ${DOCKER_ARGS} .
$(DOCKER) tag ${DOCKER_IMAGE}:${DOCKER_TAG} ${DOCKER_IMAGE}:latest
# docker tag ${DOCKER_IMAGE}:${DOCKER_TAG} ${DOCKER_IMAGE}:${COMMIT_HASH}
# update old container
$(DOCKER) rm evmos || true
# create a new container from the latest image
$(DOCKER) create --name evmos -t -i ${DOCKER_IMAGE}:latest evmos
# move the binaries to the ./build directory
mkdir -p ./build/
$(DOCKER) cp evmos:/usr/bin/evmosd ./build/
mkdir -p ./build/.evmosd
echo '#!/usr/bin/env bash' > ./build/evmosd
echo "IMAGE_NAME=${DOCKER_IMAGE}:${COMMIT_HASH}" >> ./build/evmosd
echo 'SCRIPT_PATH=$$(cd $$(dirname $$0) && pwd -P)' >> ./build/evmosd
echo 'docker run -it --rm -v $${SCRIPT_PATH}/.evmosd:/home/evmos/.evmosd $$IMAGE_NAME evmosd "$$@"' >> ./build/evmosd
chmod +x ./build/evmosd

push-docker: build-docker
$(DOCKER) push ${DOCKER_IMAGE}:${DOCKER_TAG}
Expand Down Expand Up @@ -614,3 +621,11 @@ create-contracts-json:
mv $(TMP_JSON) $(COMPILED_DIR)/$${c}.json ;\
done
@rm -rf tmp

###############################################################################
### Licenses ###
###############################################################################

check-licenses:
@echo "Checking licenses..."
@python3 scripts/check_licenses.py .
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ func NewEvmos(

app.RevenueKeeper = revenuekeeper.NewKeeper(
keys[revenuetypes.StoreKey], appCodec, authtypes.NewModuleAddress(govtypes.ModuleName),
app.BankKeeper, app.EvmKeeper,
app.BankKeeper, app.DistrKeeper, app.AccountKeeper, app.EvmKeeper,
authtypes.FeeCollectorName,
)

Expand Down
2 changes: 2 additions & 0 deletions cmd/evmosd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/pruning"
"github.com/cosmos/cosmos-sdk/client/rpc"
"github.com/cosmos/cosmos-sdk/client/snapshot"
sdkserver "github.com/cosmos/cosmos-sdk/server"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
"github.com/cosmos/cosmos-sdk/simapp/params"
Expand Down Expand Up @@ -122,6 +123,7 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
debug.Cmd(),
config.Cmd(),
pruning.PruningCmd(a.newApp),
snapshot.Cmd(a.newApp),
)

evmosserver.AddCommands(
Expand Down
6 changes: 3 additions & 3 deletions contracts/package-lock.json

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

2 changes: 1 addition & 1 deletion contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"doc": "docs"
},
"dependencies": {
"@openzeppelin/contracts": "^4.9.1"
"@openzeppelin/contracts": "^4.9.2"
},
"devDependencies": {},
"scripts": {
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ require (
github.com/davecgh/go-spew v1.1.1
github.com/ethereum/go-ethereum v1.11.5
github.com/evmos/evmos-ledger-go v0.4.0
github.com/evmos/precompiles v0.0.0-20230615165716-e0a8cabcbf5d
github.com/gogo/protobuf v1.3.3
github.com/golang/protobuf v1.5.3
github.com/gorilla/mux v1.8.0
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,6 @@ github.com/evmos/evmos-ledger-go v0.4.0 h1:WPa6TN9x7s/+1YCgvYGtzJrhlW/mIHtYM1DvN
github.com/evmos/evmos-ledger-go v0.4.0/go.mod h1:33X3wWcWZ68KD5Bj4aiED+/W57uO1VR+hbXBxkKDXsQ=
github.com/evmos/go-ethereum v1.10.26-evmos-rc2 h1:tYghk1ZZ8X4/OQ4YI9hvtm8aSN8OSqO0g9vo/sCMdBo=
github.com/evmos/go-ethereum v1.10.26-evmos-rc2/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo=
github.com/evmos/precompiles v0.0.0-20230615165716-e0a8cabcbf5d h1:Amope5DymYdDs/DU2I6zMX/fZ+xb+U87PQZ4lLtL55k=
github.com/evmos/precompiles v0.0.0-20230615165716-e0a8cabcbf5d/go.mod h1:EN85gINi4B+pjzbdPgqNNw9O1Oras++7gJEZAXD1K4E=
github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0=
github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A=
github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk=
Expand Down
2 changes: 1 addition & 1 deletion local_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,4 @@ if [[ $overwrite == "y" || $overwrite == "Y" ]]; then
fi

# Start the node (remove the --pruning=nothing flag if historical queries are not needed)
evmosd start --metrics "$TRACE" --log_level $LOGLEVEL --minimum-gas-prices=0.0001aevmos --json-rpc.api eth,txpool,personal,net,debug,web3 --api.enable --home "$HOMEDIR"
evmosd start --metrics "$TRACE" --log_level $LOGLEVEL --minimum-gas-prices=0.0001aevmos --json-rpc.api eth,txpool,personal,net,debug,web3 --api.enable --json-rpc.enable true --home "$HOMEDIR"
101 changes: 101 additions & 0 deletions precompiles/authorization/Authorization.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.8.17 .0;

/// @author Evmos Team
/// @title Authorization Interface
/// @dev The interface through which solidity contracts will interact with smart contract approvals.
interface AuthorizationI {
/// @dev Approves a list of Cosmos or IBC transactions with a specific amount of tokens.
/// @param spender The address which will spend the funds.
/// @param amount The amount of tokens to be spent.
/// @param methods The message type URLs of the methods to approve.
/// @return approved Boolean value to indicate if the approval was successful.
function approve(
address spender,
uint256 amount,
string[] calldata methods
) external returns (bool approved);

/// @dev Revokes a list of Cosmos transactions.
/// @param spender The address which will spend the funds.
/// @param methods The message type URLs of the methods to revoke.
/// @return revoked Boolean value to indicate if the revocation was successful.
function revoke(
address spender,
string[] calldata methods
) external returns (bool revoked);

/// @dev Increase the allowance of a given spender by a specific amount of tokens for IBC
/// transfer methods or staking.
/// @param spender The address which will spend the funds.
/// @param amount The amount of tokens to be spent.
/// @param methods The message type URLs of the methods to approve.
/// @return approved Boolean value to indicate if the approval was successful.
function increaseAllowance(
address spender,
uint256 amount,
string[] calldata methods
) external returns (bool approved);

/// @dev Decreases the allowance of a given spender by a specific amount of tokens for IBC
/// transfer methods or staking.
/// @param spender The address which will spend the funds.
/// @param amount The amount of tokens to be spent.
/// @param methods The message type URLs of the methods to approve.
/// @return approved Boolean value to indicate if the approval was successful.
function decreaseAllowance(
address spender,
uint256 amount,
string[] calldata methods
) external returns (bool approved);

/// @dev Returns the remaining number of tokens that spender will be allowed to spend
/// on behalf of the owner through IBC transfer methods or staking. This is zero by default.
/// @param owner The address of the account owning tokens.
/// @param spender The address of the account able to transfer the tokens.
/// @param method The message type URL of the methods for which the approval should be queried.
/// @return remaining The remaining number of tokens available to be spent.
function allowance(
address owner,
address spender,
string calldata method
) external view returns (uint256 remaining);

/// @dev This event is emitted when the allowance of a spender is set by a call to the approve method.
/// The value field specifies the new allowance and the methods field holds the information for which methods
/// the approval was set.
/// @param owner The owner of the tokens.
/// @param spender The address which will spend the funds.
/// @param methods The message type URLs of the methods for which the approval is set.
/// @param value The amount of tokens approved to be spent.
event Approval(
address indexed owner,
address indexed spender,
string[] methods,
uint256 value
);

/// @dev This event is emitted when an owner revokes a spender's allowance.
/// @param owner The owner of the tokens.
/// @param spender The address which will spend the funds.
/// @param methods The message type URLs of the methods for which the approval is set.
event Revocation(
address indexed owner,
address indexed spender,
string[] methods
);

/// @dev This event is emitted when the allowance of a spender is changed by a call to the decrease or increase
/// allowance method. The values field specifies the new allowances and the methods field holds the
/// information for which methods the approval was set.
/// @param owner The owner of the tokens.
/// @param spender The address which will spend the funds.
/// @param methods The message type URLs of the methods for which the approval is set.
/// @param values The amounts of tokens approved to be spent.
event AllowanceChange(
address indexed owner,
address indexed spender,
string[] methods,
uint256[] values
);
}
24 changes: 24 additions & 0 deletions precompiles/authorization/errors.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright Tharsis Labs Ltd.(Evmos)
// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE)
package authorization

const (
// ErrAuthzDoesNotExistOrExpired is raised when the authorization does not exist.
ErrAuthzDoesNotExistOrExpired = "authorization to %s for address %s does not exist or is expired"
// ErrEmptyMethods is raised when the given methods array is empty.
ErrEmptyMethods = "no methods defined; expected at least one message type url"
// ErrEmptyStringInMethods is raised when the given methods array contains an empty string.
ErrEmptyStringInMethods = "empty string found in methods array; expected no empty strings to be passed; got: %v"
// ErrExceededAllowance is raised when the amount exceeds the set allowance.
ErrExceededAllowance = "amount %s greater than allowed limit %s"
// ErrInvalidGranter is raised when the granter address is not valid.
ErrInvalidGranter = "invalid granter address: %v"
// ErrInvalidGrantee is raised when the grantee address is not valid.
ErrInvalidGrantee = "invalid grantee address: %v"
// ErrInvalidMethods is raised when the given methods cannot be unpacked.
ErrInvalidMethods = "invalid methods defined; expected an array of strings; got: %v"
// ErrInvalidMethod is raised when the given method cannot be unpacked.
ErrInvalidMethod = "invalid method defined; expected a string; got: %v"
// ErrAuthzNotAccepted is raised when the authorization is not accepted.
ErrAuthzNotAccepted = "authorization to %s for address %s is not accepted"
)
Loading

0 comments on commit dffe97e

Please sign in to comment.