Replies: 3 comments 2 replies
-
Interesting... 🤔 So you propose that a user would deploy two contracts? One standard wasm file that would have the same methods but they actually perform a cross-contract call to the second contract deployed in the |
Beta Was this translation helpful? Give feedback.
-
Proxy contract is an innovative idea and will solve some problem, but developer need to write their proxy contract, in Rust (Or in standalone JS sdk, but that storage cost drawback comes). The proxy contract cannot be auto generated from their JS contract, the reason is explained in the following common use case: The goal is to call from a js contract to a rust contract. Rust contract checks the predecessor_account_id to control access permission and we don't want it to be "jsvm.testneat". So developer add the proxy contract, now user calls the proxy contract. The proxy contract forward argument to JS contract. The proxy contract also invokes the Rust contract, to get predecessor_account_id right. Therefore, the proxy contract invokes both JS and Rust contract. If user want process the return value of the Rust contract, they cannot do that in the JS contract. They need to write in the proxy contract in Rust. The proxy contract will look like:
|
Beta Was this translation helpful? Give feedback.
-
The Aurora team has a vision that is similar to the ideas described here, but structured: https://github.com/aurora-is-near/AIPs/pull/2/files |
Beta Was this translation helpful? Give feedback.
-
I've noticed a few discussions around difficulties integrating JSVM smart contracts with the larger NEAR ecosystem, e.g. cross-contract calls, standards integration, access keys etc.
I think many of these issues could be solved almost completely transparently by generating a proxy WASM contract to deploy to the main account. This contract would merely forward native method calls to the correct
call_js_contract
call on the JSVM contract, remapping arguments as necessary. However, this would solve the function-call access key issue, the standards integration issue, and the cross-contract calls in one fell swoop.Is this a viable solution?
Beta Was this translation helpful? Give feedback.
All reactions