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

Conversation

wojtek-coreum
Copy link
Collaborator

@wojtek-coreum wojtek-coreum commented Oct 17, 2023

Description

Reviewers checklist:

  • Try to write more meaningful comments with clear actions to be taken.
  • Nit-picking should be unblocking. Focus on core issues.

Authors checklist

  • Provide a concise and meaningful description
  • Review the code yourself first, before making the PR.
  • Annotate your PR in places that require explanation.
  • Think and try to split the PR to smaller PR if it is big.

This change is Reviewable

@wojtek-coreum wojtek-coreum requested a review from a team as a code owner October 17, 2023 12:37
@wojtek-coreum wojtek-coreum requested review from dzmitryhil, miladz68 and ysv and removed request for a team October 17, 2023 12:37
Copy link
Collaborator Author

@wojtek-coreum wojtek-coreum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 8 files reviewed, 1 unresolved discussion (waiting on @dzmitryhil, @miladz68, and @ysv)


x/asset/ft/keeper/before_send.go line 182 at r1 (raw file):

func (k Keeper) isSmartContract(ctx sdk.Context, addr sdk.AccAddress) bool {
	return len(addr) == wasmtypes.ContractAddrLen

&& k.wasmKeeper.HasContractInfo(ctx, sender) is removed from here because when tokens are attached to the smart contract instantiation, at this stage HasContractInfo still returns false

Copy link
Contributor

@miladz68 miladz68 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 4 of 8 files at r1, 7 of 7 files at r2, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @dzmitryhil, @wojtek-coreum, and @ysv)


integration-tests/modules/assetft_test.go line 4182 at r2 (raw file):

	}
	_, err = client.BroadcastTx(ctx, clientCtx.WithFromAddress(issuer), txf, sendMsg)
	requireT.Error(err)

assert error types here.


integration-tests/modules/assetft_test.go line 4249 at r2 (raw file):

	requireT.NoError(err)
	_, err = chain.Wasm.ExecuteWASMContract(ctx, txf, issuer, contractAddr, incrementPayload, sdk.NewInt64Coin(denom, 100))
	requireT.Error(err)

assert error type


integration-tests/modules/assetft_test.go line 4312 at r2 (raw file):

		},
	)
	requireT.Error(err)

same


proto/coreum/asset/ft/v1/token.proto line 16 at r2 (raw file):

  whitelisting = 3;
  ibc = 4;
  sending_to_smart_contracts_blocked = 5;

maybe block_smart_contract ?

@wojtek-coreum wojtek-coreum deleted the wojtek/send-to-contract branch October 20, 2023 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants