Skip to content

Commit

Permalink
refactor migration
Browse files Browse the repository at this point in the history
  • Loading branch information
neokry committed Jan 4, 2024
1 parent b69913d commit 7f2be53
Show file tree
Hide file tree
Showing 22 changed files with 1,157 additions and 601 deletions.
108 changes: 13 additions & 95 deletions apps/web/src/constants/addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,105 +53,23 @@ export const PUBLIC_ZORA_NFT_CREATOR = {

export const NULL_ADDRESS = '0x0000000000000000000000000000000000000000' as AddressType

export const L2_DEPLOYMENT_ADDRESSES = {
// ONLY BASE_GOERLI DATA, NOT ALL CHAINS REAL YET, BUT NEED THEM TO WORK
[CHAIN_ID.BASE_GOERLI]: {
MANAGER: '0xaa21afd73e6fd5f69c87a6839d0beedee075e9a3' as AddressType,
MANAGER_IMPL: '0xbf84fb51891656797df77a66857c63e80c1d6036' as AddressType,
AUCTION: '0x8c40618313de873978e1e8d403896f169aff3d9c' as AddressType,
TOKEN: '0x93f9d43a7bd751f8546a54785ae48d049ddd2697' as AddressType,
MEDIA_METADATA_RENDERER: '0x4dc60f832c1d19301e45a66ad1752c6f47ad4c68' as AddressType,
TREASURY: '0xdab522800bd789ddb61e01b52088b6a6d95b50eb' as AddressType,
GOVERNOR: '0xaca9b2ddd5060ff81b1bf5ccaacd5b20429111cd' as AddressType,
MERKLE_RESERVE_MINTER: '0x0300ba2fbc45c4191c475731b0876eeef3271b86' as AddressType,
},
[CHAIN_ID.ETHEREUM]: {
MANAGER: '0xaa21afd73e6fd5f69c87a6839d0beedee075e9a3' as AddressType,
MANAGER_IMPL: '0xbf84fb51891656797df77a66857c63e80c1d6036' as AddressType,
AUCTION: '0x8c40618313de873978e1e8d403896f169aff3d9c' as AddressType,
TOKEN: '0x93f9d43a7bd751f8546a54785ae48d049ddd2697' as AddressType,
MEDIA_METADATA_RENDERER: '0x4dc60f832c1d19301e45a66ad1752c6f47ad4c68' as AddressType,
TREASURY: '0xdab522800bd789ddb61e01b52088b6a6d95b50eb' as AddressType,
GOVERNOR: '0xaca9b2ddd5060ff81b1bf5ccaacd5b20429111cd' as AddressType,
MERKLE_RESERVE_MINTER: '0x0300ba2fbc45c4191c475731b0876eeef3271b86' as AddressType,
},
[CHAIN_ID.OPTIMISM]: {
MANAGER: '0xaa21afd73e6fd5f69c87a6839d0beedee075e9a3' as AddressType,
MANAGER_IMPL: '0xbf84fb51891656797df77a66857c63e80c1d6036' as AddressType,
AUCTION: '0x8c40618313de873978e1e8d403896f169aff3d9c' as AddressType,
TOKEN: '0x93f9d43a7bd751f8546a54785ae48d049ddd2697' as AddressType,
MEDIA_METADATA_RENDERER: '0x4dc60f832c1d19301e45a66ad1752c6f47ad4c68' as AddressType,
TREASURY: '0xdab522800bd789ddb61e01b52088b6a6d95b50eb' as AddressType,
GOVERNOR: '0xaca9b2ddd5060ff81b1bf5ccaacd5b20429111cd' as AddressType,
MERKLE_RESERVE_MINTER: '0x0300ba2fbc45c4191c475731b0876eeef3271b86' as AddressType,
},
[CHAIN_ID.GOERLI]: {
MANAGER: '0xaa21afd73e6fd5f69c87a6839d0beedee075e9a3' as AddressType,
MANAGER_IMPL: '0xbf84fb51891656797df77a66857c63e80c1d6036' as AddressType,
AUCTION: '0x8c40618313de873978e1e8d403896f169aff3d9c' as AddressType,
TOKEN: '0x93f9d43a7bd751f8546a54785ae48d049ddd2697' as AddressType,
MEDIA_METADATA_RENDERER: '0x4dc60f832c1d19301e45a66ad1752c6f47ad4c68' as AddressType,
TREASURY: '0xdab522800bd789ddb61e01b52088b6a6d95b50eb' as AddressType,
GOVERNOR: '0xaca9b2ddd5060ff81b1bf5ccaacd5b20429111cd' as AddressType,
MERKLE_RESERVE_MINTER: '0x0300ba2fbc45c4191c475731b0876eeef3271b86' as AddressType,
},
[CHAIN_ID.OPTIMISM_GOERLI]: {
MANAGER: '0xaa21afd73e6fd5f69c87a6839d0beedee075e9a3' as AddressType,
MANAGER_IMPL: '0xbf84fb51891656797df77a66857c63e80c1d6036' as AddressType,
AUCTION: '0x8c40618313de873978e1e8d403896f169aff3d9c' as AddressType,
TOKEN: '0x93f9d43a7bd751f8546a54785ae48d049ddd2697' as AddressType,
MEDIA_METADATA_RENDERER: '0x4dc60f832c1d19301e45a66ad1752c6f47ad4c68' as AddressType,
TREASURY: '0xdab522800bd789ddb61e01b52088b6a6d95b50eb' as AddressType,
GOVERNOR: '0xaca9b2ddd5060ff81b1bf5ccaacd5b20429111cd' as AddressType,
MERKLE_RESERVE_MINTER: '0x0300ba2fbc45c4191c475731b0876eeef3271b86' as AddressType,
},
[CHAIN_ID.BASE]: {
MANAGER: '0xaa21afd73e6fd5f69c87a6839d0beedee075e9a3' as AddressType,
MANAGER_IMPL: '0xbf84fb51891656797df77a66857c63e80c1d6036' as AddressType,
AUCTION: '0x8c40618313de873978e1e8d403896f169aff3d9c' as AddressType,
TOKEN: '0x93f9d43a7bd751f8546a54785ae48d049ddd2697' as AddressType,
MEDIA_METADATA_RENDERER: '0x4dc60f832c1d19301e45a66ad1752c6f47ad4c68' as AddressType,
TREASURY: '0xdab522800bd789ddb61e01b52088b6a6d95b50eb' as AddressType,
GOVERNOR: '0xaca9b2ddd5060ff81b1bf5ccaacd5b20429111cd' as AddressType,
MERKLE_RESERVE_MINTER: '0x0300ba2fbc45c4191c475731b0876eeef3271b86' as AddressType,
},
[CHAIN_ID.ZORA]: {
MANAGER: '0xaa21afd73e6fd5f69c87a6839d0beedee075e9a3' as AddressType,
MANAGER_IMPL: '0xbf84fb51891656797df77a66857c63e80c1d6036' as AddressType,
AUCTION: '0x8c40618313de873978e1e8d403896f169aff3d9c' as AddressType,
TOKEN: '0x93f9d43a7bd751f8546a54785ae48d049ddd2697' as AddressType,
MEDIA_METADATA_RENDERER: '0x4dc60f832c1d19301e45a66ad1752c6f47ad4c68' as AddressType,
TREASURY: '0xdab522800bd789ddb61e01b52088b6a6d95b50eb' as AddressType,
GOVERNOR: '0xaca9b2ddd5060ff81b1bf5ccaacd5b20429111cd' as AddressType,
MERKLE_RESERVE_MINTER: '0x0300ba2fbc45c4191c475731b0876eeef3271b86' as AddressType,
},
[CHAIN_ID.ZORA_GOERLI]: {
MANAGER: '0xaa21afd73e6fd5f69c87a6839d0beedee075e9a3' as AddressType,
MANAGER_IMPL: '0xbf84fb51891656797df77a66857c63e80c1d6036' as AddressType,
AUCTION: '0x8c40618313de873978e1e8d403896f169aff3d9c' as AddressType,
TOKEN: '0x93f9d43a7bd751f8546a54785ae48d049ddd2697' as AddressType,
MEDIA_METADATA_RENDERER: '0x4dc60f832c1d19301e45a66ad1752c6f47ad4c68' as AddressType,
TREASURY: '0xdab522800bd789ddb61e01b52088b6a6d95b50eb' as AddressType,
GOVERNOR: '0xaca9b2ddd5060ff81b1bf5ccaacd5b20429111cd' as AddressType,
MERKLE_RESERVE_MINTER: '0x0300ba2fbc45c4191c475731b0876eeef3271b86' as AddressType,
},
[CHAIN_ID.FOUNDRY]: {
MANAGER: '0xaa21afd73e6fd5f69c87a6839d0beedee075e9a3' as AddressType,
MANAGER_IMPL: '0xbf84fb51891656797df77a66857c63e80c1d6036' as AddressType,
AUCTION: '0x8c40618313de873978e1e8d403896f169aff3d9c' as AddressType,
TOKEN: '0x93f9d43a7bd751f8546a54785ae48d049ddd2697' as AddressType,
MEDIA_METADATA_RENDERER: '0x4dc60f832c1d19301e45a66ad1752c6f47ad4c68' as AddressType,
TREASURY: '0xdab522800bd789ddb61e01b52088b6a6d95b50eb' as AddressType,
GOVERNOR: '0xaca9b2ddd5060ff81b1bf5ccaacd5b20429111cd' as AddressType,
MERKLE_RESERVE_MINTER: '0x0300ba2fbc45c4191c475731b0876eeef3271b86' as AddressType,
},
}
export const MERKLE_RESERVE_MINTER =
'0xa2d7e55f87f1913d5da10807cf695dc35bc29b12' as AddressType

export const MERKLE_METADATA_RENDERER =
'0xcbe9b735760be192c901896db6e43c7e7bcf4139' as AddressType

export const L2_MIGRATION_DEPLOYER =
'0xed98171590dba48f6596f4743c2b7300a7091f9e' as AddressType

export const L1_MESSENGERS = {
//NEED ALL CHAIN TO WORK
[CHAIN_ID.ETHEREUM]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.GOERLI]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.BASE]: '0x866E82a600A1414e583f7F13623F1aC5d58b0Afa' as AddressType,
[CHAIN_ID.BASE_GOERLI]: '0x8e5693140eA606bcEB98761d9beB1BC87383706D' as AddressType,
[CHAIN_ID.OPTIMISM]: '0xDa2332D0a7608919Cd331B1304Cd179129a90495' as AddressType,
[CHAIN_ID.OPTIMISM_GOERLI]: '0xDa2332D0a7608919Cd331B1304Cd179129a90495' as AddressType,
[CHAIN_ID.ZORA]: '0x363B4B1ADa52E50353f746999bd9E94395190d2C' as AddressType,
[CHAIN_ID.ZORA_GOERLI]: '0x9779A9D2f3B66A4F4d27cB99Ab6cC1266b3Ca9af' as AddressType,
[CHAIN_ID.BASE]: '0x866E82a600A1414e583f7F13623F1aC5d58b0Afa' as AddressType,
[CHAIN_ID.FOUNDRY]: '0x0000000000000000000000000000000000000000' as AddressType,
}
170 changes: 170 additions & 0 deletions apps/web/src/data/contract/abis/Auction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,26 @@ export const auctionAbi = [
name: '_manager',
type: 'address',
},
{
internalType: 'address',
name: '_rewardsManager',
type: 'address',
},
{
internalType: 'address',
name: '_weth',
type: 'address',
},
{
internalType: 'uint16',
name: '_builderRewardsBPS',
type: 'uint16',
},
{
internalType: 'uint16',
name: '_referralRewardsBPS',
type: 'uint16',
},
],
stateMutability: 'payable',
type: 'constructor',
Expand Down Expand Up @@ -50,6 +65,11 @@ export const auctionAbi = [
name: 'AUCTION_SETTLED',
type: 'error',
},
{
inputs: [],
name: 'CANNOT_CREATE_AUCTION',
type: 'error',
},
{
inputs: [],
name: 'DELEGATE_CALL_FAILED',
Expand All @@ -70,6 +90,21 @@ export const auctionAbi = [
name: 'INSOLVENT',
type: 'error',
},
{
inputs: [],
name: 'INVALID_REWARDS_BPS',
type: 'error',
},
{
inputs: [],
name: 'INVALID_REWARDS_RECIPIENT',
type: 'error',
},
{
inputs: [],
name: 'INVALID_REWARD_TOTAL',
type: 'error',
},
{
inputs: [],
name: 'INVALID_TARGET',
Expand Down Expand Up @@ -271,6 +306,31 @@ export const auctionAbi = [
name: 'DurationUpdated',
type: 'event',
},
{
anonymous: false,
inputs: [
{
components: [
{
internalType: 'address',
name: 'recipient',
type: 'address',
},
{
internalType: 'uint16',
name: 'percentBps',
type: 'uint16',
},
],
indexed: false,
internalType: 'struct AuctionTypesV2.FounderReward',
name: 'reward',
type: 'tuple',
},
],
name: 'FounderRewardUpdated',
type: 'event',
},
{
anonymous: false,
inputs: [
Expand Down Expand Up @@ -464,6 +524,19 @@ export const auctionAbi = [
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'builderRewardsBPS',
outputs: [
{
internalType: 'uint16',
name: '',
type: 'uint16',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'cancelOwnershipTransfer',
Expand Down Expand Up @@ -497,6 +570,37 @@ export const auctionAbi = [
stateMutability: 'payable',
type: 'function',
},
{
inputs: [
{
internalType: 'uint256',
name: '_tokenId',
type: 'uint256',
},
{
internalType: 'address',
name: '_referral',
type: 'address',
},
],
name: 'createBidWithReferral',
outputs: [],
stateMutability: 'payable',
type: 'function',
},
{
inputs: [],
name: 'currentBidReferral',
outputs: [
{
internalType: 'address',
name: '',
type: 'address',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'duration',
Expand All @@ -510,6 +614,24 @@ export const auctionAbi = [
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'founderReward',
outputs: [
{
internalType: 'address',
name: 'recipient',
type: 'address',
},
{
internalType: 'uint16',
name: 'percentBps',
type: 'uint16',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{
Expand Down Expand Up @@ -537,6 +659,16 @@ export const auctionAbi = [
name: '_reservePrice',
type: 'uint256',
},
{
internalType: 'address',
name: '_founderRewardRecipient',
type: 'address',
},
{
internalType: 'uint16',
name: '_founderRewardBps',
type: 'uint16',
},
],
name: 'initialize',
outputs: [],
Expand Down Expand Up @@ -615,6 +747,19 @@ export const auctionAbi = [
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'referralRewardsBPS',
outputs: [
{
internalType: 'uint16',
name: '',
type: 'uint16',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'reservePrice',
Expand Down Expand Up @@ -654,6 +799,31 @@ export const auctionAbi = [
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [
{
components: [
{
internalType: 'address',
name: 'recipient',
type: 'address',
},
{
internalType: 'uint16',
name: 'percentBps',
type: 'uint16',
},
],
internalType: 'struct AuctionTypesV2.FounderReward',
name: 'reward',
type: 'tuple',
},
],
name: 'setFounderReward',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [
{
Expand Down
Loading

0 comments on commit 7f2be53

Please sign in to comment.