-
Notifications
You must be signed in to change notification settings - Fork 0
feat(payments): add address allowlist #19
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
Conversation
9a2a6cc to
91c92c4
Compare
ishay-starkware
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename the title to add allowlist
@ishay-starkware reviewed all commit messages.
Reviewable status: 0 of 5 files reviewed, 8 unresolved discussions (waiting on @ImmanuelSegol)
src/payments.cairo line 91 at r1 (raw file):
tokens: Map<ContractAddress, bool>, // Whitelisted addresses. whitelisted_addresses: Map<ContractAddress, bool>,
Suggestion:
allowlist: Map<ContractAddress, bool>,src/payments.cairo line 292 at r1 (raw file):
// These functions are used by the contract to control who is allowed to take part in order // matching and settlement. Only whitelisted addresses are permitted to trade.
Suggestion:
allowedsrc/interface.cairo line 21 at r1 (raw file):
fn is_token_registered(self: @TContractState, token: ContractAddress) -> bool; fn whitelist_address(ref self: TContractState, address: ContractAddress);
Suggestion:
add_to_allowlistsrc/interface.cairo line 22 at r1 (raw file):
fn whitelist_address(ref self: TContractState, address: ContractAddress); fn remove_from_whitelist(ref self: TContractState, address: ContractAddress);
Suggestion:
remove_from_allowlistsrc/interface.cairo line 23 at r1 (raw file):
fn whitelist_address(ref self: TContractState, address: ContractAddress); fn remove_from_whitelist(ref self: TContractState, address: ContractAddress); fn is_whitelisted(self: @TContractState, address: ContractAddress) -> bool;
Suggestion:
is_allowedsrc/errors.cairo line 3 at r1 (raw file):
use starknet::ContractAddress; pub const ADDRESS_ALREADY_WHITELISTED: felt252 = 'ADDRESS_ALREADY_WHITELISTED';
Suggestion:
ADDRESS_ALREADY_ALLOWEDsrc/events.cairo line 29 at r1 (raw file):
#[derive(Debug, Drop, PartialEq, starknet::Event)] pub struct AddressWhitelisted {
Suggestion:
AddressAllowedsrc/events.cairo line 35 at r1 (raw file):
#[derive(Debug, Drop, PartialEq, starknet::Event)] pub struct AddressRemovedFromWhitelist {
Suggestion:
AddressDisallowed91c92c4 to
fdf9a26
Compare
MohammadNassar1
left a comment
There was a problem hiding this 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 5 files reviewed, 8 unresolved discussions (waiting on @ImmanuelSegol and @ishay-starkware)
src/events.cairo line 29 at r1 (raw file):
#[derive(Debug, Drop, PartialEq, starknet::Event)] pub struct AddressWhitelisted {
Done.
src/events.cairo line 35 at r1 (raw file):
#[derive(Debug, Drop, PartialEq, starknet::Event)] pub struct AddressRemovedFromWhitelist {
Done.
src/payments.cairo line 91 at r1 (raw file):
tokens: Map<ContractAddress, bool>, // Whitelisted addresses. whitelisted_addresses: Map<ContractAddress, bool>,
Done.
src/payments.cairo line 292 at r1 (raw file):
// These functions are used by the contract to control who is allowed to take part in order // matching and settlement. Only whitelisted addresses are permitted to trade.
Done.
src/interface.cairo line 21 at r1 (raw file):
fn is_token_registered(self: @TContractState, token: ContractAddress) -> bool; fn whitelist_address(ref self: TContractState, address: ContractAddress);
Done.
src/interface.cairo line 22 at r1 (raw file):
fn whitelist_address(ref self: TContractState, address: ContractAddress); fn remove_from_whitelist(ref self: TContractState, address: ContractAddress);
Done.
src/interface.cairo line 23 at r1 (raw file):
fn whitelist_address(ref self: TContractState, address: ContractAddress); fn remove_from_whitelist(ref self: TContractState, address: ContractAddress); fn is_whitelisted(self: @TContractState, address: ContractAddress) -> bool;
Done.
src/errors.cairo line 3 at r1 (raw file):
use starknet::ContractAddress; pub const ADDRESS_ALREADY_WHITELISTED: felt252 = 'ADDRESS_ALREADY_WHITELISTED';
Done.
MohammadNassar1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Reviewable status: 0 of 5 files reviewed, 8 unresolved discussions (waiting on @ImmanuelSegol and @ishay-starkware)
fdf9a26 to
c0abb9c
Compare
ishay-starkware
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ishay-starkware reviewed 2 of 5 files at r2, 3 of 3 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @MohammadNassar1)
c0abb9c to
35c8127
Compare
This change is