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

added e2e test #13

Merged
merged 7 commits into from
May 31, 2024
Merged

added e2e test #13

merged 7 commits into from
May 31, 2024

Conversation

devlancer412
Copy link
Contributor

No description provided.


// revoke deployer minter rights
// actually don't need to do this because deployer doesn't have minter role
await sgEth.removeMinter(deployer.address);
Copy link
Owner

Choose a reason for hiding this comment

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

hmm. good spot.
ok lets not do this then.
lets instead

  1. make sure deployer cant mint
  2. no one can mint
  3. add minter
  4. make sure only minter can mint

feeCalc,
sgEth.address,
wsgETH.address,
ethers.constants.AddressZero, // using dummy address
Copy link
Owner

Choose a reason for hiding this comment

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

can you comment in what these addresses are supposed to be?
cos i forgot lol

i think being able to deploy with a zero addr will annoy auditers, so we should

  1. make sure its not possible to deploy with 0 addr OR
  2. if deployed w/ 0 addr, it fails at whatever the top most fn call would be, in our case maybe its deposit() called by users with eth. And is caught by a deploy script or the e2e tests in the deploy scripts

const wsgETH = await WSGETH.deploy(sgEth.address, 24 * 60 * 60);
await wsgETH.deployed();

const feeCalc = ethers.constants.AddressZero; // not sure if it is right
Copy link
Owner

Choose a reason for hiding this comment

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

iirc, theres 3 missing contracts here from the default deploy pipeline linked below:

https://github.com/chimera-defi/SharedDeposit/blob/main/deploy/v2/lib/onchain_actions.js#L102

  1. daoFeeSplitter -> OpenZeppellin vanilla paymentsSplitter , pulled in here

    daoFeeSplitter: "PaymentSplitter",

    source:
    OZ-3.3. - https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.3/contracts/payment/PaymentSplitter.sol
    Note: - this is removed from OZ master, should check to make sure its still safe. Also need to rethink this build approach since it wasnt obvious to you what this contract should be?

  2. Withdrawals -> https://github.com/chimera-defi/SharedDeposit/blob/main/contracts/v2/core/Withdrawals.sol

  3. RewardsReceiver -> https://github.com/chimera-defi/SharedDeposit/blob/main/contracts/v2/core/RewardsReceiver.sol

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could you let me know parameters of each contract constructor?

Copy link
Owner

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What's the deposit contract? on args of minterv2?

.withArgs(ethers.constants.HashZero, deployer.address, deployer.address);

// check auth invariants are preserved. i.e ex owner and outsiders cannot interact with the contract
await expect(sgEth.connect(deployer).transferOwnership(alice.address)).to.be.revertedWith(
Copy link
Owner

Choose a reason for hiding this comment

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

we check deployer cant transfer to alice, but can we also make sure alice cant transfer to anyone? deployer + 0x00?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think alice can transfer ownership to another. do you want me to check this?

Copy link
Owner

Choose a reason for hiding this comment

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

yea?
how does the ownership work here?
in the architecture, only the admin should be able to transfer ownership, and after the deployer renounces, only a multisig / test addr that recvd ownership should be able to act to transfer ownership or call owner only fns.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay. got it

@devlancer412 devlancer412 requested a review from chimera-defi May 28, 2024 12:27
@chimera-defi
Copy link
Owner

Can we pull the e2e into its own file?
i feel like its going to just keep growing. there's a few full system behaviours we wanna check. like the e2e flow with interest accumulation in the docs.
https://docs.sharedstake.finance/sharedstake-v2/user-scenarios

@devlancer412
Copy link
Contributor Author

So you want to move this e2e script into a new file?

@chimera-defi
Copy link
Owner

So you want to move this e2e script into a new file?

yep.
also can you rebase onto main?
i added CI tests that should autorun

Copy link
Owner

@chimera-defi chimera-defi left a comment

Choose a reason for hiding this comment

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

lgtm. ty

@chimera-defi chimera-defi merged commit 1fe4278 into chimera-defi:main May 31, 2024
1 check passed
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