Skip to content

Commit

Permalink
Add erc20 minter and protocol-rewards to protocol-deployments (#356)
Browse files Browse the repository at this point in the history
<!--- Provide a general summary of your changes in the Title above -->

## Description

<!--- Describe your changes in detail -->

## Motivation and Context

<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->

## Does this change the ABI/API?

- [ ] This changes the ABI/API

<!-- If so, please describe how and what potential impact this may have -->

## What tests did you add/modify to account for these changes

<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, tests ran to see how -->
<!--- your change affects other areas of the code, etc. -->

## Types of changes

<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New module / feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

## Checklist:

<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->

- [ ] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] i added a changeset to account for this change

## Reviewer Checklist:

- [ ] My review includes a symposis of the changes and potential issues
- [ ] The code style is enforced
- [ ] There are no risky / concerning changes / additions to the PR
  • Loading branch information
oveddan authored Apr 16, 2024
1 parent d37321b commit 5e6a4b0
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/thick-lemons-work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@zoralabs/protocol-deployments": patch
---

Added Protocol Rewards and ERC20 Minter abis and addresses to protocol-deployments
1 change: 1 addition & 0 deletions packages/1155-deployments/addresses/7777777.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"PREMINTER_PROXY": "0x7777773606e7e46C8Ba8B98C08f5cD218e31d340",
"REDEEM_MINTER_FACTORY": "0x78964965cF77850224513a367f899435C5B69174",
"UPGRADE_GATE": "0xbC50029836A59A4E5e1Bb8988272F46ebA0F9900",
"ERC20_MINTER": "0x777777E8850d8D6d98De2B5f64fae401F96eFF31",
"timestamp": 1712349677
}
1 change: 1 addition & 0 deletions packages/1155-deployments/addresses/999999999.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"PREMINTER_PROXY": "0x7777773606e7e46C8Ba8B98C08f5cD218e31d340",
"REDEEM_MINTER_FACTORY": "0x25cFb6dd9cDE8425e781d6718a29Ccbca3F038d6",
"UPGRADE_GATE": "0x0000000000000000000000000000000000000000",
"ERC20_MINTER": "0x777777E8850d8D6d98De2B5f64fae401F96eFF31",
"timestamp": 1712339316
}
23 changes: 21 additions & 2 deletions packages/protocol-deployments/wagmi.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from "@wagmi/cli";
import { Abi } from "viem";
import { Abi, zeroAddress } from "viem";
import { readdirSync, readFileSync } from "fs";
import * as abis from "@zoralabs/zora-1155-contracts";
import {
Expand Down Expand Up @@ -36,7 +36,7 @@ const get1155Addresses = () => {
address?: Address;
abi: Abi;
}) => {
if (!address) return;
if (!address || address === zeroAddress) return;
if (!addresses[contractName]) {
addresses[contractName] = {
address: {},
Expand All @@ -47,6 +47,12 @@ const get1155Addresses = () => {
addresses[contractName]!.address[chainId] = address;
};

const protocolRewardsConfig = JSON.parse(
readFileSync("../protocol-rewards/deterministicConfig.json", "utf-8"),
) as {
expectedAddress: Address;
};

for (const addressesFile of addressesFiles) {
const jsonAddress = JSON.parse(
readFileSync(`../1155-deployments/addresses/${addressesFile}`, "utf-8"),
Expand All @@ -58,6 +64,7 @@ const get1155Addresses = () => {
FACTORY_IMPL: Address;
FACTORY_PROXY: Address;
PREMINTER_PROXY?: Address;
ERC20_MINTER?: Address;
};

const chainId = parseInt(addressesFile.split(".")[0]);
Expand Down Expand Up @@ -92,6 +99,18 @@ const get1155Addresses = () => {
address: jsonAddress.PREMINTER_PROXY,
abi: abis.zoraCreator1155PremintExecutorImplABI,
});
addAddress({
contractName: "ProtocolRewards",
chainId,
address: protocolRewardsConfig.expectedAddress,
abi: abis.protocolRewardsABI,
});
addAddress({
contractName: "ERC20Minter",
chainId,
abi: abis.erc20MinterABI,
address: jsonAddress.ERC20_MINTER,
});
}

return addresses;
Expand Down

0 comments on commit 5e6a4b0

Please sign in to comment.