Frames as smart contract user interfaces #152
Flydexo
started this conversation in
FIP Stage 1: Ideas
Replies: 1 comment
-
|
I really like this idea! Rather than making changes to the standard, I suspect you could create a translation layer that maps a contract ABI to a frame API. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
A standard to use contracts directly on frames. To the contract has a view function like
interfaceURIthat redirects to a JSON file describing how to use the contract. We build a frame with/{chain_id}/{address}and it forms a frame corresponding to the contract. For example:{ "actions": [ { "name": "Deposit", "description": "Deposit stETH to earn 5% APY", "inputs": [ { "name": "Amount (stETH)", "id": "amount", "type": "uint256", "toTheTenthPower": 18 } ], "transactions": [ { "contract": "steth.eth", "function": "approve(uint256 amount, address operator)", "args": [ "{amount} (reference to the inputs)", "vault.eth" ], "messages": { "success": "stETH approved to vault", "error": "Could not approve stETH because {error}", "pending": "Approving stETH: {status}" } }, { "contract": "vault.eth", "function": "deposit(uint256 amount)", "args": ["{amount}"], "messages": { "success": "{amount} stETH deposited to vault.eth", "error": "Could not deposit stETH because {error}", "pending": "Depositing stETH into vault: {status}" } } ] } ] }Each frame can have it's own ui component and style and I think we can even allow devs to add js code that will be executed in the backend in a sandbox (maybe with deno). To make it really decentralised I think the client should parse
blockchain_id:contract_addressand create a frame with the default / chosen provider by the user (something that can be modified in settings)Beta Was this translation helpful? Give feedback.
All reactions