-
Notifications
You must be signed in to change notification settings - Fork 14
Add compliance wrapper and script new T-REX flow #5
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
jhelison
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.
We should one of:
- The word whitelist on the contract name
Or/And - Have simple docs
This wrapper stuff can be quite confusing until people check the states and the execution
| let module_address = COMPLIANCE_MODULE_ADDRESS.load(deps.storage)?; | ||
|
|
||
| // Replace whitelisted addrs with None | ||
| let from = if is_whitelisted(deps, from.clone()) { | ||
| None | ||
| } else { | ||
| from | ||
| }; | ||
| let to = if is_whitelisted(deps, to.clone()) { | ||
| None | ||
| } else { |
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.
This is interesting, good job. 100% sure that current compliance modules handle well from and to as None?
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.
Yep, I checked them both. They were already ready to handle calls that were missing one or the other and checked it individually.
| let module_address = COMPLIANCE_MODULE_ADDRESS.load(deps.storage)?; | ||
|
|
||
| // Replace whitelisted addrs with None | ||
| let from = if is_whitelisted(deps, from.clone()) { | ||
| None | ||
| } else { | ||
| from | ||
| }; | ||
| let to = if is_whitelisted(deps, to.clone()) { | ||
| None | ||
| } else { |
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.
Da heck is going on here? Are we not setting the option above on line 171?
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.
Oh shit, I must have gotten something in my head mid implementation. Yes, it is duplicated.
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.
I removed it, it doesn't change how it works but for a future deploy it won't have that
I renamed the contract and added a simple readme. |
Description
Creates the flow for a new T-REX including a liquidity pool midway.
Also adds a compliance wrapper that allows whitelisting an address. This way we can use token pairs to do transfers.
Type of change
How Has This Been Tested?
Tested manually