You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
imp: represent unlimited approvals with MaxUint256 value (backport #3454) (#3581)
* imp: represent unlimited approvals with MaxUint256 value (#3454)
* imp: represent unlimited approvals with a nil value
* CHANGELOG
* Update CHANGELOG.md
* fix: updated unlimited spending limit to be represented with the MaxInt64
* Update modules/apps/transfer/types/transfer_authorization.go
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
* Update CHANGELOG.md
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
* fix: lint
* Update modules/apps/transfer/types/transfer_authorization.go
* fix: update failing test and add test case suggested in review
* fix: moved isAllowedAddress check before coin loop
* fix: use maxUint256 case so it aligns with what's being passed from the EVM extension
* refactor transfer authz to remove coins iteration in favour of explicit amount checking
* make format
* Update modules/apps/transfer/types/transfer_authorization.go
Co-authored-by: Damian Nolan <damiannolan@gmail.com>
* fix: add the Authorization to Updated.
* moving allowlist check to before spend limit logic
* Apply suggestions from code review
* fix: add comment to spend limit check
* review feedback
* Update modules/apps/transfer/types/transfer_authorization.go
Co-authored-by: Damian Nolan <damiannolan@gmail.com>
* Update docs/apps/transfer/authorizations.md
* fix: changed to new sentinel value name
---------
Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Damian Nolan <damiannolan@gmail.com>
(cherry picked from commit 7e6eb4c)
# Conflicts:
# CHANGELOG.md
# e2e/tests/core/client_test.go
# e2e/testsuite/grpc_query.go
# modules/apps/transfer/types/transfer_authorization.go
* resolving conflicts
---------
Co-authored-by: Vladislav Varadinov <vladislav.varadinov@gmail.com>
Co-authored-by: Damian Nolan <damiannolan@gmail.com>
* (apps/transfer) [\#3454](https://github.com/cosmos/ibc-go/pull/3454) Support transfer authorization unlimited spending when the max `uint256` value is provided as limit.
Copy file name to clipboardexpand all lines: docs/apps/transfer/authorizations.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# `TransferAuthorization`
2
2
3
-
`TransferAuthorization` implements the `Authorization` interface for `ibc.applications.transfer.v1.MsgTransfer`. It allows a granter to grant a grantee the privilege to submit MsgTransfer on its behalf. Please see the [Cosmos SDK docs](https://docs.cosmos.network/v0.47/modules/authz) for more details on granting privileges via the `x/authz` module.
3
+
`TransferAuthorization` implements the `Authorization` interface for `ibc.applications.transfer.v1.MsgTransfer`. It allows a granter to grant a grantee the privilege to submit `MsgTransfer` on its behalf. Please see the [Cosmos SDK docs](https://docs.cosmos.network/v0.47/modules/authz) for more details on granting privileges via the `x/authz` module.
4
4
5
5
More specifically, the granter allows the grantee to transfer funds that belong to the granter over a specified channel.
6
6
@@ -13,7 +13,7 @@ It takes:
13
13
14
14
- a `SourcePort` and a `SourceChannel` which together comprise the unique transfer channel identifier over which authorized funds can be transferred.
15
15
16
-
- a `SpendLimit` that specifies the maximum amount of tokens the grantee can spend. The `SpendLimit` is updated as the tokens are spent. This `SpendLimit` may also be updated to increase or decrease the limit as the granter wishes.
16
+
- a `SpendLimit` that specifies the maximum amount of tokens the grantee can transfer. The `SpendLimit` is updated as the tokens are transfered, unless the sentinel value of the maximum value for a 256-bit unsigned integer (i.e. 2^256 - 1) is used for the amount, in which case the `SpendLimit` will not be updated (please be aware that using this sentinel value will grant the grantee the privilege to transfer **all** the tokens of a given denomination available at the granter's account). The helper function `UnboundedSpendLimit` in the `types` package of the `transfer` module provides the sentinel value that can be used. This `SpendLimit` may also be updated to increase or decrease the limit as the granter wishes.
17
17
18
18
- an `AllowList` list that specifies the list of addresses that are allowed to receive funds. If this list is empty, then all addresses are allowed to receive funds from the `TransferAuthorization`.
0 commit comments