Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: sepolia network contracts #1260

Merged
merged 10 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/currency/src/chains/evm/data/sepolia.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { TokenMap } from '../../../types';
import { supportedSepoliaERC20 } from '../../../erc20/chains/sepolia';

export const chainId = 11155111;
export const testnet = true;
export const currencies: TokenMap = {
...supportedSepoliaERC20,
};
2 changes: 2 additions & 0 deletions packages/currency/src/chains/evm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import * as RoninDefinition from './data/ronin';
import * as SokolDefinition from './data/sokol';
import * as TombchainDefinition from './data/tombchain';
import * as XDaiDefinition from './data/xdai';
import * as SepoliaDefinition from './data/sepolia';
import * as ZkSyncEraTestnetDefinition from './data/zksync-era-testnet';
import * as ZkSyncEraDefinition from './data/zksync-era';

Expand Down Expand Up @@ -57,6 +58,7 @@ export const chains: Record<CurrencyTypes.EvmChainName, EvmChain> = {
sokol: SokolDefinition,
tombchain: TombchainDefinition,
xdai: XDaiDefinition,
sepolia: SepoliaDefinition,
zksynceratestnet: ZkSyncEraTestnetDefinition,
zksyncera: ZkSyncEraDefinition,
};
16 changes: 16 additions & 0 deletions packages/currency/src/erc20/chains/sepolia.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { TokenMap } from '../../types';

// List of the supported goerli ERC20 tokens
export const supportedSepoliaERC20: TokenMap = {
// Faucet Token on goerli network.
'0x370DE27fdb7D1Ff1e1BaA7D11c5820a324Cf623C': {
decimals: 18,
name: 'FaucetToken',
symbol: 'FAU',
},
'0xF046b3CA5ae2879c6bAcC4D42fAF363eE8379F78': {
decimals: 18,
name: 'FakeUSDT',
symbol: 'fUSDT',
},
};
6 changes: 6 additions & 0 deletions packages/currency/src/native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ export const nativeCurrencies: Record<RequestLogicTypes.CURRENCY.ETH, NativeEthC
name: 'Core',
network: 'core',
},
{
symbol: 'ETH-sepolia',
decimals: 18,
name: 'Sepolia Ether',
network: 'sepolia',
},
{
symbol: 'ETH-zksync',
decimals: 18,
Expand Down
21 changes: 21 additions & 0 deletions packages/smart-contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { NUMBER_ERRORS } from './scripts/utils';
import { networkRpcs } from '@requestnetwork/utils';
import { tenderlyImportAll } from './scripts-create2/tenderly';
import { updateContractsFromList } from './scripts-create2/update-contracts-setup';
import deployStorage from './scripts/deploy-storage';

config();

Expand Down Expand Up @@ -86,6 +87,11 @@ export default {
chainId: 5,
accounts,
},
sepolia: {
url: process.env.WEB3_PROVIDER_URL || 'https://sepolia.infura.io/v3/YOUR_API_KEY',
chainId: 11155111,
accounts,
},
matic: {
url: url('matic'),
chainId: 137,
Expand Down Expand Up @@ -189,6 +195,7 @@ export default {
mainnet: process.env.ETHERSCAN_API_KEY,
rinkeby: process.env.ETHERSCAN_API_KEY,
goerli: process.env.ETHERSCAN_API_KEY,
sepolia: process.env.ETHERSCAN_API_KEY,
// binance smart chain
bsc: process.env.BSCSCAN_API_KEY,
bscTestnet: process.env.BSCSCAN_API_KEY,
Expand Down Expand Up @@ -313,6 +320,20 @@ task(
await deployAllPaymentContracts(args, hre as HardhatRuntimeEnvironmentExtended);
});

task(
'deploy-live-storage',
'Deploy payment contracts on a live network. Make sure to update all artifacts before running.',
)
.addFlag('dryRun', 'to prevent any deployment')
.addFlag('force', 'to force re-deployment')
.setAction(async (args, hre) => {
args.force = args.force ?? false;
args.dryRun = args.dryRun ?? false;
args.simulate = args.dryRun;
await hre.run(DEPLOYER_KEY_GUARD);
await deployStorage(args, hre as HardhatRuntimeEnvironmentExtended);
});

// Tasks inherent to the CREATE2 deployment scheme
task(
'deploy-deployer-contract',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const computeCreate2DeploymentAddressesFromList = async (
create2ContractDeploymentList.map(async (contract) => {
let address: string;
switch (contract) {
case 'ChainlinkConversionPath':
case 'EthereumProxy':
case 'EthereumFeeProxy':
case 'EthConversionProxy':
Expand All @@ -61,6 +62,7 @@ export const computeCreate2DeploymentAddressesFromList = async (
case 'Erc20ConversionProxy':
case 'ERC20EscrowToPay':
case 'BatchConversionPayments':
case 'ERC20SwapToPay':
case 'ERC20SwapToConversion':
case 'ERC20TransferableReceivable': {
try {
Expand Down
13 changes: 7 additions & 6 deletions packages/smart-contracts/scripts-create2/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@ import { EvmChains } from '@requestnetwork/currency';
* If you want to skip deploying one or more, then comment them out in the list bellow.
*/
export const create2ContractDeploymentList = [
// 'ChainlinkConversionPath',
'ChainlinkConversionPath',
'EthereumProxy',
'EthereumFeeProxy',
// 'EthConversionProxy',
'EthConversionProxy',
'ERC20Proxy',
'ERC20FeeProxy',
// 'ERC20SwapToPay',
// 'ERC20SwapToConversion',
// 'BatchConversionPayments',
// 'ERC20EscrowToPay',
'Erc20ConversionProxy',
'ERC20SwapToPay',
'ERC20SwapToConversion',
'BatchConversionPayments',
'ERC20EscrowToPay',
// 'ERC20TransferableReceivable',
];

Expand Down
7 changes: 7 additions & 0 deletions packages/smart-contracts/scripts/deploy-storage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import deployRequest from './test-deploy-request-storage';

// Deploys storage contracts
export default async function deployStorage(_args: any, hre: HardhatRuntimeEnvironment) {
await deployRequest(_args, hre);
}
1 change: 1 addition & 0 deletions packages/smart-contracts/scripts/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const uniswapV2RouterAddresses: Record<string, string> = {
ropsten: '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D',
rinkeby: '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D',
goerli: '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D',
sepolia: '0xC532a74256D3Db42D0Bf7a0400fEFDbad7694008',
kovan: '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D',
private: '0x4E72770760c011647D4873f60A3CF6cDeA896CD8',
bsctest: '0x10ED43C718714eb63d5aA57B78B54704E256024E',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ export const batchConversionPaymentsArtifact = new ContractArtifact<BatchConvers
address: '0x3cF63891928B8CeebB81C95426600a18cd59C03f',
creationBlockNumber: 19856206,
},
// Deployment address changed due to an update of the ChainlinkConversionPath contract
sepolia: {
address: '0x67818703c92580c0e106e401F253E8A410A66f8B',
creationBlockNumber: 4733368,
},
// Caution: no ETHConversion, ERC20Conversion, and chainlinkConversionPath proxies on zkSyncEra
zksyncera: {
address: '0x0C41700ee1B363DB2ebC1a985f65cAf6eC4b1023',
Expand Down
Loading