Skip to content

Commit

Permalink
Merge pull request #538 from nevermined-io/deployment/optimism
Browse files Browse the repository at this point in the history
Deployment of v3.5.6 on new networks
  • Loading branch information
aaitor authored Mar 11, 2024
2 parents 80b0c8f + 3b3e645 commit a1c45dc
Show file tree
Hide file tree
Showing 13 changed files with 10,464 additions and 37 deletions.
2,085 changes: 2,085 additions & 0 deletions .openzeppelin/optimism.json

Large diffs are not rendered by default.

2,085 changes: 2,085 additions & 0 deletions .openzeppelin/unknown-10.json

Large diffs are not rendered by default.

2,085 changes: 2,085 additions & 0 deletions .openzeppelin/unknown-10.json.public

Large diffs are not rendered by default.

2,085 changes: 2,085 additions & 0 deletions .openzeppelin/unknown-8453.json

Large diffs are not rendered by default.

2,085 changes: 2,085 additions & 0 deletions .openzeppelin/unknown-8453.json.public

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions contracts/token/erc1155/NFT1155SubscriptionUpgradeable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ contract NFT1155SubscriptionUpgradeable is NFT1155Upgradeable {
function burn(address to, uint256 id, uint256 amount) override public {
burn(to, id, amount, 0);
}

function burn(address to, uint256 id, uint256 amount, uint256 seed) override public {

// solhint-disable-next-line
function burn(address to, uint256 id, uint256 amount, uint256 _seed) override public {
require(balanceOf(to, id) >= amount, 'ERC1155: burn amount exceeds balance');
require(
isOperator(_msgSender()) || // Or the DIDRegistry is burning the NFT
Expand All @@ -75,9 +76,9 @@ contract NFT1155SubscriptionUpgradeable is NFT1155Upgradeable {
// Update nftSupply
_nftAttributes[id].nftSupply -= amount;
// Register provenance event
nftRegistry.used(
keccak256(abi.encode(id, _msgSender(), 'burn', amount, block.number, seed, _nftAttributes[id].nftSupply)),
bytes32(id), _msgSender(), keccak256('burn'), '', 'burn');
// nftRegistry.used(
// keccak256(abi.encode(id, _msgSender(), 'burn', amount, block.number, seed, _nftAttributes[id].nftSupply)),
// bytes32(id), _msgSender(), keccak256('burn'), '', 'burn');

bytes32 _key = _getTokenKey(to, id);

Expand Down
37 changes: 17 additions & 20 deletions hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ module.exports = {
gasReporter: {
enabled: !!(process.env.REPORT_GAS),
showTimeSpent: true,
currency: 'EUR'
currency: 'USD'
},
docgen: {
outputDir: 'docs/generated/'
Expand Down Expand Up @@ -158,23 +158,6 @@ module.exports = {
deploymentPollingInterval: 8000,
from: '0xB6d47415AfCDD06c5155d0E191530027FD51CCfD'
},
goerli: {
url: url || `https://goerli.infura.io/v3/${process.env.INFURA_TOKEN}`,
accounts,
chainId: 0x5, // 5
skipDryRun: true,
from: '0x73943d14131268F23b721E668911bCDDEcA9da62'
},
'arbitrum-goerli': {
// url: url || `https://arbitrum-goerli.infura.io/v3/${process.env.INFURA_TOKEN}`,
url: 'https://goerli-rollup.arbitrum.io/rpc',
accounts,
chainId: 421613,
// skipDryRun: true,
from: '0x73943d14131268F23b721E668911bCDDEcA9da62',
gasPrice: 1200000000

},
'arbitrum-sepolia': {
url: url || 'https://sepolia-rollup.arbitrum.io/rpc',
accounts,
Expand All @@ -198,6 +181,20 @@ module.exports = {
// skipDryRun: true,
from: '0x73943d14131268F23b721E668911bCDDEcA9da62'
},
optimism: {
url: url || `https://optimism-mainnet.infura.io/v3/${process.env.INFURA_TOKEN}`,
accounts,
chainId: 10,
skipDryRun: true
// from: '0x73943d14131268F23b721E668911bCDDEcA9da62'
},
base: {
url: url || 'https://mainnet.base.org',
accounts,
chainId: 8453,
skipDryRun: true
// from: '0x73943d14131268F23b721E668911bCDDEcA9da62'
},
'arbitrum-one': {
url: url || `https://arbitrum-mainnet.infura.io/v3/${process.env.INFURA_TOKEN}`,
accounts,
Expand Down Expand Up @@ -272,11 +269,11 @@ module.exports = {
},
etherscan: {
apiKey: {
goerli: process.env.ETHERSCAN_TOKEN,
mainnet: process.env.ETHERSCAN_TOKEN,
polygonMumbai: process.env.POLYGONSCAN_TOKEN,
polygon: process.env.POLYGONSCAN_TOKEN,
arbitrumGoerli: process.env.ARBISCAN_TOKEN,
optimism: process.env.ETHERSCAN_TOKEN,
base: process.env.BASESCAN_TOKEN,
arbitrumSepolia: process.env.ARBISCAN_TOKEN,
arbitrumOne: process.env.ARBISCAN_TOKEN,
chiado: process.env.GNOSIS_TOKEN,
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nevermined-io/contracts",
"version": "3.5.6",
"version": "3.5.7",
"description": "Nevermined implementation of Nevermined in Solidity",
"bugs": {
"url": "https://github.com/nevermined-io/contracts/issues"
Expand All @@ -18,15 +18,15 @@
"audit:rinkeby": "export NETWORK=rinkeby&&yarn run audit --network rinkeby",
"audit:alfajores": "export NETWORK=celo-alfajores&&yarn run audit --network celo-alfajores",
"audit:baklava": "export NETWORK=celo-baklava&&yarn run audit --network celo-baklava",
"audit:goerli": "export NETWORK=goerli&&yarn run audit --network goerli",
"audit:arbitrum-goerli": "export NETWORK=arbitrum-goerli&&yarn run audit --network arbitrum-goerli",
"audit:arbitrum-sepolia": "export NETWORK=arbitrum-sepolia&&yarn run audit --network arbitrum-sepolia",
"audit:mainnet": "export NETWORK=mainnet&&yarn run audit --network mainnet",
"audit:mumbai": "export NETWORK=mumbai&&yarn run audit --network mumbai",
"audit:matic": "export NETWORK=matic&&yarn run audit --network matic",
"audit:chiado": "export NETWORK=chiado &&yarn run audit --network chiado",
"audit:gnosis": "export NETWORK=gnosis &&yarn run audit --network gnosis",
"audit:arbitrum-one": "export NETWORK=arbitrum-one&&yarn run audit --network arbitrum-one",
"audit:optimism": "export NETWORK=optimism&&yarn run audit --network optimism",
"audit:base": "export NETWORK=base&&yarn run audit --network base",
"deploy": "npx hardhat run ./scripts/deploy/deployContractsWrapper.js",
"deploy:development": "export NETWORK=development&&export TESTNET=true&&yarn deploy --network development",
"deploy:external": "export NETWORK=development&&export TESTNET=true&&yarn deploy --network external",
Expand All @@ -39,11 +39,11 @@
"deploy:celo-alfajores": "export NETWORK=celo-alfajores&&export TESTNET=true&&yarn deploy --network celo-alfajores",
"deploy:celo-baklava": "export NETWORK=celo-baklava&&export TESTNET=true&&yarn deploy --network celo-baklava",
"deploy:celo-mainnet": "export NETWORK=celo&&export TESTNET=false&&yarn deploy --network celo",
"deploy:goerli": "export NETWORK=goerli&&export TESTNET=true&&yarn deploy --network goerli",
"deploy:arbitrum-goerli": "export NETWORK=arbitrum-goerli&&export TESTNET=true&&yarn deploy --network arbitrum-goerli",
"deploy:arbitrum-sepolia": "export NETWORK=arbitrum-sepolia&&export TESTNET=true&&yarn deploy --network arbitrum-sepolia",
"deploy:mainnet": "export NETWORK=mainnet&&yarn deploy --network mainnet",
"deploy:arbitrum-one": "export NETWORK=arbitrum-one&&export TESTNET=false&&yarn deploy --network arbitrum-one",
"deploy:optimism": "export NETWORK=optimism && export TESTNET=false&&yarn deploy --network optimism",
"deploy:base": "export NETWORK=base&&export TESTNET=false&&yarn deploy --network base",
"deploy:neon-devnet": "export NETWORK=neon-devnet&&export TESTNET=true&&yarn deploy --network neon-devnet",
"deploy:neon-mainnet": "export NETWORK=neon-mainnet&&export TESTNET=false&&yarn deploy --network neon-mainnet",
"deploy:mumbai": "export NETWORK=mumbai&&export TESTNET=true&&yarn deploy --network mumbai",
Expand All @@ -61,15 +61,15 @@
"upgrade:rinkeby": "export NETWORK=rinkeby&&yarn run upgrade --network rinkeby --testnet true",
"upgrade:celo-alfajores": "export NETWORK=celo-alfajores&&yarn run upgrade --network celo-alfajores --testnet true",
"upgrade:baklava": "export NETWORK=celo-baklava&&yarn run upgrade --network celo-baklava --testnet true",
"upgrade:goerli": "export NETWORK=goerli&&yarn run upgrade --network goerli --testnet true",
"upgrade:mainnet": "export NETWORK=mainnet&&yarn run upgrade --network mainnet",
"upgrade:arbitrum-goerli": "export NETWORK=arbitrum-goerli && export TESTNET=true && yarn run upgrade --network arbitrum-goerli ",
"upgrade:arbitrum-sepolia": "export NETWORK=arbitrum-sepolia && export TESTNET=true && yarn run upgrade --network arbitrum-sepolia ",
"upgrade:mumbai": "export NETWORK=mumbai && export TESTNET=true &&yarn run upgrade --network mumbai ",
"upgrade:matic": "export NETWORK=matic&&yarn run upgrade --network matic",
"upgrade:chiado": "export NETWORK=chiado && export TESTNET=true &&yarn run upgrade --network chiado ",
"upgrade:gnosis": "export NETWORK=gnosis&&yarn run upgrade --network gnosis",
"upgrade:arbitrum-one": "export NETWORK=arbitrum-one&&yarn run upgrade --network arbitrum-one",
"upgrade:optimism": "export NETWORK=optimism&&yarn run upgrade --network optimism",
"upgrade:base": "export NETWORK=base&&yarn run upgrade --network base",
"upgrade:celo-mainnet": "export NETWORK=celo&&yarn run upgrade --network celo",
"test": "hardhat test",
"test:unit": "hardhat test $(find test/unit -name '*.*s')",
Expand Down
2 changes: 2 additions & 0 deletions scripts/contracts/verify-contracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ const defaultToVerify = require('../deploy/contracts-verify.json')
// Map of network names which are different in hardhat
const networksMap = {}
networksMap['arbitrum-one'] = 'arbitrum-one'
networksMap.optimism = 'optimism'
networksMap.base = 'base'
networksMap.gnosis = 'gnosis'

/**
Expand Down
1 change: 1 addition & 0 deletions scripts/deploy/wallets.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const fs = require('fs')

async function loadWallet({ makeWallet }) {
const accounts = await web3.eth.getAccounts()

console.log('Account', accounts)

while (accounts.length < 10) {
Expand Down
4 changes: 2 additions & 2 deletions scripts/download_artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ declare -A NETWORKS_MAP
NETWORKS_MAP=(
["mainnet"]="1"
["rinkeby"]="4"
["goerli"]="5"
["optimism"]="10"
["gnosis"]="100"
["matic"]="137"
["base"]="8453"
["chiado"]="10200"
["arbitrum-one"]="42161"
["celo-alfajores"]="44787"
["hyperspace"]="3141"
["celo"]="42220"
["mumbai"]="80001"
["arbitrum-goerli"]="421613"
["arbitrum-sepolia"]="421614"
["aurora"]="1313161554"
["aurora-testnet"]="1313161555"
Expand Down
4 changes: 2 additions & 2 deletions scripts/upload_artifacts_gs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ declare -A NETWORKS_MAP
NETWORKS_MAP=(
["mainnet"]="1"
["rinkeby"]="4"
["goerli"]="5"
["optimism"]="10"
["gnosis"]="100"
["matic"]="137"
["base"]="8453"
["chiado"]="10200"
["arbitrum-one"]="42161"
["celo-alfajores"]="44787"
["hyperspace"]="3141"
["celo"]="42220"
["mumbai"]="80001"
["arbitrum-goerli"]="421613"
["arbitrum-sepolia"]="421614"
["neon-devnet"]="245022926"
["neon-mainnet"]="245022934"
Expand Down
3 changes: 2 additions & 1 deletion scripts/upload_artifacts_s3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ declare -A NETWORKS_MAP
NETWORKS_MAP=(
["mainnet"]="1"
["rinkeby"]="4"
["goerli"]="5"
["optimism"]="10"
["gnosis"]="100"
["matic"]="137"
["base"]="8453"
["chiado"]="10200"
["arbitrum-one"]="42161"
["celo-alfajores"]="44787"
Expand Down

0 comments on commit a1c45dc

Please sign in to comment.