Skip to content

Colored core#1

Merged
nuevoalex merged 3 commits intomainfrom
colored_core
Sep 29, 2025
Merged

Colored core#1
nuevoalex merged 3 commits intomainfrom
colored_core

Conversation

@nuevoalex
Copy link
Collaborator

No description provided.

@nuevoalex nuevoalex requested review from KillariDev and MicahZoltu and removed request for KillariDev and MicahZoltu September 25, 2025 19:04
@MicahZoltu MicahZoltu requested review from KillariDev and MicahZoltu and removed request for KillariDev and MicahZoltu September 26, 2025 16:48

function migrateREP(uint192 universeId, uint256 amount, uint8 outcome) public {
migrateREPInternal(universeId, amount, outcome, msg.sender, msg.sender);
function migrateREP(uint192 universeId) public {
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we should rename this to UnwrapForkedRep to be a bit more clear that it is not migrating anything, but instead turning your wrapped legacy REP into REP in each outcome?

if (singleOutcome < 3 && i != singleOutcome + 1) continue;
uint192 childUniverseId = (universeId << 2) + i;
Universe memory childUniverse = universes[childUniverseId];
ReputationToken(address(childUniverse.reputationToken)).mint(recipient, amount);
Copy link
Member

Choose a reason for hiding this comment

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

This has me wondering if REP should be an ERC1155 token instead of an ERC20, where the token ID is the universe ID. This way there is a single "REP" token address throughout all forks rather than having a new one each time.

Copy link
Collaborator

Choose a reason for hiding this comment

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

that would be interesting. I am not sure if the UX of its is better for it thought

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Token ID would be universe + outcome I think. Would be easy to do since we have that pattern already established for share tokens. ERC1155 is potentially a UX downgrade for ethereum ecosystem stuff (trading etc) though as it never gained large scale adoption. On the other hand it does mean only one approval for Augur specific UX stuff. I'm ambivalent on it but open to this for sure if we have strong opinions on any level.

require(!marketResolutionDataIsFinalized(marketResolutionData), "Cannot migrate REP from finalized market");

migrateREPInternal(_universeId, REP_BOND, _outcome, address(this), marketResolutionData.initialReporter);
migrateREPInternal(_universeId, REP_BOND, address(this), marketResolutionData.initialReporter, 3);
Copy link
Member

Choose a reason for hiding this comment

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

Consider using a more obvious sentinel value for this (and make the associated change in the loop below). This will help make it more clear to the reader that this is a sentinel value.

Suggested change
migrateREPInternal(_universeId, REP_BOND, address(this), marketResolutionData.initialReporter, 3);
migrateREPInternal(_universeId, REP_BOND, address(this), marketResolutionData.initialReporter, type(uint8).max);

Universe memory childUniverse = universes[childUniverseId];
ReputationToken(address(childUniverse.reputationToken)).mint(recipient, amount);
for (uint8 i = 1; i < Constants.NUM_OUTCOMES + 1; i++) {
if (singleOutcome < 3 && i != singleOutcome + 1) continue;
Copy link
Member

Choose a reason for hiding this comment

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

See associated comment above.

Suggested change
if (singleOutcome < 3 && i != singleOutcome + 1) continue;
if (singleOutcome != type(uint8).max && i != singleOutcome + 1) continue;

Note: This fails in favor of minting nothing if there is somehow a bug where someone passes a singleOutcome other than the sentinal value or a valid outcome.

}

function migrateStakedRep(uint192 _universeId, uint56 _marketId, uint8 _outcome) external {
function migrateStakedRep(uint192 _universeId, uint56 _marketId) external {
Copy link
Collaborator

Choose a reason for hiding this comment

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

we should use some other term than migrate I feel as we have concept of migrating REP and OI in the higher layer


function migrateREPInternal(uint192 universeId, uint256 amount, uint8 outcome, address migrator, address recipient) private {
require(outcome < 3, "Invalid outcome");
// singleOutcome will only credit the provided outcome if it is a valid outcome, else all child universe REP will be minted
Copy link
Collaborator

Choose a reason for hiding this comment

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

what does this mean? can there be a non-valid outcome?

Copy link
Member

Choose a reason for hiding this comment

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

Every number in uint8 besides 0, 1, and 2 are "invalid". The code uses "all of the others" as a sentinel value to indicate everything should be minted. My suggestion below is to have a single sentinel value for "mint everything", then 0, 1, 2 would mint a single token, and everything else would just burn the REP without minting anything.

if (singleOutcome < 3 && i != singleOutcome + 1) continue;
uint192 childUniverseId = (universeId << 2) + i;
Universe memory childUniverse = universes[childUniverseId];
ReputationToken(address(childUniverse.reputationToken)).mint(recipient, amount);
Copy link
Collaborator

Choose a reason for hiding this comment

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

that would be interesting. I am not sure if the UX of its is better for it thought


function migrateREP(uint192 universeId, uint256 amount, uint8 outcome) public {
migrateREPInternal(universeId, amount, outcome, msg.sender, msg.sender);
function migrateREP(uint192 universeId) public {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you also add amount to this. The second layer controls rep of multiple people so it might sense to migrate only partially, and migrate into multiple universes at once

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Discussed in meeting, leaving out for now but if we can come up with a compelling reason someone would want to only partially convert their REP its easy to add back.

@nuevoalex nuevoalex merged commit 4459a9a into main Sep 29, 2025
@KillariDev KillariDev mentioned this pull request Feb 13, 2026
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.

3 participants