I give you an example:
Let's say I would like to give the permission to rebalance investments in 2 tokens like BNB and DOT on PCS.
Do I have to implement every single function in their protocols like deposit, withdraw, etc. to avoid for funds to get stuck.
Or can I just say:
Allow to trade with wallet A only assets DOT,BNB in every way possible until further notice
Do not allow to send funds from wallet A to other wallets
Because otherwise I would not see how it gets stuck as the wallet and the tokens are general existing items not created by my contract.
Mar 10, 2021, 7:54 PM
I think you're misunderstanding something. You don't implement any function from external protocols. You implement your own functionality which calls external contracts. So if you need to call an external contract's deposit function, you create your own function in your own contract which calls that deposit function.
In any case, you definitely want to test this all in a testnet first, so don't worry too much about whether you get it right the first time or not
In any case, you definitely want to test this all in a testnet first, so don't worry too much about whether you get it right the first time or not
Mar 10, 2021, 8:11 PM
Great, ok I think I got it. I will go on testnet use the faucet and wrap a few functions.
Do you think this is something that can be done in just a few lines so a user can easily verify what they are giving their permission to? Or will it involve too much code?
Do you think this is something that can be done in just a few lines so a user can easily verify what they are giving their permission to? Or will it involve too much code?
Mar 10, 2021, 8:15 PM
Impossible to answer, it all depends on how much logic you will have. Withdrawing the tokens (if the allowance has been added by the user) takes 1 line of code, but everything after that depends on you.
Mar 10, 2021, 8:16 PM
I was referring to the code required for just for the allowances to do deposit, withdraw, create LPs. These should be short and understandable.
Users do not need to check out .NET codebase as it will be restricted what it can do based on the contracts they signed.
Users do not need to check out .NET codebase as it will be restricted what it can do based on the contracts they signed.
Mar 10, 2021, 8:18 PM