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

refactor: migrate repository to foundry-template #6

Merged
merged 1 commit into from
Sep 12, 2023

Conversation

0x-r4bbit
Copy link
Collaborator

This commit migrates the repo to our foundry template, which ensures we have consistent tooling across smart contract repositories that are maintained by Vac.

This removes all hardhat related files and workflows and replaces them with more perfomant foundry workflows.

It also sets up tests, CI and linting.

Copy link
Collaborator Author

@0x-r4bbit 0x-r4bbit left a comment

Choose a reason for hiding this comment

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

@3esmit I've left some inline comments.

There's probably more stuff we can adjust, but for starters, it introduces the foundry-template and also ensures tests are in parity.

| ------------ | -------- | -------- | ---------- |
| | | | |
| | | | |
| | | | |
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

With these I think we need to put our heads together and figure out what the invariants are

}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changes done in this file are just formatting to make the linter happy

}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Same here, just formatting

function mint(address _destination, uint256 _amount) external onlyOwner {
_mint(_destination, _amount);
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've removed this one and added test/mocks/MockERC20.sol

}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just formatting changes from forge fmt

}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Same here, just formatting changes

}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Formatting changes only

return a < b ? a : b;
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure about the entire legacy folder here, but SafeMath is most likely something we can drop altogether since solidity 0.8

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@3esmit Do you know if we need the legacy folder at all?
It didn't seem to be used even prior to the changes I've made in this PR.

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 be able to drop it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed the legacy folder

assertEq(stakeManager.owner(), deployer);
assertEq(stakeManager.totalSupply(), 0);
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This essentially replaces StakeManager.js

constructor() ERC20("Mock SNT", "SNT") {
_mint(msg.sender, 1_000_000_000_000_000_000);
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the new mock that replaces Token.sol

@0x-r4bbit 0x-r4bbit force-pushed the refactor/foundry-template branch 2 times, most recently from 5b11dc2 to d44449e Compare September 8, 2023 17:14
This commit migrates the repo to our foundry template, which ensures we
have consistent tooling across smart contract repositories that are
maintained by Vac.

This removes all hardhat related files and workflows and replaces them
with more perfomant foundry workflows.

It also sets up tests, CI and linting.
@0x-r4bbit 0x-r4bbit merged commit 2e7c514 into develop Sep 12, 2023
4 checks 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.

None yet

2 participants