-
Notifications
You must be signed in to change notification settings - Fork 132
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
Adding generic factory #148
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we check attached_deposit can at least cover storage for the contract?
/// Stores attached data into blob store and returns hash of it. | ||
/// Implemented to avoid loading the data into WASM for optimal gas usage. | ||
#[cfg(target_arch = "wasm32")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we consider exposing some better API for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should, but this is outside of this PR. Filed: near/near-sdk-rs#442 and near/near-sdk-rs#441
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
near/near-sdk-rs#417 has been sitting for about a month, I can try to push for finalizing scope of the next release and getting there soon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, you wouldn't need to wait for any release, can just define the interface that the BLOCKCHAIN_INTERFACE
goes through and it should reduce contract size.
I'll do this now so there is an example, and any workflow to test the functionality would be appreciated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#149 figured PR would be the easiest way to see changes. And the sys interface wasn't needed to be duplicated as it's included in near_bindgen
right now.
updated `create` example
…FACE for wasm env (#149) * improve interface and remove need to go through BLOCKCHAIN_INTERFACE for wasm32 only function * update internal create to not use BLOCKCHAIN_INTERFACE for wasm env * update to 4.0.0-pre.1 to remove duplicate code
This is factory that allows to deploy any contracts that are stored inside it.
Anyone can store a contract and anyone else can use hash to deploy it with various parameters and calling initializer.