Skip to content

Commit

Permalink
Merge pull request #48 from OriumNetwork/feature--ON-843
Browse files Browse the repository at this point in the history
ON-843: Deploy Nft Rental Marketplace Moonbeam
  • Loading branch information
karacurt authored Apr 30, 2024
2 parents 9d30bd1 + 004c079 commit 1f4c768
Show file tree
Hide file tree
Showing 23 changed files with 1,068 additions and 763 deletions.
579 changes: 579 additions & 0 deletions .openzeppelin/unknown-1284.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions addresses/cronos/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@
"operator": "0x04c8c6c56dab836f8bd62cb6884371507e706806",
"implementation": "0x17ecC3620cE4062fA5eC4298a6BDc6d5A25d75Fe",
"proxyAdmin": "0x5E053177c73636d4378cfB4D095cFb374eBb3Da6"
},
"ERC7432WrapperForERC4907": {
"address": ""
}
}
3 changes: 3 additions & 0 deletions addresses/cronosTestnet/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@
"operator": "0x04c8c6c56dab836f8bd62cb6884371507e706806",
"implementation": "0xe359D2353D8f2E6Bd574E49F34c987729380EA1C",
"proxyAdmin": "0xC3154ccAC181eb9d71ccd53f29F425BDdD52d983"
},
"ERC7432WrapperForERC4907": {
"address": ""
}
}
4 changes: 2 additions & 2 deletions addresses/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import mumbai from './mumbai/index.json'
import moonbeam from './moonbeam/index.json'
import polygon from './polygon/index.json'
import cronosTestnet from './cronosTestnet/index.json'
import cronos from './cronos/index.json'

const config = {
mumbai,
moonbeam,
polygon,
cronosTestnet,
cronos,
Expand Down
50 changes: 50 additions & 0 deletions addresses/moonbeam/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"Multisig": {
"address": ""
},
"RolesRegistry": {
"address": ""
},
"SftRolesRegistrySingleRole": {
"address": ""
},
"KMSDeployer": {
"address": "0x04c8c6c56dab836f8bd62cb6884371507e706806"
},
"OriumMarketplace": {
"address": "",
"operator": "",
"implementation": "",
"proxyAdmin": ""
},
"ImmutableOwnerCreate2Factory": {
"address": ""
},
"OriumMarketplaceRoyalties": {
"address": "0x1FdB03ee7e0A861D0495075C1459ef87bC4de54c",
"operator": "0x04c8c6c56dab836f8bd62cb6884371507e706806",
"implementation": "0xeE485138ae7b0A50F2342c67675c6D0a3bd1d3ea",
"proxyAdmin": "0xbee720D292d591cc94f522050cc2069070e3a15C"
},
"OriumSftMarketplace": {
"address": "",
"operator": "",
"implementation": "",
"proxyAdmin": "",
"libraries": [
""
]
},
"ERC7432WrapperForERC4907": {
"address": "0xc3154ccac181eb9d71ccd53f29f425bddd52d983"
},
"NftRentalMarketplace": {
"address": "0x201E1636BB21Dfd51F93815BCD008EAe2Fa29bD9",
"operator": "0x04c8c6c56dab836f8bd62cb6884371507e706806",
"implementation": "0x1112949A242A0283c2170b9F28931ccBE8878d18",
"proxyAdmin": "0x668e73cF24361cfE13801681d8885e6632A7Eaa6",
"libraries": {
"LibNftRentalMarketplace": "0x037c0ae89bAE6d86476074CE3ef4F235467B1B79"
}
}
}
35 changes: 0 additions & 35 deletions addresses/mumbai/index.json

This file was deleted.

3 changes: 3 additions & 0 deletions addresses/polygon/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@
"libraries": [
"0x39CdF22FA80A9E7B95Db29efb2936A9561c70601"
]
},
"ERC7432WrapperForERC4907": {
"address": ""
}
}
15 changes: 8 additions & 7 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ const {
ENVIRONMENT,
DEFENDER_TEAM_API_KEY,
DEFENDER_TEAM_API_SECRET_KEY,
MUMBAI_PROVIDER_URL,
MOONBEAM_PROVIDER_URL,
POLYGON_PROVIDER_URL,
DEV_PRIVATE_KEY,
PROD_PRIVATE_KEY,
POLYGONSCAN_API_KEY,
ETHER_SCAN_API_KEY,
CRONOSSCAN_API_KEY,
MOONSCAN_API_KEY,
CRONOS_TESTNET_PROVIDER_URL,
CRONOS_PROVIDER_URL,
} = process.env
Expand All @@ -34,10 +35,10 @@ const BASE_CONFIG = {
etherscan: {
apiKey: {
polygon: POLYGONSCAN_API_KEY,
polygonMumbai: POLYGONSCAN_API_KEY,
goerli: ETHER_SCAN_API_KEY,
cronosTestnet: CRONOSSCAN_API_KEY,
cronos: CRONOSSCAN_API_KEY,
moonbeam: MOONSCAN_API_KEY,
},
customChains: [
{
Expand Down Expand Up @@ -91,11 +92,6 @@ const PROD_CONFIG = {
blockNumber: 55899875,
},
},
mumbai: {
chainId: 80001,
url: MUMBAI_PROVIDER_URL,
accounts: [DEV_PRIVATE_KEY],
},
polygon: {
chainId: 137,
url: POLYGON_PROVIDER_URL,
Expand All @@ -112,6 +108,11 @@ const PROD_CONFIG = {
url: CRONOS_PROVIDER_URL,
accounts: [PROD_PRIVATE_KEY],
},
moonbeam: {
chainId: 1284,
url: MOONBEAM_PROVIDER_URL,
accounts: [DEV_PRIVATE_KEY],
},
},
defender: {
apiKey: DEFENDER_TEAM_API_KEY,
Expand Down
72 changes: 72 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
"lint:staged": "npx lint-staged",
"lint:fix": "npx eslint . --fix && npx prettier --write .",
"contract-size": "npx hardhat size-contracts",
"deploy:mumbai": "npx hardhat run --network mumbai scripts/01-deploy.ts",
"deploy:polygon": "npx hardhat run --network polygon scripts/01-deploy.ts",
"deploy:nft-rental-marketplace:polygon": "npx hardhat run --network polygon scripts/nft-rental-marketplace/01-deploy.ts",
"deploy:nft-rental-marketplace:moonbeam": "npx hardhat run --network moonbeam scripts/nft-rental-marketplace/01-deploy.ts",
"deploy:orium-marketplace-royalties:polygon": "npx hardhat run --network polygon scripts/orium-marketplace-royalties/01-deploy.ts",
"deploy:orium-marketplace-royalties:moonbeam": "npx hardhat run --network moonbeam scripts/orium-marketplace-royalties/01-deploy.ts",
"create-offer:orium-sft-marketplace:polygon": "npx hardhat run scripts/orium-sft-marketplace/02-create-offer.ts --network polygon",
"cancel-offer:orium-sft-marketplace:polygon": "npx hardhat run scripts/orium-sft-marketplace/03-cancel-offer.ts --network polygon",
"propose-upgrade:orium-sft-marketplace:polygon": "npx hardhat run scripts/orium-sft-marketplace/06-propose-upgrade.ts --network polygon"
Expand All @@ -30,6 +32,7 @@
"@openzeppelin/contracts": "^4.8.0-rc.1",
"@openzeppelin/contracts-upgradeable": "^4.8.0-rc.1",
"@openzeppelin/hardhat-upgrades": "^3.0.5",
"@peculiar/asn1-ecc": "^2.3.8",
"defender-admin-client": "^1.37.0",
"dotenv": "^16.0.3",
"hardhat": "^2.22.2",
Expand Down
23 changes: 23 additions & 0 deletions scripts/nft-rental-marketplace/01-deploy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { network } from 'hardhat'
import { print, colors } from '../../utils/misc'
import addresses, { Network } from '../../addresses'
import { deployUpgradeableContract } from '../../utils/deploy-upgradeable'

const NETWORK = network.name as Network
const PROXY_CONTRACT_NAME = 'NftRentalMarketplace'
const OPERATOR_ADDRESS = addresses[NETWORK].KMSDeployer.address
const INITIALIZER_ARGUMENTS: string[] = [OPERATOR_ADDRESS, addresses[NETWORK].OriumMarketplaceRoyalties.address]
const LIBRARIES_CONTRACT_NAME = ['LibNftRentalMarketplace']

async function main() {
await deployUpgradeableContract(PROXY_CONTRACT_NAME, OPERATOR_ADDRESS, INITIALIZER_ARGUMENTS, LIBRARIES_CONTRACT_NAME)
}

main()
.then(async () => {
print(colors.bigSuccess, 'All done!')
})
.catch(error => {
console.error(error)
process.exitCode = 1
})
Loading

0 comments on commit 1f4c768

Please sign in to comment.