Skip to content

Commit

Permalink
feat(deployment): deploys Portfolio v1.5.0-beta to mainnet
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexangelj committed Oct 25, 2023
1 parent e92534b commit f9a3e8e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 16 deletions.
25 changes: 18 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,27 @@ Read the local [docs](./docs/src/), hosted docs [docs.primitive.xyz](https://doc
| Contract | Canonical cross-chain address |
| -------------------- | -------------------------------------------- |
| Portfolio 1.3.0-beta | `0x82360b9a2076a09ea8abe2b3e11aed89de3a02d1` |
| Portfolio 1.4.0-beta | `todo` |
| Portfolio 1.5.0-beta | `n/a` |
| Portfolio 1.4.0-beta | `n/a` |
| Portfolio 1.5.0-beta | `0x0000a37Fd680Ab248119b448545eF72C51Bf7530` |

### Deployments by Chain

| Network | Portfolio 1.3.0-beta | Portfolio v1.4.0-beta | Portfolio v1.5.0-beta |
| -------- | ----------------------------------------------------------------------------------------------------------------------------- | --------------------- | --------------------- |
| Ethereum | [0x82360b9a2076a09ea8abe2b3e11aed89de3a02d1](https://etherscan.io/address/0x82360b9a2076a09ea8abe2b3e11aed89de3a02d1 ) | n/a |n/a |
| Base | n/a | n/a |n/a |
| Sepolia | [0x82360b9a2076a09ea8abe2b3e11aed89de3a02d1](https://sepolia.etherscan.io/address/0x82360b9a2076a09ea8abe2b3e11aed89de3a02d1) | n/a |n/a |
| Network | Portfolio 1.3.0-beta | Portfolio v1.4.0-beta | Portfolio v1.5.0-beta |
| -------- | ----------------------------------------------------------------------------------------------------------------------------- | --------------------- | --------------------------------------------------------------------------------------------------------------------- |
| Ethereum | [0x82360b9a2076a09ea8abe2b3e11aed89de3a02d1](https://etherscan.io/address/0x82360b9a2076a09ea8abe2b3e11aed89de3a02d1 ) | n/a | [0x0000a37Fd680Ab248119b448545eF72C51Bf7530](https://etherscan.io/address/0x0000a37fd680ab248119b448545ef72c51bf7530) |
| Base | n/a | n/a | n/a |
| Sepolia | [0x82360b9a2076a09ea8abe2b3e11aed89de3a02d1](https://sepolia.etherscan.io/address/0x82360b9a2076a09ea8abe2b3e11aed89de3a02d1) | n/a | n/a |

| Network | PortfolioRegistry v1.5.0-beta |
| -------- | --------------------------------------------------------------------------------------------------------------------- |
| Ethereum | [0x42776F58b6BC63492E0b7A7a937D1138DF716670](https://etherscan.io/address/0x42776f58b6bc63492e0b7a7a937d1138df716670) |

| Network | PositionRenderer v1.5.0-beta |
| -------- | --------------------------------------------------------------------------------------------------------------------- |
| Ethereum | [0xdDA01E1d7684Cc35e6a3A5803736D32d012B8C99](https://etherscan.io/address/0xdDA01E1d7684Cc35e6a3A5803736D32d012B8C99) |




# Security

Expand Down
2 changes: 1 addition & 1 deletion lib/nugu
17 changes: 9 additions & 8 deletions scripts/Prepare.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ import "../contracts/PositionRenderer.sol";
// data that was generated and send the transaction.
// 5. Repeat step 4 for all the data generated by this script (3 in total).

address constant MULTISIG_WALLET = 0x8cDb0095ceddb092aD592aCE2971e4f364b5E8eE;
address constant MULTISIG_WALLET = 0xD86872c94484abf03EA8F98ED8E91E9D943781CE;
address constant NUGU_ADDRESS = 0xe50ea0e9849cb17829907Acaf764af8F37d4938E;
address constant WETH_ADDRESS = 0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6;
address constant WETH_ADDRESS = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;

bytes32 constant REGISTRY_SALT = keccak256("REGISTRY0");
bytes32 constant POSITION_RENDERER_SALT = keccak256("POSITION_RENDERER0");
bytes32 constant PORTFOLIO_SALT = keccak256("PORTFOLIO0");
bytes32 constant PORTFOLIO_SALT =
bytes32(0x0EB4AB9B29D4F1CFBCDB500D936BCD61BC941EFDBCD3141738F68F972CC15ED4);

contract Deploy is Script {
bytes internal constant PROXY_BYTECODE =
Expand All @@ -56,14 +57,13 @@ contract Deploy is Script {
abi.encodePacked(
type(PortfolioRegistry).creationCode,
abi.encode(MULTISIG_WALLET)
),
0
)
)
);

bytes memory positionRendererDeployData = abi.encodeCall(
NuguFactory.deploy,
(POSITION_RENDERER_SALT, type(PositionRenderer).creationCode, 0)
(POSITION_RENDERER_SALT, type(PositionRenderer).creationCode)
);

address predictedRegistryAddress =
Expand All @@ -83,8 +83,7 @@ contract Deploy is Script {
predictedRegistryAddress,
predictedPositionRendererAddress
)
),
0
)
)
);

Expand All @@ -96,6 +95,8 @@ contract Deploy is Script {

console.log("\nPortfolio deploy data:");
console.logBytes(portfolioDeployData);
console.log("\n Portfolio address:");
console.log(getDeployed(NUGU_ADDRESS, MULTISIG_WALLET, PORTFOLIO_SALT));
}

function getDeployed(
Expand Down

0 comments on commit f9a3e8e

Please sign in to comment.