Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Adding generic factory #148

wants to merge 3 commits into from

Conversation

ilblackdragon
Copy link
Member

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.

Copy link
Contributor

@bowenwang1996 bowenwang1996 left a 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?

Comment on lines +58 to +60
/// 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")]
Copy link
Contributor

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?

Copy link
Member Author

@ilblackdragon ilblackdragon Jun 16, 2021

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

Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor

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.

AngelBlock and others added 2 commits June 17, 2021 13:03
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants