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

New feature allowing to disable sending FT to smart contracts #677

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
1 change: 1 addition & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,7 @@ Feature defines possible features of fungible token.
| freezing | 2 | |
| whitelisting | 3 | |
| ibc | 4 | |
| sending_to_smart_contracts_blocked | 5 | |


<!-- end enums -->
Expand Down
3 changes: 2 additions & 1 deletion docs/static/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -6850,7 +6850,8 @@
"burning",
"freezing",
"whitelisting",
"ibc"
"ibc",
"sending_to_smart_contracts_blocked"
],
"default": "minting",
"description": "Feature defines possible features of fungible token."
Expand Down
15 changes: 14 additions & 1 deletion integration-tests/ibc/asset_ft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ func TestIBCAssetFTSendCommissionAndBurnRate(t *testing.T) {
InitialAmount: sdkmath.NewInt(1_000_000),
BurnRate: sdk.MustNewDecFromStr("0.1"),
SendCommissionRate: sdk.MustNewDecFromStr("0.2"),
Features: []assetfttypes.Feature{assetfttypes.Feature_ibc},
Features: []assetfttypes.Feature{
assetfttypes.Feature_sending_to_smart_contracts_blocked,
assetfttypes.Feature_ibc,
},
}
_, err := client.BroadcastTx(
ctx,
Expand Down Expand Up @@ -375,6 +378,7 @@ func TestIBCAssetFTWhitelisting(t *testing.T) {
Precision: 8,
InitialAmount: sdkmath.NewInt(1_000_000),
Features: []assetfttypes.Feature{
assetfttypes.Feature_sending_to_smart_contracts_blocked,
assetfttypes.Feature_ibc,
assetfttypes.Feature_whitelisting,
},
Expand Down Expand Up @@ -475,6 +479,7 @@ func TestIBCAssetFTFreezing(t *testing.T) {
Precision: 8,
InitialAmount: sdkmath.NewInt(1_000_000),
Features: []assetfttypes.Feature{
assetfttypes.Feature_sending_to_smart_contracts_blocked,
assetfttypes.Feature_ibc,
assetfttypes.Feature_freezing,
},
Expand Down Expand Up @@ -570,6 +575,7 @@ func TestEscrowAddressIsResistantToFreezingAndWhitelisting(t *testing.T) {
Precision: 8,
InitialAmount: sdkmath.NewInt(1_000_000),
Features: []assetfttypes.Feature{
assetfttypes.Feature_sending_to_smart_contracts_blocked,
assetfttypes.Feature_ibc,
assetfttypes.Feature_freezing,
assetfttypes.Feature_whitelisting,
Expand Down Expand Up @@ -660,6 +666,7 @@ func TestIBCGlobalFreeze(t *testing.T) {
Precision: 8,
InitialAmount: sdkmath.NewInt(1_000_000),
Features: []assetfttypes.Feature{
assetfttypes.Feature_sending_to_smart_contracts_blocked,
assetfttypes.Feature_ibc,
assetfttypes.Feature_freezing,
},
Expand Down Expand Up @@ -800,6 +807,7 @@ func TestIBCAssetFTTimedOutTransfer(t *testing.T) {
Precision: 8,
InitialAmount: sdkmath.NewInt(1_000_000),
Features: []assetfttypes.Feature{
assetfttypes.Feature_sending_to_smart_contracts_blocked,
assetfttypes.Feature_ibc,
},
}
Expand Down Expand Up @@ -913,6 +921,7 @@ func TestIBCAssetFTRejectedTransfer(t *testing.T) {
Precision: 8,
InitialAmount: sdkmath.NewInt(1_000_000),
Features: []assetfttypes.Feature{
assetfttypes.Feature_sending_to_smart_contracts_blocked,
assetfttypes.Feature_ibc,
assetfttypes.Feature_freezing,
},
Expand Down Expand Up @@ -1009,6 +1018,7 @@ func TestIBCRejectedTransferWithWhitelistingAndFreezing(t *testing.T) {
Precision: 8,
InitialAmount: sdkmath.NewInt(1_000_000),
Features: []assetfttypes.Feature{
assetfttypes.Feature_sending_to_smart_contracts_blocked,
assetfttypes.Feature_ibc,
assetfttypes.Feature_freezing,
assetfttypes.Feature_whitelisting,
Expand Down Expand Up @@ -1140,6 +1150,7 @@ func TestIBCTimedOutTransferWithWhitelistingAndFreezing(t *testing.T) {
Precision: 8,
InitialAmount: sdkmath.NewInt(1_000_000),
Features: []assetfttypes.Feature{
assetfttypes.Feature_sending_to_smart_contracts_blocked,
assetfttypes.Feature_ibc,
assetfttypes.Feature_whitelisting,
assetfttypes.Feature_freezing,
Expand Down Expand Up @@ -1304,6 +1315,7 @@ func TestIBCRejectedTransferWithBurnRateAndSendCommission(t *testing.T) {
Precision: 8,
InitialAmount: sdkmath.NewInt(910_000),
Features: []assetfttypes.Feature{
assetfttypes.Feature_sending_to_smart_contracts_blocked,
assetfttypes.Feature_ibc,
},
BurnRate: sdk.MustNewDecFromStr("0.1"),
Expand Down Expand Up @@ -1399,6 +1411,7 @@ func TestIBCTimedOutTransferWithBurnRateAndSendCommission(t *testing.T) {
Precision: 8,
InitialAmount: sdkmath.NewInt(910_000),
Features: []assetfttypes.Feature{
assetfttypes.Feature_sending_to_smart_contracts_blocked,
assetfttypes.Feature_ibc,
},
BurnRate: sdk.MustNewDecFromStr("0.1"),
Expand Down
Loading
Loading