[ECO-1562] Begin preliminary struct architecture #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
emojicoin_dot_fun::emojicoin_dot_fun
structureThe 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 theRegistryAddress
.The
Registry
is an object complete with anextend_ref
, which allows it to publish markets at deterministic object addresses. New markets may be published viaobject::create_named_object
for theRegistry.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
andEmojicoinLP
types will be published under theMarket.extend_ref
signer, which is a function of theRegistry.extend_ref
address and theemoji_bytes
for the marketTesting
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?