DXgovernance / davi-monorepo

https://davi-monorepo-davi.vercel.app
8 stars 12 forks source link

Support factory contracts #27

Open rossneilson opened 2 years ago

rossneilson commented 2 years ago

User Story As a proposer I want to be able to call factory generated contracts without adding listings for each individual contract.

Alternative Solutions Instead of specifying an address we will set the address to a specific value e.g. 0x99999999999 We then need an optional new hashed bytecode value in the rich contract schema that is read in these situations.

When creating a proposal with the specific address (0x99999999999) we know this is a factory contract and so will ask the user first in a modal to specify the address of the contract and we will set this as the to value. Here we can also verify the supplied address by comparing hashed bytecodes. Then the user would simply get the usual param form for that contract.

Then in addition to finding trying to match addresses when decoding we should also check against hashed bytecode for a match.

This isn't the best solution because it requires some manual work from the user to find the contract address but we can improve this in future.

rossneilson commented 2 years ago

We should be able to test this by calling release on ERC20VestingFactory generated contracts in localhost

rossneilson commented 1 year ago

DXgovernance/DAVI#294

rossneilson commented 1 year ago

This fell behind, we did have a PR but now we can include it in rich contracts v2