-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce the ability to implement 3rd-party contract extensions. #1041
Comments
@ruseinov Could you, please, elaborate more here? I don't understand the problem here.
I am not sure if I understand you correctly here, but let me try to provide some hopefully relevant context. Here is the code which is totally valid: #[near_bindgen]
#[derive(BorshDeserialize, BorshSerialize)]
struct MyContract {}
#[near_bindgen]
impl MyContract {
pub fn my_fn_one(&self) {}
}
#[near_bindgen]
impl MyContract {
pub fn my_fn_in_other_impl_block(&self) {}
}
trait SomeNearStandardTrait {
fn standard_fn(&self) {}
}
#[near_bindgen]
impl SomeNearStandardTrait for MyContract {
fn standard_fn(&self) {}
} All three functions will be exposed ( |
TBH those old comments about extensions were a bit confusing, so I'm no longer sure what was the intention there. I suggest we close this and revisit as necessary. |
A continuation of #422.
This should give an ability to wrap the functionality of an existing contract. Perhaps in a form of decorator, that needs to be discussed further to be properly fleshed-out. Perhaps some R&D is in order to figure out the most flexible and easy-to-use way.
Some context:
It's important to understand what's to be achieved by this, here are some questions/thoughts:
The text was updated successfully, but these errors were encountered: