[SON ETH] Design Ethereum smart contract for primary wallet #343

Closed
opened 2022-04-07 20:04:28 +00:00 by serkixenos · 4 comments
serkixenos commented 2022-04-07 20:04:28 +00:00 (Migrated from gitlab.com)

We want to implement Ethereum primary wallet as a smart contract, rather than a multisig address.

Tools to look into:

https://openzeppelin.com/contracts/
https://trufflesuite.com/

Initial requirements

  • Contract should be controlled by multiple accounts (SON accounts)
  • List of controlling accounts must be updatable by current controllers only
  • Contract must be able to receive and send payments (deposit and withdrawal)
  • Contract must provide set of events to provide information on events of interest

Events of interest are

  • Deposit transaction
  • Withdrawal transaction
  • Change in a list of contract controllers

Nice to have

  • Contract should be updateable (in Ethereum this means it we should have facade contract, and implementation contract)

The output of this task should be a design document explaining the contract architecture, and eventually proof of concept contract, with some test cases

We want to implement Ethereum primary wallet as a smart contract, rather than a multisig address. Tools to look into: https://openzeppelin.com/contracts/ https://trufflesuite.com/ Initial requirements - Contract should be controlled by multiple accounts (SON accounts) - List of controlling accounts must be updatable by current controllers only - Contract must be able to receive and send payments (deposit and withdrawal) - Contract must provide set of events to provide information on events of interest Events of interest are - Deposit transaction - Withdrawal transaction - Change in a list of contract controllers Nice to have - Contract should be updateable (in Ethereum this means it we should have facade contract, and implementation contract) The output of this task should be a design document explaining the contract architecture, and eventually proof of concept contract, with some test cases
serkixenos commented 2022-04-07 20:04:28 +00:00 (Migrated from gitlab.com)

assigned to @pavel.baykov

assigned to @pavel.baykov
serkixenos commented 2022-04-27 13:04:15 +00:00 (Migrated from gitlab.com)

changed title from Design Ethereum smart contract for primary wallet to {+[SON ETH] +}Design Ethereum smart contract for primary wallet

changed title from **Design Ethereum smart contract for primary wallet** to **{+[SON ETH] +}Design Ethereum smart contract for primary wallet**
pavel.baykov commented 2022-05-02 12:04:19 +00:00 (Migrated from gitlab.com)

i think the best option to solve this ticket is:

https://github.com/safe-global/safe-contracts/

it’s possible to deploy it using hardhat

There is python, Javascript, React based apps to communicate with safe-contracts

I checked python based safe-cli

https://github.com/gnosis/safe-cli

Based on requirements:
for withdrawals

https://github.com/gnosis/safe-cli/blob/master/safe_cli/api/relay_service_api.py#L39 

Which use /api/v1/safes/{safe_address}/transactions/

for deposits

https://github.com/gnosis/safe-cli/blob/master/safe_cli/api/transaction_service_api.py#L76

Which use /api/v1/safes/{safe_address}/balances/

To manage SON (owners):
method in the contract

https://github.com/safe-global/safe-contracts/blob/main/contracts/base/OwnerManager.sol#L51

From safe-cli
add_owner

https://github.com/gnosis/safe-cli/blob/1c9197aeaadb4822a67dc93ad0f8c64e43503288/safe_cli/operators/safe_operator.py#L382

remove_owner

https://github.com/gnosis/safe-cli/blob/1c9197aeaadb4822a67dc93ad0f8c64e43503288/safe_cli/operators/safe_operator.py#L397

get_owners

https://github.com/gnosis/safe-cli/blob/1c9197aeaadb4822a67dc93ad0f8c64e43503288/safe_cli/operators/safe_operator.py#L679

How to upgrade contract:

https://github.com/OpenZeppelin/upgrades-safe-app
i think the best option to solve this ticket is: ``` https://github.com/safe-global/safe-contracts/ ``` it’s possible to deploy it using hardhat There is python, Javascript, React based apps to communicate with safe-contracts I checked python based safe-cli ``` https://github.com/gnosis/safe-cli ``` Based on requirements: for withdrawals ``` https://github.com/gnosis/safe-cli/blob/master/safe_cli/api/relay_service_api.py#L39 ``` Which use /api/v1/safes/{safe_address}/transactions/ for deposits ``` https://github.com/gnosis/safe-cli/blob/master/safe_cli/api/transaction_service_api.py#L76 ``` Which use /api/v1/safes/{safe_address}/balances/ To manage SON (owners): method in the contract ``` https://github.com/safe-global/safe-contracts/blob/main/contracts/base/OwnerManager.sol#L51 ``` From safe-cli add_owner ``` https://github.com/gnosis/safe-cli/blob/1c9197aeaadb4822a67dc93ad0f8c64e43503288/safe_cli/operators/safe_operator.py#L382 ``` remove_owner ``` https://github.com/gnosis/safe-cli/blob/1c9197aeaadb4822a67dc93ad0f8c64e43503288/safe_cli/operators/safe_operator.py#L397 ``` get_owners ``` https://github.com/gnosis/safe-cli/blob/1c9197aeaadb4822a67dc93ad0f8c64e43503288/safe_cli/operators/safe_operator.py#L679 ``` How to upgrade contract: ``` https://github.com/OpenZeppelin/upgrades-safe-app ```
serkixenos commented 2022-05-04 15:38:35 +00:00 (Migrated from gitlab.com)

Safe Contracts accepted for detailed review.

Safe Contracts accepted for detailed review.
serkixenos (Migrated from gitlab.com) closed this issue 2022-05-04 15:38:55 +00:00
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Peerplays_Blockchain/peerplays_migrated#343
No description provided.