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

[N01] Lack of input validation #6989

Merged
merged 6 commits into from
Feb 16, 2021

Conversation

martinvol
Copy link
Contributor

@martinvol martinvol commented Feb 9, 2021

Description

Verify that the address that governance provided for reserve's spender and exchangeSpenders by the functions addSpender and addExchangeSpender respectively are non-zero (0x0).

Other changes

Tested

Added unit tests

Related issues

Backwards compatibility

  • None

@@ -373,13 +377,17 @@ contract('Reserve', (accounts: string[]) => {
it('emits on add', async () => {
const addSpenderTx = await reserve.addSpender(spender)

const addExchangeSpenderTxLogs = addSpenderTx.logs.filter((x) => x.event === 'SpenderAdded')
assert(addExchangeSpenderTxLogs.length === 1, 'Did not receive event')
const addSpenderTxLogs = addSpenderTx.logs.filter((x) => x.event === 'SpenderAdded')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was a typo

@martinvol martinvol marked this pull request as ready for review February 10, 2021 19:18
@martinvol martinvol requested a review from a team February 10, 2021 19:18
@martinvol martinvol changed the title Validate spender addresses [N01] Lack of input validation Feb 10, 2021
@martinvol martinvol added automerge Have PR merge automatically when checks pass and removed automerge Have PR merge automatically when checks pass labels Feb 10, 2021
@martinvol martinvol added the automerge Have PR merge automatically when checks pass label Feb 16, 2021
@martinvol martinvol merged commit c0faae7 into release/celo-core-contracts/3 Feb 16, 2021
@martinvol martinvol deleted the martinvol/validateSpenders branch February 16, 2021 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Have PR merge automatically when checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants