[DRAFT] feat: v0.2.0 diamond proxy#347
Conversation
✅ Deploy Preview for delightful-dieffenbachia-2097e0 canceled.
|
✅ Deploy Preview for delightful-dieffenbachia-2097e0 canceled.
|
|
Wow thanks a lot! Tagging the relevant discussion here: https://github.com/orgs/stellar/discussions/1700 We definitely need some time to inspect all these :) |
|
Hi @leighmcculloch Please take a look when you have a chance, thank you |
mootz12
left a comment
There was a problem hiding this comment.
Noticed a few things with the authorizations.
Added more architectural feedback to the discussion: https://github.com/orgs/stellar/discussions/1700#discussioncomment-17265420
| // Create a unique authorization marker for this call | ||
| // The facet will require auth on the diamond proxy address with the facet address as argument | ||
| // This ensures only calls through the diamond proxy's fallback can succeed | ||
| let auth_args = soroban_sdk::vec![&env, target.clone().into_val(&env)]; | ||
|
|
||
| env.authorize_as_current_contract(soroban_sdk::vec![ | ||
| &env, | ||
| InvokerContractAuthEntry::Contract(SubContractInvocation { | ||
| context: ContractContext { | ||
| contract: env.current_contract_address(), // Diamond proxy address | ||
| fn_name: Symbol::new(&env, "__check_auth"), | ||
| args: auth_args.clone(), | ||
| }, | ||
| sub_invocations: soroban_sdk::vec![&env], | ||
| }) | ||
| ]); |
There was a problem hiding this comment.
can you expand on what you are trying to achieve here? I'd be surprised if this did anything tangible
| context: ContractContext { | ||
| contract: target.clone(), | ||
| fn_name: selector.clone(), | ||
| args: args.clone().into_val(&env), |
There was a problem hiding this comment.
you'd likely need to extend this with the proxies contract address, so the facet can require_auth it.
Ditto for the storage ones above
Submission of the Diamond Proxy infrastructure.
Status: DRAFT
After internal review, we will mark this as ready for code review. In the interim, this PR can be used to guide discussions around the concept and its security. The PR is open to concept review at this time.