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

Reduce the contract size : split submoloch contract to smaller contracts. #40

Open
hychen opened this issue Apr 14, 2021 · 3 comments
Open
Assignees

Comments

@hychen
Copy link
Owner

hychen commented Apr 14, 2021

The size of submoloch is exceeded the limitation.

Possible Solutions

1 split submoloch to three small contracts,

  1. guild :: to manage memberships;
  2. grant :: to process proposals.
  3. pool :: to transfer the funds

2 shrinking wasm size

  1. Experiment wasm-opt optimization options suggested in (Experiment with some wasm-opt options use-ink/cargo-contract#110)
  2. Experiment methodologies suggested in https://github.com/johnthagen/min-sized-rust

3 Remove erc20 contract from submoloch build dependency. Use erc20-trait instead.

4 Convert error strings to custom Error types.

Leave client side decide which error strings should be printed.

5. Use types that take smaller spaces. (e.x.: u128 -> u8)

@hychen hychen self-assigned this Apr 14, 2021
@hychen
Copy link
Owner Author

hychen commented Apr 15, 2021

@hychen hychen changed the title split submoloch contract to smaller contracts. Reduce contract size : split submoloch contract to smaller contracts. Apr 19, 2021
@hychen hychen changed the title Reduce contract size : split submoloch contract to smaller contracts. Reduce the contract size : split submoloch contract to smaller contracts. Apr 19, 2021
@hychen
Copy link
Owner Author

hychen commented Apr 22, 2021

option 3 and does not help. gonna hack cargo-contract to add some useful options for reducing wasm-size.

@hychen
Copy link
Owner Author

hychen commented Apr 23, 2021

HashMap is way more expensive than I thought.

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

No branches or pull requests

1 participant