Add compliance wrapper and script new T-REX flow#5
Conversation
jhelison
left a comment
There was a problem hiding this comment.
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.
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.
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.
Da heck is going on here? Are we not setting the option above on line 171?
There was a problem hiding this comment.
Oh shit, I must have gotten something in my head mid implementation. Yes, it is duplicated.
There was a problem hiding this comment.
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