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

check if basetoken is contract #832

Merged
merged 1 commit into from
Oct 26, 2023
Merged

Conversation

alexcos20
Copy link
Member

Closes #718

Since there is no guaranteed way of telling if an adress is ERC20, let's make sure at least that is an existing contract.
Changes proposed in this PR:

  • when fixed rate is created, check if basetoken address is a contract

@alexcos20 alexcos20 requested a review from trizin October 25, 2023 10:54
@alexcos20 alexcos20 self-assigned this Oct 25, 2023
@alexcos20 alexcos20 requested a review from trentmc as a code owner October 25, 2023 10:54
Comment on lines +188 to +194
function isContract(address addr) public view returns(bool){
uint32 size;
assembly {
size := extcodesize(addr)
}
return (size > 0);
}

Check warning

Code scanning / Slither

Assembly usage Warning

@alexcos20 alexcos20 linked an issue Oct 25, 2023 that may be closed by this pull request
@openzeppelin-code
Copy link

check if basetoken is contract

Generated at commit: 3f6697c811123b41c19230ba2cee5b6820242981

🚨 Vulnerabilities Summary

Process Issues Results
Contract Inspector note
low
critical
Total
36
13
1
50
Dependency Checker Total 0

For more details view the full report in OpenZeppelin Code

@alexcos20 alexcos20 added this to the Contracts v2.0.0 milestone Oct 25, 2023
@alexcos20 alexcos20 merged commit 1a2cad4 into v2.0 Oct 26, 2023
9 checks passed
@alexcos20 alexcos20 deleted the feature/check_fre_basetoken_for_eoa branch October 26, 2023 09:44
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.

FixedRate: getBTSupply fails if basetoken contract does not exists
2 participants