Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5ac9f36
update curl version (#1671)
devops-evmos Jul 31, 2023
b2bca77
[Snyk] Security upgrade golang from 1.20.3-bullseye to 1.20.5-bullsey…
devops-evmos Jul 31, 2023
f7ffe25
build(deps): bump golang from 1.20.6-alpine3.18 to 1.20.7-alpine3.18 …
dependabot[bot] Aug 3, 2023
502409c
build(deps): bump bufbuild/buf-setup-action from 1.25.0 to 1.25.1 (#1…
dependabot[bot] Aug 3, 2023
99c577e
chore: add bootstrap state command (#1681)
GAtom22 Aug 3, 2023
acc28fa
fix: trace tx/block gas meter to make it consistent with execution (#…
GAtom22 Aug 4, 2023
32e76bd
chore: migrate evmos-ledger-go to evmos repo (#1682)
GAtom22 Aug 4, 2023
95ffafd
chore: update evmos version to v14 (#1687)
GAtom22 Aug 7, 2023
73355d1
build(deps): bump bufbuild/buf-setup-action from 1.25.1 to 1.26.0 (#1…
dependabot[bot] Aug 10, 2023
45b6ae9
fix(ics20): Refactor authorization to be consistent with SDK names gr…
Vvaradinov Aug 10, 2023
74594fb
fix panic bug "Int64() out of bound" in ante handler (#1693)
cuiweixie Aug 11, 2023
c159c98
chore(deps): bump cosmos-sdk to v0.47 & ibc-go to v7 (#1662)
GAtom22 Aug 14, 2023
f40d198
build(deps): bump golang from 1.20.7-alpine3.18 to 1.21.0-alpine3.18 …
dependabot[bot] Aug 14, 2023
c5c9980
build(deps): bump @openzeppelin/contracts from 4.9.2 to 4.9.3 in /con…
dependabot[bot] Aug 14, 2023
512ab44
chore: update gas adjustment factor (#1706)
GAtom22 Aug 15, 2023
83a4f7b
build(deps): bump golangci/golangci-lint-action from 3.6.0 to 3.7.0 (…
dependabot[bot] Aug 15, 2023
9282730
build(deps): bump bufbuild/buf-setup-action from 1.26.0 to 1.26.1 (#1…
dependabot[bot] Aug 15, 2023
1722c60
fix panic on uint64 conversion in evm ApplyMessageWithConfig function…
cuiweixie Aug 16, 2023
85b1ae7
fix(staking): change names of owner / spender to grantee / granter to…
Vvaradinov Aug 18, 2023
bb9fb38
tests(upgrade): remove version mapping in E2E tests (#1643)
MalteHerrmann Aug 21, 2023
27bc3b9
refactor(config): use squash tag unmarshal embedded struct (#1666)
zakir-web3 Aug 21, 2023
e723fa7
fix merge conflicts
Aug 21, 2023
2d30d40
remove unused function
Aug 21, 2023
035fac7
upgrade ginkgo
Aug 21, 2023
298d4c5
run go mod tidy
Aug 21, 2023
ec2ac22
fix: add missing CHANGELOG entries
Vvaradinov Aug 21, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/bsr-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: bufbuild/[email protected].0
- uses: bufbuild/[email protected].1
# Push Evmos protos to the Buf Schema Registry
- uses: bufbuild/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
**/**.go
go.mod
go.sum
- uses: golangci/golangci-lint-action@v3.6.0
- uses: golangci/golangci-lint-action@v3.7.0
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: latest
Expand Down
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/[email protected].0
- uses: bufbuild/[email protected].1
- 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/[email protected].0
- uses: bufbuild/[email protected].1
- uses: bufbuild/buf-breaking-action@v1
with:
input: "proto"
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,20 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Improvements

- (ics20) [#1688](https://github.com/evmos/evmos/pull/1688) Change authorization names to `grantee` / `granter` in the `ICS20` precompile
- (staking) [#1702](https://github.com/evmos/evmos/pull/1702) Change authorization names to `grantee` / `granter` in the `staking` precompile
- (mod) [#1674](https://github.com/evmos/evmos/pull/1674) Update `evmos` module name to `evmos/v14`
- (cli) [#1677](https://github.com/evmos/evmos/pull/1677) Update docs for `vesting` cli
- (proto) [#1684](https://github.com/evmos/evmos/pull/1684) Update proto files to use `evmos/v14`
- (deps) [#1682](https://github.com/evmos/evmos/pull/1682) Migrate [evmos-ledger-go](https://github.com/evmos/evmos-ledger-go) logic to this repository
- (vesting) [#1708](https://github.com/evmos/evmos/pull/1708) Minor improvements to `vesting` module
- (vesting) [#1709](https://github.com/evmos/evmos/pull/1709) Add clawed back coins to `MsgClawbackResponse`
- (cli) [#1706](https://github.com/evmos/evmos/pull/1706) Update `DefaultGasAdjustment` factor used in transactions.

### Bug Fixes

- (e2e) [1678](https://github.com/evmos/evmos/pull/1678) Fix e2e tests after recent changes to `evmosd start` default flags
- (evm) [#1703](https://github.com/evmos/evmos/pull/1703) Prevent panic on uint64 conversion in EVM keeper `ApplyMessageWithConfig` function.

## [v14.0.0-rc1] - 2023-08-01

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20.7-alpine3.18 AS build-env
FROM golang:1.21.0-alpine3.18 AS build-env

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

Expand Down
3 changes: 3 additions & 0 deletions cmd/evmosd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ func txCommand() *cobra.Command {
authcmd.GetAuxToFeeCommand(),
)

// DefaultGasAdjustment value to use as default in gas-adjustment flag
flags.DefaultGasAdjustment = servercfg.DefaultGasAdjustment

app.ModuleBasics.AddTxCommands(cmd)
cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID")

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.2"
"@openzeppelin/contracts": "^4.9.3"
},
"devDependencies": {},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ replace (
// use cosmos fork of keyring
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0
// use Cosmos-SDK fork to enable Ledger functionality
github.com/cosmos/cosmos-sdk => github.com/evmos/cosmos-sdk v0.47.4-evmos
github.com/cosmos/cosmos-sdk => github.com/evmos/cosmos-sdk v0.47.4-evmos.2
// use Evmos geth fork
github.com/ethereum/go-ethereum => github.com/evmos/go-ethereum v1.10.26-evmos-rc2
// Security Advisory https://github.com/advisories/GHSA-h395-qcrw-5vmq
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,8 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m
github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/evmos/cosmos-sdk v0.47.4-evmos h1:ZlHw4Z8F/RnAgeim5yX3Ch2HsP9zL6VM30sWWjZvuNs=
github.com/evmos/cosmos-sdk v0.47.4-evmos/go.mod h1:R5n+uM7vguVPFap4pgkdvQCT1nVo/OtPwrlAU40rvok=
github.com/evmos/cosmos-sdk v0.47.4-evmos.2 h1:bgKGJAeiTyEXLam+WCocIqOQk1pAJ1Bo3JPFG3FomX8=
github.com/evmos/cosmos-sdk v0.47.4-evmos.2/go.mod h1:R5n+uM7vguVPFap4pgkdvQCT1nVo/OtPwrlAU40rvok=
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/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
Expand Down
52 changes: 26 additions & 26 deletions precompiles/authorization/Authorization.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,95 +6,95 @@ pragma solidity >=0.8.17 .0;
/// @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 grantee The contract address which will have an authorization to spend the origin 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,
address grantee,
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 grantee The contract address which will have its allowances revoked.
/// @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,
address grantee,
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 grantee The contract address which allowance will be increased.
/// @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,
address grantee,
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 grantee The contract address which allowance will be decreased.
/// @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,
address grantee,
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 grantee The contract address which has the Authorization.
/// @param granter The account address that grants an Authorization.
/// @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,
address grantee,
address granter,
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.
/// @dev This event is emitted when the allowance of a granter 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 grantee The contract address that received an Authorization from the granter.
/// @param granter The account address that granted an Authorization.
/// @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,
address indexed grantee,
address indexed granter,
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 grantee The contract address that has it's Authorization revoked.
/// @param granter The account address of the granter.
/// @param methods The message type URLs of the methods for which the approval is set.
event Revocation(
address indexed owner,
address indexed spender,
address indexed grantee,
address indexed granter,
string[] methods
);

/// @dev This event is emitted when the allowance of a spender is changed by a call to the decrease or increase
/// @dev This event is emitted when the allowance of a granter 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 grantee The contract address for which the allowance changed.
/// @param granter The account address of the granter.
/// @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,
address indexed grantee,
address indexed granter,
string[] methods,
uint256[] values
);
Expand Down
9 changes: 4 additions & 5 deletions precompiles/authorization/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"fmt"
"math/big"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/common"
ethtypes "github.com/ethereum/go-ethereum/core/types"
Expand All @@ -16,10 +15,10 @@ import (

// EventApproval is the event emitted on a successful Approve transaction.
type EventApproval struct {
Grantee common.Address
Granter common.Address
Coin *sdk.Coin
TypeUrls []string
Grantee common.Address
Granter common.Address
Value *big.Int
Methods []string
}

// EventAllowanceChange is the event emitted on successful IncreaseAllowance or DecreaseAllowance transactions.
Expand Down
39 changes: 10 additions & 29 deletions precompiles/authorization/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ func CheckApprovalArgs(args []interface{}, denom string) (common.Address, *sdk.C
// TODO: (optional) new Go 1.20 functionality would allow to check all args and then return a joint list of errors.
// This would improve UX as everything wrong with the input would be returned at once.

spenderAddr, ok := args[0].(common.Address)
if !ok || spenderAddr == (common.Address{}) {
grantee, ok := args[0].(common.Address)
if !ok || grantee == (common.Address{}) {
return common.Address{}, nil, nil, fmt.Errorf(ErrInvalidGranter, args[0])
}

Expand Down Expand Up @@ -80,7 +80,7 @@ func CheckApprovalArgs(args []interface{}, denom string) (common.Address, *sdk.C
}
// TODO: check if the typeURLs are valid? e.g. with a regex pattern?

return spenderAddr, coin, typeURLs, nil
return grantee, coin, typeURLs, nil
}

// CheckRevokeArgs checks the arguments passed to the revoke function.
Expand All @@ -107,25 +107,6 @@ func CheckRevokeArgs(args []interface{}) (common.Address, []string, error) {
return spenderAddr, typeURLs, nil
}

// CheckRevocationArgs checks the arguments for the Revoke function.
func CheckRevocationArgs(args []interface{}) (common.Address, []string, error) {
if len(args) != 2 {
return common.Address{}, nil, fmt.Errorf(cmn.ErrInvalidNumberOfArgs, 2, len(args))
}

spenderAddr, ok := args[0].(common.Address)
if !ok || spenderAddr == (common.Address{}) {
return common.Address{}, nil, fmt.Errorf(ErrInvalidGranter, args[0])
}

typeURLs, err := validateMsgTypes(args[1])
if err != nil {
return common.Address{}, nil, err
}

return spenderAddr, typeURLs, nil
}

// CheckDistributionApprovalArgs checks the arguments passed to the distribution Approve function.
func CheckDistributionApprovalArgs(args []interface{}, origin common.Address) (common.Address, []string, []string, error) {
if len(args) != 3 {
Expand Down Expand Up @@ -171,14 +152,14 @@ func CheckAllowanceArgs(args []interface{}) (common.Address, common.Address, str
return common.Address{}, common.Address{}, "", fmt.Errorf(cmn.ErrInvalidNumberOfArgs, 3, len(args))
}

ownerAddr, ok := args[0].(common.Address)
if !ok || ownerAddr == (common.Address{}) {
return common.Address{}, common.Address{}, "", fmt.Errorf(ErrInvalidGranter, args[0])
granteeAddr, ok := args[0].(common.Address)
if !ok || granteeAddr == (common.Address{}) {
return common.Address{}, common.Address{}, "", fmt.Errorf(ErrInvalidGrantee, args[0])
}

spenderAddr, ok := args[1].(common.Address)
if !ok || spenderAddr == (common.Address{}) {
return common.Address{}, common.Address{}, "", fmt.Errorf(ErrInvalidGrantee, args[1])
granterAddr, ok := args[1].(common.Address)
if !ok || granterAddr == (common.Address{}) {
return common.Address{}, common.Address{}, "", fmt.Errorf(ErrInvalidGranter, args[1])
}

typeURL, ok := args[2].(string)
Expand All @@ -190,7 +171,7 @@ func CheckAllowanceArgs(args []interface{}) (common.Address, common.Address, str
}
// TODO: check if the typeURL is valid? e.g. with a regex pattern?

return ownerAddr, spenderAddr, typeURL, nil
return granteeAddr, granterAddr, typeURL, nil
}

// CheckAuthzExists checks if the authorization exists for the given granter and
Expand Down
8 changes: 4 additions & 4 deletions precompiles/authorization/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,16 @@ func TestCheckAllowanceArgs(t *testing.T) {
ErrContains: fmt.Sprintf(cmn.ErrInvalidNumberOfArgs, 3, 4),
},
{
name: "invalid owner address",
name: "invalid grantee address",
args: []interface{}{common.Address{}, addr, validTypeURL},
expErr: true,
ErrContains: fmt.Sprintf(authorization.ErrInvalidGranter, common.Address{}),
ErrContains: fmt.Sprintf(authorization.ErrInvalidGrantee, common.Address{}),
},
{
name: "invalid spender address",
name: "invalid granter address",
args: []interface{}{addr, common.Address{}, validTypeURL},
expErr: true,
ErrContains: fmt.Sprintf(authorization.ErrInvalidGrantee, common.Address{}),
ErrContains: fmt.Sprintf(authorization.ErrInvalidGranter, common.Address{}),
},
{
name: "valid arguments",
Expand Down
Loading