Closed trentmc closed 2 years ago
[trentmc May 19: this comment was given when "Candidate 2" was still the leading candidate. But now we're doing "Candidate 3"]
Began implementing an "Admin Portall" w/ an Allocate dashboard.
TODO:
There is currently no security or permissions around this. Anyone can access this page. I have also taken the liberty of adding a link to the navbar.
May 19 update:
(I updated the description to have more detail)
Reopening, because it would be really nice if:
I was able to use an HW wallet with Brownie.
Here are the steps:
Q: how to do a flow with gnosis safe multisig? A: the key is ape-safe. Here's the quickstart:
from ape_safe import ApeSafe
safe = ApeSafe('ychad.eth')
dai = safe.contract('0x6B175474E89094C44Da98b954EedeAC495271d0F')
vault = safe.contract('0x19D3364A399d251E894aC732651be8B0E4e85001')
amount = dai.balanceOf(safe.account)
dai.approve(vault, amount)
vault.deposit(amount)
safe_tx = safe.multisend_from_receipts()
safe.preview(safe_tx)
safe.post_transaction(safe_tx)
Flow where OPF spends the Ocean. Steps 1-3 do approve, steps 4-6 do allocate.
OCEAN.safeApprove(contract_addr, sum(values))
txDFRewards.sol::allocate()
txFrom some slack discussion...
[Berkay] Wouldn't it be simpler if: Multi sig transfers tokens to hw wallet Hw wallet calls allocate func
[Trent] Yes it's simpler
[Berkay] Do you think there is a security risk this in this approach?
[Trent] I had suggested the multisig because
Tbh I'm on the fence wrt this being worth it
Also, I'm not sure how well Gnosis safe will even support some of the chains
[Berkay] right + we will need to do it every week for each chain, might get complex to manage
[Trent] Good point!
And like mentioned, we can always re-deploy news contracts much later on. We'd probably do that when we automate more fully. That would be in 2023 sometime
To summarize: you're right. Just hw wallet is simpler. And will serve our needs for now. And we have a way to migrate later.
[Berkay] I fully agree, I wish there was an easy way to make it automatable and secure at the same time
I just added instrs for HW wallets into df-py README
https://github.com/oceanprotocol/df-py/commit/09dca5f4dbbd15ec8065e99b6ec936dc072f0dda
We can now close this issue
About multisig wallet:
Options / Steps
Below are three options (A, B, C), and the corresponding steps. Pre-step for all options:
Option A. Multisig -> Local account
dftool newacct
. Remember private key & address.For each chain: 2.1 tx: from multisig, send OCEAN -> local account https://github.com/oceanprotocol/atlantic/blob/master/logs/wallets.md
2.2 check: does local account have funds for gas. If no: tx: from multisig, send funds for gas-> local account
2.3 tx: from local account: dftool dispense
Option B. Multisig -> my hw wallet
For each chain: 1.1 tx: from multisig, send OCEAN -> my hw wallet account https://github.com/oceanprotocol/atlantic/blob/master/logs/wallets.md
1.2 check: does my hw wallet account have funds for gas. If no: tx: from multisig, send funds for gas -> my hw wallet account
1.3 tx: from my hw wallet account: dftool dispense https://github.com/oceanprotocol/df-py/blob/main/README.md#usage-hardware-wallets
Option C. Direct from Multisig
Analysis Chosen approach: A for now
Steps for chosen approach
dftool newacct
. Remember private key & address.For each chain: 2.1 tx: from multisig, send OCEAN -> local account https://github.com/oceanprotocol/atlantic/blob/master/logs/wallets.md
2.2 check: does local account have funds for gas. If no: tx: from multisig, send funds for gas-> local account
2.3 tx: from local account: dftool dispense
Summary
Overall goal: Ensure that DF flow works where hardware wallets can fund OCEAN etc
Details
Here are the smart contract steps wrt paying rewards:
token.safeApprove(contract_addr, sum(values))
DFRewards.allocate(tos, values, token_addr)
. Since there are thousands of LPs, it will batch this.This issue is about step 1.
How does OPF do this approval (step 1)? OPF will be holding the funds in a multisig (gnosis safe) wallet, and signers typically have HW wallets.
Options: [May 18]
clef
. Steps: (a) install geth (b) follow instructions in brownie. CON: geth works for eth mainnet, would need something else for other chains we support. CON: need to install geth, it's heavy[added May 19]
token.safeApprove()
to doing a simple "ERC20.transfer()". We know we can send directly from Gnosis safe.token.safeApprove()
is constructed and put into Gnosis Safe multisig to sign. Then the web interface = Gnosis multisig. Then the question is: how do we construct this "allocate tx"token.safeApprove()
from etherscan. (Can this be with gnosis safe too? Eg is etherscan an "app" in gnosis safe?)Discussion: May 18:
Discussion: May 19: