Skip to content

Commit

Permalink
Merge branch 'develop' into remediations/SMA-568-btpm-v2-audit
Browse files Browse the repository at this point in the history
  • Loading branch information
livingrockrises authored Feb 7, 2024
2 parents 0e54c2a + 2ed359d commit de75c81
Show file tree
Hide file tree
Showing 49 changed files with 322 additions and 8,234 deletions.
14 changes: 5 additions & 9 deletions scripts/1-deploy-token-paymaster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
DEPLOYMENT_SALTS,
encodeParam,
isContract,
delay,
} from "./utils";
import { Deployer, Deployer__factory } from "../typechain-types";

Expand All @@ -15,21 +16,13 @@ const verifyingSigner = process.env.PAYMASTER_SIGNER_ADDRESS_PROD || "";
const DEPLOYER_CONTRACT_ADDRESS =
process.env.DEPLOYER_CONTRACT_ADDRESS_PROD || "";

function delay(ms: number) {
return new Promise<void>((resolve) => {
setTimeout(() => {
resolve();
}, ms);
});
}

async function deployTokenPaymasterContract(
deployerInstance: Deployer,
earlyOwnerAddress: string
): Promise<string | undefined> {
try {
const salt = ethers.utils.keccak256(
ethers.utils.toUtf8Bytes(DEPLOYMENT_SALTS.TOKEN_PAYMASTER)
ethers.utils.toUtf8Bytes(DEPLOYMENT_SALTS.TOKEN_PAYMASTER_V2)
);

const BiconomyTokenPaymaster = await ethers.getContractFactory(
Expand Down Expand Up @@ -107,6 +100,9 @@ async function getPredeployedDeployerContractInstance(): Promise<Deployer> {
async function main() {
const accounts = await ethers.getSigners();
const earlyOwner = await accounts[0].getAddress();
if (earlyOwner === undefined) {
throw new Error("earlyOwner is undefined");
}

const deployerInstance = await getPredeployedDeployerContractInstance();
console.log("=========================================");
Expand Down
123 changes: 0 additions & 123 deletions scripts/2-deploy-oracle-aggregator.ts

This file was deleted.

7 changes: 0 additions & 7 deletions scripts/3-deploy-derived-price-feeds.ts

This file was deleted.

11 changes: 0 additions & 11 deletions scripts/4-set-token-oracles.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
DEPLOYMENT_SALTS,
encodeParam,
isContract,
delay,
} from "./utils";
import { Deployer, Deployer__factory } from "../typechain-types";

Expand All @@ -16,14 +17,6 @@ const feeCollector = process.env.SPONSORSHIP_FEE_COLLECTOR_ADDRESS_PROD || "";
const DEPLOYER_CONTRACT_ADDRESS =
process.env.DEPLOYER_CONTRACT_ADDRESS_PROD || "";

function delay(ms: number) {
return new Promise<void>((resolve) => {
setTimeout(() => {
resolve();
}, ms);
});
}

async function deploySponsorshipPaymasterContract(
deployerInstance: Deployer,
earlyOwnerAddress: string
Expand Down Expand Up @@ -124,6 +117,9 @@ async function getPredeployedDeployerContractInstance(): Promise<Deployer> {
async function main() {
const accounts = await ethers.getSigners();
const earlyOwner = await accounts[0].getAddress();
if (earlyOwner === undefined) {
throw new Error("earlyOwner is undefined");
}

const deployerInstance = await getPredeployedDeployerContractInstance();
console.log("=========================================");
Expand Down
16 changes: 2 additions & 14 deletions scripts/configs/dev/token-config-arbitrum-goerli.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,20 @@
"address": "0x9Ff2A6b0cdc4aB06BBE231327edfE493f130A994",
"nativeOracleAddress": "0x62CAe0FA2da220f43a51F86Db2EDb36DcA9A5A08",
"tokenOracleAddress": "0x1692Bdd32F31b831caAc1b0c9fAF68613682813b",
"description": "USDC / ETH",
"priceFeedFunction": "getThePrice()",
"priceFeedAddress": "0x000005ABaE3DEAdbe1FBD12105F950efbA9eaec4",
"feedSalt": "DEVX_PRICE_FEED_USDC_V0_27062023_uiaqdyv",
"derivedFeed": true
},
{
"symbol": "USDT",
"address": "0x466cd6F70015e11dc53e5757B4bcFeCcD7C31139",
"nativeOracleAddress": "0x62CAe0FA2da220f43a51F86Db2EDb36DcA9A5A08",
"tokenOracleAddress": "0x0a023a3423D9b27A0BE48c768CCF2dD7877fEf5E",
"description": "USDT / ETH",
"priceFeedFunction": "getThePrice()",
"priceFeedAddress": "0x000001E2C2B39542c30A3fE57c4487030bC03adF",
"feedSalt": "DEVX_PRICE_FEED_USDT_V0_27062023_dIos1Nw",
"derivedFeed": true
},
{
"symbol": "LINK",
"address": "0x6bDB7FE59ec323b6A9bC96a988a971EEDA3958d9",
"nativeOracleAddress": "",
"tokenOracleAddress": "",
"description": "LINK / ETH",
"priceFeedFunction": "latestAnswer()",
"priceFeedAddress": "0x1AdDb2368414B3b4cF1BCe7A887d2De7Bfb6886f",
"feedSalt": "DEVX_PRICE_FEED_LINK_V0_27062023_JHIxs6o",
"nativeOracleAddress": "0x62CAe0FA2da220f43a51F86Db2EDb36DcA9A5A08",
"tokenOracleAddress": "0x1AdDb2368414B3b4cF1BCe7A887d2De7Bfb6886f",
"derivedFeed": false
}
]
Expand Down
56 changes: 12 additions & 44 deletions scripts/configs/dev/token-config-bnb-mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,89 +3,57 @@
{
"symbol": "USDC",
"address": "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",
"nativeOracleAddress": "",
"tokenOracleAddress": "",
"description": "USDC / BNB",
"priceFeedFunction": "latestAnswer()",
"priceFeedAddress": "0x45f86CA2A8BC9EBD757225B19a1A0D7051bE46Db",
"feedSalt": "DEVX_PRICE_FEED_USDC_V0_27062023_uiaqdyv",
"nativeOracleAddress": "0x0567F2323251f0Aab15c8dFb1967E4e8A7D42aeE",
"tokenOracleAddress": "0x45f86CA2A8BC9EBD757225B19a1A0D7051bE46Db",
"derivedFeed": false
},
{
"symbol": "USDT",
"address": "0x55d398326f99059fF775485246999027B3197955",
"nativeOracleAddress": "",
"tokenOracleAddress": "",
"description": "USDT / BNB",
"priceFeedFunction": "latestAnswer()",
"priceFeedAddress": "0xD5c40f5144848Bd4EF08a9605d860e727b991513",
"feedSalt": "DEVX_PRICE_FEED_USDT_V0_27062023_dIos1Nw",
"nativeOracleAddress": "0x0567F2323251f0Aab15c8dFb1967E4e8A7D42aeE",
"tokenOracleAddress": "0xD5c40f5144848Bd4EF08a9605d860e727b991513",
"derivedFeed": false
},
{
"symbol": "DAI",
"address": "0x1AF3F329e8BE154074D8769D1FFa4eE058B1DBc3",
"nativeOracleAddress": "",
"tokenOracleAddress": "",
"description": "DAI / BNB",
"priceFeedFunction": "latestAnswer()",
"priceFeedAddress": "0x8EC213E7191488C7873cEC6daC8e97cdbAdb7B35",
"feedSalt": "DEVX_PRICE_FEED_DAI_V0_27062023_1m7JNWQ",
"nativeOracleAddress": "0x0567F2323251f0Aab15c8dFb1967E4e8A7D42aeE",
"tokenOracleAddress": "0x8EC213E7191488C7873cEC6daC8e97cdbAdb7B35",
"derivedFeed": false
},
{
"symbol": "TWT",
"address": "0x4b0f1812e5df2a09796481ff14017e6005508003",
"nativeOracleAddress": "",
"tokenOracleAddress": "",
"description": "TWT / BNB",
"priceFeedFunction": "latestAnswer()",
"priceFeedAddress": "0x7E728dFA6bCa9023d9aBeE759fDF56BEAb8aC7aD",
"feedSalt": "DEVX_PRICE_FEED_TWT_V0_27062023_92Xklvq",
"nativeOracleAddress": "0x0567F2323251f0Aab15c8dFb1967E4e8A7D42aeE",
"tokenOracleAddress": "0x7E728dFA6bCa9023d9aBeE759fDF56BEAb8aC7aDx",
"derivedFeed": false
},
{
"symbol": "CAKE",
"address": "0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82",
"nativeOracleAddress": "",
"tokenOracleAddress": "",
"description": "CAKE / BNB",
"priceFeedFunction": "latestAnswer()",
"priceFeedAddress": "0xcB23da9EA243f53194CBc2380A6d4d9bC046161f",
"feedSalt": "DEVX_PRICE_FEED_CAKE_V0_27062023_1BKpzde",
"nativeOracleAddress": "0x0567F2323251f0Aab15c8dFb1967E4e8A7D42aeE",
"tokenOracleAddress": "0xcB23da9EA243f53194CBc2380A6d4d9bC046161f",
"derivedFeed": false
},
{
"symbol": "LINK",
"address": "0xF8A0BF9cF54Bb92F17374d9e9A321E6a111a51bD",
"nativeOracleAddress": "",
"tokenOracleAddress": "",
"description": "LINK / BNB",
"priceFeedFunction": "latestAnswer()",
"priceFeedAddress": "0xB38722F6A608646a538E882Ee9972D15c86Fc597",
"feedSalt": "DEVX_PRICE_FEED_LINK_V0_27062023_JHIxs6o",
"nativeOracleAddress": "0x0567F2323251f0Aab15c8dFb1967E4e8A7D42aeE",
"tokenOracleAddress": "0xB38722F6A608646a538E882Ee9972D15c86Fc597",
"derivedFeed": false
},
{
"symbol": "1INCH",
"address": "0x111111111117dC0aa78b770fA6A738034120C302",
"nativeOracleAddress": "0x0567F2323251f0Aab15c8dFb1967E4e8A7D42aeE",
"tokenOracleAddress": "0x1B329402Cb1825C6F30A0d92aB9E2862BE47333f",
"description": "1INCH / BNB",
"priceFeedFunction": "getThePrice()",
"priceFeedAddress": "0x00000C451fA0b0a79a36c82820F061683E26714c",
"feedSalt": "DEVX_PRICE_FEED_1INCH_V0_27062023_XhXA3sd",
"derivedFeed": true
},
{
"symbol": "AAVE",
"address": "0xfb6115445Bff7b52FeB98650C87f44907E58f802",
"nativeOracleAddress": "0x0567F2323251f0Aab15c8dFb1967E4e8A7D42aeE",
"tokenOracleAddress": "0xA8357BF572460fC40f4B0aCacbB2a6A61c89f475",
"description": "AAVE / BNB",
"priceFeedFunction": "getThePrice()",
"priceFeedAddress": "0x0000AF22A276F86B405835c18863e1C2A679D9e3",
"feedSalt": "DEVX_PRICE_FEED_AAVE_V0_28062023_HsugnpY",
"derivedFeed": true
}
]
Expand Down
Loading

0 comments on commit de75c81

Please sign in to comment.