Skip to content

feat: add superchain erc20 factory#8

Closed
agusduha wants to merge 4 commits intosuperc20from
feat/add-superchain-erc20-factory
Closed

feat: add superchain erc20 factory#8
agusduha wants to merge 4 commits intosuperc20from
feat/add-superchain-erc20-factory

Conversation

@agusduha
Copy link
Copy Markdown
Member

🤖 Linear

Closes OPT-146

@agusduha agusduha requested a review from 0xng July 19, 2024 19:52
@linear
Copy link
Copy Markdown

linear bot commented Jul 19, 2024

import { ISemver } from "src/universal/ISemver.sol";
import { Predeploys } from "src/libraries/Predeploys.sol";
import { IL2ToL2CrossDomainMessenger } from "src/L2/IL2ToL2CrossDomainMessenger.sol";
import { ICrossDomainMessenger } from "@openzeppelin/contracts/vendor/optimism/ICrossDomainMessenger.sol";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This import seems incorrect, the repo should have a way of fetching it from the repo itself instead of oz's package

Copy link
Copy Markdown
Member Author

@agusduha agusduha Jul 22, 2024

Choose a reason for hiding this comment

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

The thing is that there is no interface for CrossDomainMessenger, should we add one?

Tried using the contract but it is fixed at 0.8.15 and was having Found incompatible Solidity versions errors

import { IL2ToL2CrossDomainMessenger } from "src/L2/IL2ToL2CrossDomainMessenger.sol";
import { ICrossDomainMessenger } from "@openzeppelin/contracts/vendor/optimism/ICrossDomainMessenger.sol";
import { BeaconProxy } from "@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol";
import { CREATE3 } from "@rari-capital/solmate/src/utils/CREATE3.sol";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

the repo remapping is using '@rari-capital/solmate/=lib/solmate' , should we add another solmate lib?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

we can also use CREATE3 from @solady/=lib/solady/src

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

hmm leave it then, apparently this links to t11s repo somehow

address internal constant NATIVE_INITIALIZER = 0x0000000000000000000000000000000000000000;

/// @notice Address of the L2CrossDomainMessenger Predeploy.
address internal constant L2_CROSS_DOMAIN_MESSENGER = Predeploys.L2_CROSS_DOMAIN_MESSENGER;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we probably can skip the declaration of all these variables and use Predeploys.L2_CROSS_DOMAIN_MESSENGER directly, or even import the specific variables from the constants file

_message: _message
});

unchecked {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

no need to do this anymore, the compiler now takes care of it, you can add it to the for declaration for (i; i< chainIds.length; i++), you should catch the length of the chains though

/// @param _remoteToken Address of the remote token.
/// @param _chainIds Chain IDs to deploy to.
function deployWithMetadata(address _remoteToken, uint256[] memory _chainIds) external {
DeploymentData memory _metadata = deploymentsData[_remoteToken];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

fetching it from storage may be cheaper, we should test this, but this is very minor not priority

@agusduha agusduha added the hold Do not merge for now label Aug 8, 2024
@agusduha
Copy link
Copy Markdown
Member Author

This PR is outdated, closing...

@agusduha agusduha closed this Aug 22, 2024
@agusduha agusduha deleted the feat/add-superchain-erc20-factory branch August 22, 2024 15:16
0xiamflux pushed a commit that referenced this pull request Jan 27, 2026
feat(consensus): op-alloy-consensus
0xiamflux pushed a commit that referenced this pull request Jan 27, 2026
0xOneTony pushed a commit that referenced this pull request Mar 6, 2026
…imism#19281)

* fix(contracts): address audit findings #14, #6, #8, #13, #19

- #14: Reuse existing DelayedWETH from SystemConfig instead of deploying
  a new one in the Migrator, preventing divergence with future upgrades
- #6: Document that hardcoded game type lists in OPCMv2 and Migrator are
  intentional and must be kept in sync when new types are added
- #8: Document that migrate() does not enforce SuperchainConfig version floor
- #13: Document why migration game config validation is deliberately minimal
- #19: Document theoretical risk in AnchorStateRegistry.isGameRegistered
  when ASR proxy is replaced non-atomically

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(contracts): add cross-reference comment to GameTypes library

Add a notice to the GameTypes library reminding developers to update
the hardcoded game type lists in OPContractsManagerMigrator and
OPContractsManagerV2's _assertValidFullConfig when adding new types.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(contracts): bump OPContractsManagerV2 version for rebase

Bump OPContractsManagerV2 from 7.0.9 to 7.0.10 to account for the
comment-only source change (cross-reference note added in prior commit)
that affects the bytecode metadata hash.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(contracts): bump OPContractsManagerV2 version to 7.0.11 for semver-diff CI fix

* fix(contracts): apply forge fmt and bump versions for formatting changes

forge fmt changed OPContractsManager, FaultDisputeGame, SuperFaultDisputeGame,
and several other files. Bump patch versions for the contracts with hash changes,
and regenerate semver-lock and snapshots.

- OPContractsManager: 6.0.3 -> 6.0.4
- FaultDisputeGame: 2.4.0 -> 2.4.1
- SuperFaultDisputeGame: 0.7.0 -> 0.7.1

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: smartcontracts <smartcontracts@users.noreply.github.com>
0xChin added a commit that referenced this pull request Mar 9, 2026
Cantina audit finding #8: transferOwnership now nominates a pending
owner who must call acceptOwnership() to finalize the transfer,
preventing irrevocable ownership loss from incorrect addresses.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@0xChin 0xChin mentioned this pull request Mar 9, 2026
0xOneTony pushed a commit that referenced this pull request Mar 16, 2026
* docs(staking): document pause bypass behavior in setAllowedStaker

* fix(staking): only reset lastUpdate on full unstake in _decreasePeData

Cantina audit finding #7: _decreasePeData unconditionally reset
lastUpdate on every decrease, penalizing partial unstakers by
resetting their staking weight. Now lastUpdate is only reset when
effectiveStake reaches zero.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(staking): implement two-step ownership transfer

Cantina audit finding #8: transferOwnership now nominates a pending
owner who must call acceptOwnership() to finalize the transfer,
preventing irrevocable ownership loss from incorrect addresses.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs(staking): document lastUpdate reset trust assumption in setAllowedStaker

Cantina audit finding #10: when a beneficiary removes a staker from
their allowlist, the staker's lastUpdate is reset via _increasePeData,
losing accumulated staking weight. Document this as an inherent trust
assumption of the delegation model.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: undo version change

* chore: upgrade natspec

* chore: update event emission order

* fix: wrong event args

* chore: add interface comments

* fix: pre-pr

* refactor: make ownable private functions public

* fix: pre-pr

* feat(ownable): reset pending owner on zeroaddress ownership transfer

* refactor: inherit OZ's ownable and use helper contract for mapping storage slot

* fix: ci

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hold Do not merge for now

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants