Last active
May 16, 2022 13:59
-
-
Save bogdan/6df35e4e8752ae22038a9b08d2e279dd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type State = | |
| 'New' | |
| 'Purchased' | |
// Minting tx is pending | |
| 'Minting' | |
| 'MintedOnZilliqa' | |
| 'MintedOnPolygon' | |
| 'MintedOnEthereum' | |
// In transition from L2 to L1 | |
| 'WithdrawingFromPolygon' | |
// In transition from L1 to L2 | |
| 'DepositingToPolygon' | |
| 'UpgradingToPolygon' | |
// Only when burned on L1 | |
// Burning on L2 is Withdrawing | |
| 'Burned'; | |
const StateTransition: Record<State, State[]> = { | |
New: [ | |
'Purchased', | |
], | |
Purchased: [ | |
'Minting', | |
], | |
Minting: [ | |
'MintedOnPolygon', | |
// When minting TX rejected | |
'Purchased', | |
], | |
MintedOnZilliqa: [ | |
'UpgradingToPolygon' | |
], | |
MintedOnPolygon: [ | |
'WithdrawingFromPolygon', | |
], | |
UpgradingToPolygon: ['MintedOnPolygon'], | |
MintedOnEthereum: [ | |
'DepositingToPolygon', | |
'Burned', | |
], | |
WithdrawingFromPolygon: [ | |
'MintedOnEthereum', | |
], | |
DepositingToPolygon: [ | |
'MintedOnPolygon', | |
], | |
Burned: [], | |
}; | |
// Options: | |
// * Merge MintedOnPolygon, MintedOnEthereum to the same state | |
// * Split MintedOnEthereum to MintingOnEtheruemCns and MintingOnEtheruemUns | |
// * Split Depositing, Withdrawing to substate by transaction completion | |
// * Split New into Available and Unavailable based on if it can be purchased | |
// * Add Reserved if domains are reserved for purchase |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment