Skip to content

Commit

Permalink
feat(deps): upgrade deps (#46)
Browse files Browse the repository at this point in the history
- upgrade ethers to v6
- upgrade hardhat tools
- use npm install
  • Loading branch information
thongxuan authored Jul 4, 2024
1 parent 944b760 commit 5dbefa9
Show file tree
Hide file tree
Showing 24 changed files with 8,132 additions and 5,201 deletions.
33 changes: 0 additions & 33 deletions .deploy

This file was deleted.

2 changes: 1 addition & 1 deletion contracts/LemonadePoapV1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ contract LemonadePoapV1 is
address,
address to,
uint256 tokenId
) internal override {
) internal {
if (tokenId == 0 && owner() != to) {
_transferOwnership(to);
}
Expand Down
47 changes: 47 additions & 0 deletions contracts/passport/PriceFeedMock.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

contract PriceFeedMock {
struct RoundData {
uint80 roundId;
int256 answer;
uint256 startedAt;
uint256 updatedAt;
uint80 answeredInRound;
}

mapping(uint80 => RoundData) internal _roundData;
RoundData internal _latestRound;
uint8 internal _decimal;

constructor(uint8 decimal_, RoundData[] memory rounds) {
_decimal = decimal_;

uint256 length = rounds.length;
for (uint256 i = 0; i < length; ) {
RoundData memory data = rounds[i];
_roundData[data.roundId] = data;

unchecked {
++i;
}
}

_latestRound = rounds[length - 1];
}

function decimals() external view returns (uint8) {
return _decimal;
}

function latestRoundData() external view returns (RoundData memory data) {
data = _latestRound;
}

function getRoundData(
uint80 _roundId
) public view returns (RoundData memory data) {
data = _roundData[_roundId];
}
}
2 changes: 1 addition & 1 deletion deploy/arbitrum-goerli/ChainlinkRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ export default deployFunction({
chainlinkToken: '0xd14838A68E8AFBAdE5efb411d5871ea0011AFd28',
chainlinkOracle: '0x0C675daD5ADF0D5CCd360F6ea1fD8b63b6Cf442c',
jobId: '2c5b789247994d4b9b5bbd001525bceb',
fee: ethers.utils.parseEther('0.001'),
fee: ethers.parseEther('0.001'),
url: 'https://wallet.staging.lemonade.social/chainlink?network=arbitrum-goerli',
});
2 changes: 1 addition & 1 deletion deploy/arbitrum-one/ChainlinkRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ export default deployFunction({
chainlinkToken: '0xf97f4df75117a78c1A5a0DBb814Af92458539FB4',
chainlinkOracle: '0x94f73287BC1667F5472485A7bf2Bfadc639436c8',
jobId: '25c43bba26e74a1d98d6c2aa4c970d3a',
fee: ethers.utils.parseEther('0.001'),
fee: ethers.parseEther('0.001'),
url: 'https://wallet.lemonade.social/chainlink?network=arbitrum-one',
});
2 changes: 1 addition & 1 deletion deploy/mumbai/ChainlinkRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ export default deployFunction({
chainlinkToken: '0x326c977e6efc84e512bb9c30f76e30c160ed06fb',
chainlinkOracle: '0x58BdCe3F5f05F51f4B6ceB79aC0d150aed2D5a14',
jobId: '02ec7f2539534de3b94fac17dbfc8d20',
fee: ethers.utils.parseEther('0.001'),
fee: ethers.parseEther('0.001'),
url: 'https://wallet.staging.lemonade.social/chainlink?network=mumbai',
});
2 changes: 1 addition & 1 deletion deploy/opal/LemonadeUniqueCollectionV1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const deployFunction: DeployFunction = async function ({ deployments: { deploy }
args: [COLLECTION_HELPERS, COLLECTION_NAME, COLLECTION_DESCRIPTION, COLLECTION_TOKEN_PREFIX],
from,
log: true,
value: ethers.utils.parseEther('2'),
value: ethers.parseEther('2').toString(),
});
};

Expand Down
2 changes: 1 addition & 1 deletion deploy/polygon/ChainlinkRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ export default deployFunction({
chainlinkToken: '0xb0897686c545045aFc77CF20eC7A532E3120E0F1',
chainlinkOracle: '0x57986329af522966f05315db72Bc834ECb9248B1',
jobId: '1083ed520f674b8eb5972e7ea7df2bdf',
fee: ethers.utils.parseEther('0.001'),
fee: ethers.parseEther('0.001'),
url: 'https://wallet.lemonade.social/chainlink?network=polygon',
});
2 changes: 1 addition & 1 deletion deploy/unique/LemonadeUniqueCollectionV1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const deployFunction: DeployFunction = async function ({ deployments: { deploy }
args: [COLLECTION_HELPERS, COLLECTION_NAME, COLLECTION_DESCRIPTION, COLLECTION_TOKEN_PREFIX],
from,
log: true,
value: ethers.utils.parseEther('2'),
value: ethers.parseEther('2').toString(),
});
};

Expand Down
55 changes: 27 additions & 28 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import '@nomiclabs/hardhat-ethers';
import "@nomiclabs/hardhat-etherscan";
import '@nomiclabs/hardhat-waffle';
import '@nomicfoundation/hardhat-toolbox-viem';
import '@nomicfoundation/hardhat-chai-matchers';
import '@openzeppelin/hardhat-upgrades';
import 'hardhat-deploy';
import { HardhatUserConfig } from 'hardhat/config';
Expand All @@ -10,8 +9,8 @@ dotenv.config();

const accounts =
process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] :
process.env.MNEMONIC ? { mnemonic: process.env.MNEMONIC } :
undefined;
process.env.MNEMONIC ? { mnemonic: process.env.MNEMONIC } :
undefined;

const config: HardhatUserConfig = {
etherscan: {
Expand All @@ -22,32 +21,32 @@ const config: HardhatUserConfig = {
polygonMumbai: process.env.ETHERSCAN_POLYGON_API_KEY || '',
},
},
platform: {
apiKey: process.env.PLATFORM_API_KEY || '',
apiSecret: process.env.PLATFORM_API_SECRET || '',
usePlatformDeploy: false,
},
// platform: {
// apiKey: process.env.PLATFORM_API_KEY || '',
// apiSecret: process.env.PLATFORM_API_SECRET || '',
// usePlatformDeploy: false,
// },
namedAccounts: {
deployer: process.env.PRIVATE_KEY ? {
'default': 0,
'default': 0,
} : {
'default': '0xFB756b44060e426731e54e9F433c43c75ee90d9f',
'aurora': '0x951292004e8a18955Cb1095CB72Ca6B01d68336E',
'arbitrum-nova': '0x951292004e8a18955Cb1095CB72Ca6B01d68336E',
'arbitrum-one': '0x951292004e8a18955Cb1095CB72Ca6B01d68336E',
'astar': '0x951292004e8a18955Cb1095CB72Ca6B01d68336E',
'avalanche': '0x951292004e8a18955Cb1095CB72Ca6B01d68336E',
'base': '0x951292004e8a18955Cb1095CB72Ca6B01d68336E',
'bnb': '0x951292004e8a18955Cb1095CB72Ca6B01d68336E',
'celo': '0x951292004e8a18955Cb1095CB72Ca6B01d68336E',
'development': '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
'ethereum': '0x951292004e8a18955Cb1095CB72Ca6B01d68336E',
'gnosis': '0x951292004e8a18955Cb1095CB72Ca6B01d68336E',
'optimism': '0x951292004e8a18955Cb1095CB72Ca6B01d68336E',
'polygon': '0x951292004e8a18955Cb1095CB72Ca6B01d68336E',
'moonbeam': '0x951292004e8a18955Cb1095CB72Ca6B01d68336E',
'unique': '0x951292004e8a18955Cb1095CB72Ca6B01d68336E',
'zero': '0x951292004e8a18955Cb1095CB72Ca6B01d68336E',
'default': '0xFB756b44060e426731e54e9F433c43c75ee90d9f',
'aurora': '0x951292004e8a18955Cb1095CB72Ca6B01d68336E',
'arbitrum-nova': '0x951292004e8a18955Cb1095CB72Ca6B01d68336E',
'arbitrum-one': '0x951292004e8a18955Cb1095CB72Ca6B01d68336E',
'astar': '0x951292004e8a18955Cb1095CB72Ca6B01d68336E',
'avalanche': '0x951292004e8a18955Cb1095CB72Ca6B01d68336E',
'base': '0x951292004e8a18955Cb1095CB72Ca6B01d68336E',
'bnb': '0x951292004e8a18955Cb1095CB72Ca6B01d68336E',
'celo': '0x951292004e8a18955Cb1095CB72Ca6B01d68336E',
'development': '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
'ethereum': '0x951292004e8a18955Cb1095CB72Ca6B01d68336E',
'gnosis': '0x951292004e8a18955Cb1095CB72Ca6B01d68336E',
'optimism': '0x951292004e8a18955Cb1095CB72Ca6B01d68336E',
'polygon': '0x951292004e8a18955Cb1095CB72Ca6B01d68336E',
'moonbeam': '0x951292004e8a18955Cb1095CB72Ca6B01d68336E',
'unique': '0x951292004e8a18955Cb1095CB72Ca6B01d68336E',
'zero': '0x951292004e8a18955Cb1095CB72Ca6B01d68336E',
},
},
networks: {
Expand Down
Loading

0 comments on commit 5dbefa9

Please sign in to comment.