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

test(medusa): multiple strat #48

Merged
merged 3 commits into from
Oct 29, 2024
Merged

Conversation

simon-something
Copy link

No description provided.

@simon-something
Copy link
Author

didn't include the superfluid one, as it's relying on Superfluid

uint256[] internal ghost_poolIds;
mapping(uint256 _poolId => address _poolAdmin) ghost_poolAdmins;

// mapping(uint256 _poolId => PoolStrategies _strategy) internal _poolStrategy;

Choose a reason for hiding this comment

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

Should this mapping be deleted?

Copy link
Author

Choose a reason for hiding this comment

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

yes

mapping(PoolStrategies _strategy => address _implementation)
internal _strategyImplementations;

function _initImplementations(address _allo) internal {

Choose a reason for hiding this comment

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

🔥

}

function _recordPool(uint256 _poolId, PoolStrategies _strategy) internal {
// _poolStrategy[_poolId] = _strategy;

Choose a reason for hiding this comment

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

should it be deleted?

Copy link
Author

Choose a reason for hiding this comment

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

yes

emit TestFailure("Wrong pool strategy implementation address");
}

function _strategyHasImplementation(
Copy link

@0xRaccoon 0xRaccoon Oct 24, 2024

Choose a reason for hiding this comment

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

another option is to use an aux mapping(PoolStrategies strategy => address implementation) to avoid the for loop

Copy link
Author

Choose a reason for hiding this comment

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

as we are not optimising for gas, I think we should avoid as much as possible having state in the test contract, when we can easily(ish) compute it instead - wdyt?

Choose a reason for hiding this comment

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

yes it's fine for me

// Deploy strategies implementations
_initImplementations(address(allo));

// strategy_directAllocation = new DirectAllocationStrategy(address(allo));

Choose a reason for hiding this comment

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

should we remove this?

Copy link
Author

Choose a reason for hiding this comment

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

also yes

DEFAULT_MAX_BID = 1000;

for (uint256 i = 1; i <= uint256(type(PoolStrategies).max); i++) {
address _deployer = _ghost_actors[i % 4];

Choose a reason for hiding this comment

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

why is it % 4 ? if we are interested to use a specific address we could mark it explicitly just in case _ghost_actors is changed in the future

Copy link
Author

Choose a reason for hiding this comment

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

the first 4 actors are anchor owner, no?

Choose a reason for hiding this comment

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

makes sense

Copy link

@0xRaccoon 0xRaccoon left a comment

Choose a reason for hiding this comment

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

looks really good, left some minor comments

@simon-something simon-something merged commit dce7626 into test/invariants Oct 29, 2024
1 of 2 checks passed
@simon-something simon-something deleted the invar/prop-1 branch October 29, 2024 11:49
@0xRaccoon 0xRaccoon restored the invar/prop-1 branch October 29, 2024 16:54
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