Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/hungry-doors-notice.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@secure-ci/core': major
---

Add support
Upgrade safe script
Add ENS Registry support for multichain
Deploy the new smart contracts
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,30 @@ After running the deployment, make sure to add the addresses to the deployments.
pnpm save:deployments
```

#### Testnet deployment

```shell
// Make sure you have the API Key for optimism sepolia etherscan
pnpm deploy:sepolia-optimsim
// Change the superChainTargetRegistrar in ignition/parameters/sepolia.json5
// Make sure you have the API Key for sepolia etherscan
pnpm deploy:sepolia
// Change the ensRegistrarAddress in ignition/paramters/optimism-sepolia.json
pnpm deploy:cleanup:testnet
```

#### Production deployment

````shell
// Make sure you have the API Key for optimism etherscan
pnpm deploy:optimism
// Change the superChainTargetRegistrar in ignition/parameters/ethereum.json5
// Make sure you have the API Key for etherscan
pnpm deploy:ethereum
// Change the ensRegistrarAddress in ignition/paramters/optimism.json
pnpm deploy:cleanup:production


### Publish:

We use [changesets](https://www.npmjs.com/package/@changesets/cli) to manage the versioning and publishing of the packages
Expand All @@ -95,7 +119,7 @@ the ENS Registry with the contracts from the protocol
pnpm node
// In another terminal
pnpm dev
```
````

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion contracts/Registrars/EnsRegistrar.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ contract EnsRegistrar is SuperChainSourceRegistrar {
address _ensRegistry,
address _sciRegistry,
address _crossChainDomainMessagnger
) SuperChainSourceRegistrar(_crossChainDomainMessagnger, _sciRegistry) {
) SuperChainSourceRegistrar(_sciRegistry, _crossChainDomainMessagnger) {
ensRegistry = ENS(_ensRegistry);
}

Expand Down
6 changes: 4 additions & 2 deletions contracts/Registrars/SciRegistrar.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ contract SciRegistrar is AccessControlDefaultAdminRules {
* @dev Initializes the contract by setting up the SCI Registry reference and defining the admin rules.
* @param _sciRegistry Address of the custom domain registry contract.
* @param initialDelay The {defaultAdminDelay}. See AccessControlDefaultAdminRules for more information.
* @param _initialDefaultAdmin The {initialDefaultAdmin}. See AccessControlDefaultAdminRules for more information.
*/
constructor(
address _sciRegistry,
uint48 initialDelay
) AccessControlDefaultAdminRules(initialDelay, msg.sender) {
uint48 initialDelay,
address _initialDefaultAdmin
) AccessControlDefaultAdminRules(initialDelay, _initialDefaultAdmin) {
registry = ISciRegistry(_sciRegistry);
}

Expand Down
4 changes: 2 additions & 2 deletions contracts/Registrars/SuperChainSourceRegistrar.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ abstract contract SuperChainSourceRegistrar {

/**
* @dev Initializes the contract by setting up the Cross domain messenger and the target registrar.
* @param _crossDomainMessanger The address of the cross-domain messenger contract.
* @param _targetRegistrar The address of the registrar contract on the target chain.
* @param _crossDomainMessanger The address of the cross-domain messenger contract.
*/
constructor(address _crossDomainMessanger, address _targetRegistrar) {
constructor(address _targetRegistrar, address _crossDomainMessanger) {
crossDomainMessanger = ICrossDomainMessanger(_crossDomainMessanger);
targetRegistrar = _targetRegistrar;
}
Expand Down
14 changes: 11 additions & 3 deletions contracts/Registrars/SuperChainTargetRegistrar.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,21 @@ contract SuperChainTargetRegistrar is SuperChainAccessControlDefaultAdminRules {
* @dev Initializes the contract by setting up the SCI Registry reference and defining the admin rules.
* @param _sciRegistry Address of the custom domain registry contract.
* @param _crossDomainMessanger Address of the cross-domain messenger contract.
* @param initialDelay The {defaultAdminDelay}. See AccessControlDefaultAdminRules for more information.
* @param _initialDelay The {defaultAdminDelay}. See AccessControlDefaultAdminRules for more information.
* @param _initialDefaultAdmin The {initialDefaultAdmin}. See AccessControlDefaultAdminRules for more information.
*/
constructor(
address _sciRegistry,
address _crossDomainMessanger,
uint48 initialDelay
) SuperChainAccessControlDefaultAdminRules(_crossDomainMessanger, initialDelay, msg.sender) {
uint48 _initialDelay,
address _initialDefaultAdmin
)
SuperChainAccessControlDefaultAdminRules(
_crossDomainMessanger,
_initialDelay,
_initialDefaultAdmin
)
{
registry = ISciRegistry(_sciRegistry);
}

Expand Down
4 changes: 1 addition & 3 deletions contracts/SCI.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@ contract SCI is Initializable, Ownable2StepUpgradeable {
* Can only be called once during contract deployment.
*
* @param owner The owner of this contract.
* @param _registry The address of the registry to be used by the contract.
*/
function initialize(address owner, address _registry) external initializer {
function initialize(address owner) external initializer {
__Ownable2Step_init();
__Ownable_init(owner);
setRegistry(_registry);
}

/**
Expand Down
11 changes: 8 additions & 3 deletions contracts/SciRegistry/SciRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,16 @@ contract SciRegistry is ISciRegistry, AccessControlDefaultAdminRules, DomainMana
/**
* @dev Constructor to initialize the Registry contract.
* Sets the REGISTRAR_MANAGER_ROLE as the admin role of REGISTRAR_ROLE.
* @param initialDelay The {defaultAdminDelay}. See AccessControlDefaultAdminRules for more information.
* @param _initialDelay The {defaultAdminDelay}. See AccessControlDefaultAdminRules for more information.
* @param _initialDefaultAdmin The {initialDefaultAdmin}. See AccessControlDefaultAdminRules for more information.
*/
constructor(
uint48 initialDelay
) AccessControlDefaultAdminRules(initialDelay, msg.sender) DomainManager(address(this)) {
uint48 _initialDelay,
address _initialDefaultAdmin
)
AccessControlDefaultAdminRules(_initialDelay, _initialDefaultAdmin)
DomainManager(address(this))
{
_setRoleAdmin(REGISTRAR_ROLE, REGISTRAR_MANAGER_ROLE);
}

Expand Down
10 changes: 9 additions & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import '@openzeppelin/hardhat-upgrades';
import '@nomicfoundation/hardhat-ledger';
import '@nomicfoundation/hardhat-ignition-ethers';
import 'dotenv/config';
import { ethers } from 'ethers';

function getUrl(url: string | undefined): string {
return url ?? '';
Expand All @@ -20,6 +21,13 @@ const config: HardhatUserConfig = {
typechain: {
outDir: 'types',
},
ignition: {
strategyConfig: {
create2: {
salt: ethers.keccak256(ethers.toUtf8Bytes('SCI')),
},
},
},
networks: {
sepolia: {
chainId: 11155111,
Expand All @@ -31,7 +39,7 @@ const config: HardhatUserConfig = {
url: getUrl(process.env.OPTIMISM_SEPOLIA_PROVIDER_URL),
ledgerAccounts: [process.env.ADDRESS!],
},
mainnet: {
ethereum: {
chainId: 1,
url: getUrl(process.env.ETHEREUM_MAINNET_PROVIDER_URL),
ledgerAccounts: [process.env.ADDRESS!],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../build-info/355ef2359bb7e257007ca3de8fab8b49.json"
}
Loading