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

[ECO-1562] Begin preliminary struct architecture #6

Merged
merged 6 commits into from
Apr 14, 2024
Merged

Conversation

alnoki
Copy link
Member

@alnoki alnoki commented Apr 14, 2024

Description

  1. Escape emoji words globally since they will likely occur in other contexts
  2. Refactor package layout for emojicoin_dot_fun::emojicoin_dot_fun structure
  3. Escape a flake warning
  4. Add a stub to the supported emoji set to enable [ECO-1556] Enforce valid emojis in a Move contract #5 (comment)
  5. Add struct layout:

The registry is stubbed to enable #5 (comment).

Markets are also stubbed as an object, to enable coin factory bytecode operations.

Struct layout:

RegistryAddress is stored under @emojicoin_dot_fun as a means for indexing: a view function can allow an offchain element to determine the address of the registry object by checking the RegistryAddress.

The Registry is an object complete with an extend_ref, which allows it to publish markets at deterministic object addresses. New markets may be published via object::create_named_object for the Registry.extend_ref as the signer, and the emoji bytes of the market as a seed. This will allow for deterministic passing of type arguments during market init calls via public entry functions, since the expected object address can be determined offchain, then packed into an SDK type argument call that will correspond to types published from coin factory bytecode stored onchain.

That is, the Emojicoin and EmojicoinLP types will be published under the Market.extend_ref signer, which is a function of the Registry.extend_ref address and the emoji_bytes for the market

Testing

From src/move:

git ls-files | entr -c aptos move compile --dev

Checklist

  • Did you update relevant documentation?
  • Did you add tests to cover new code or a fixed issue?
  • Did you update the changelog?
  • Did you check off all checkboxes from the linked Linear task?

@alnoki alnoki requested a review from xbtmatt April 14, 2024 05:08
Copy link
Collaborator

@xbtmatt xbtmatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Just the one comment I made, but doesn't make much of a difference

@alnoki alnoki merged commit c7b8890 into ECO-1556 Apr 14, 2024
1 check passed
@alnoki alnoki deleted the ECO-1562 branch April 14, 2024 22:58
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.

2 participants