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

Decentralize contract entry points #698

Closed
webmaster128 opened this issue Jan 7, 2021 · 0 comments · Fixed by #701
Closed

Decentralize contract entry points #698

webmaster128 opened this issue Jan 7, 2021 · 0 comments · Fixed by #701

Comments

@webmaster128
Copy link
Member

webmaster128 commented Jan 7, 2021

Right now there are 3 places where entry points (i.e. Wasm exported functions) are created:

  1. Any use cosmwasm_std creates cosmwasm_vm_version_4, allocate, deallocate
  2. The create_entry_points! macro creates init, handle, query
  3. The create_entry_points_with_migration! macro creates init, handle, query, migrate

This model does not scale. But it is probably not great anyways to require this central place where all entry points are collected.

Instead we can decorate the entrypoints directly with something like this:

#[entry_point_init]
pub fn init(
    deps: DepsMut,
    _env: Env,
    info: MessageInfo,
    msg: InitMsg,
) -> Result<InitResponse, HackError> {

This becomes very useful with #692 and #693.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant