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

PP-584 (REL-005): Add secure transfer in the Collector #100

Merged
merged 4 commits into from
Nov 29, 2022

Conversation

AndresQuijano
Copy link
Contributor

@AndresQuijano AndresQuijano commented Nov 22, 2022

What

  • Change the use of transfer from ERC20 to .call.

Why

  • Security bug found in REL-005.

Refs

@AndresQuijano AndresQuijano marked this pull request as ready for review November 23, 2022 23:18
Copy link
Collaborator

@antomor antomor left a comment

Choose a reason for hiding this comment

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

@AndresQuijano the changes look good to me and we should add also some successful scenarios in the tests, to check that the transaction doesn't fail if the transfer is successful.

Furthermore, for the sake of curiosity, have we analyzed the gas consumption change of this addition? I'm wondering if not using the openzeppelin contracts but doing the checks directly would be cheaper.

@antomor antomor changed the title PP584: Add the use of openzeppelin/safeTransfer in the Collector PP-584 (REL-005): Add the use of openzeppelin/safeTransfer in the Collector Nov 24, 2022
@AndresQuijano
Copy link
Contributor Author

@AndresQuijano the changes look good to me and we should add also some successful scenarios in the tests, to check that the transaction doesn't fail if the transfer is successful.

Furthermore, for the sake of curiosity, have we analyzed the gas consumption change of this addition? I'm wondering if not using the openzeppelin contracts but doing the checks directly would be cheaper.

As we talked before, I think the success cases are covered by previous test.
Addiotionally this is the report of gas consumption using the different alternatives.
image

Copy link
Contributor

@ulasanil ulasanil left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@jurajpiar jurajpiar left a comment

Choose a reason for hiding this comment

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

Just a minor improvement.

test/collector.test.ts Outdated Show resolved Hide resolved
test/collector.test.ts Show resolved Hide resolved
@AndresQuijano AndresQuijano changed the title PP-584 (REL-005): Add the use of openzeppelin/safeTransfer in the Collector PP-584 (REL-005): Add secure transfer in the Collector Nov 28, 2022
Copy link
Collaborator

@antomor antomor left a comment

Choose a reason for hiding this comment

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

LGTM

@antomor antomor merged commit 68fa4a4 into master Nov 29, 2022
@antomor antomor deleted the PP584_rel005_verify_transfers branch November 29, 2022 09:54
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.

None yet

4 participants