Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
maceip committed Feb 5, 2024
1 parent 41b7a91 commit ce89eaa
Show file tree
Hide file tree
Showing 25 changed files with 1,163 additions and 1,421 deletions.
44 changes: 44 additions & 0 deletions deploy/002_deploy_deramp_vault.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { ethers } from 'hardhat';

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { deployer, simpleERC20Beneficiary } = await hre.getNamedAccounts();
const asset = await (await hre.ethers.getContract('SimpleERC20', deployer)).getAddress();
console.log('vault asset: ', asset);
const { deploy } = hre.deployments;
const useProxy = !hre.network.live;
const max = ethers.parseEther('1');
const min = ethers.parseEther('.001');
const fee = 0;

// proxy only in non-live network (localhost and hardhat network) enabling HCR (Hot Contract Replacement)
// in live network, proxy is disabled and constructor is invoked
await deploy('DeRampVault', {
from: deployer,
proxy: useProxy && {
owner: deployer,
proxyContract: 'UUPS',

execute: {
init: {
methodName: 'initialize',
args: [asset, 'DeRamp Token', 'RAMP', max, min, fee, simpleERC20Beneficiary],
},

onUpgrade: {
methodName: 'postUpgrade',
args: [asset, 'DeRamp Token', 'RAMP', max, min, fee, simpleERC20Beneficiary],
},
},
},

log: true,
autoMine: true, // speed up deployment on local network (ganache, hardhat), no effect on live networks
});

return !useProxy; // when live network, record the script as executed to prevent rexecution
};
export default func;
func.id = 'deploy_deramp_vault'; // id required to prevent reexecution
func.tags = ['DeRampVault'];
23 changes: 0 additions & 23 deletions deploy/002_deploy_greetings_registry.ts

This file was deleted.

5 changes: 4 additions & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const config: HardhatUserConfig = {
solidity: {
compilers: [
{
version: '0.8.17',
version: '0.8.20',
settings: {
optimizer: {
enabled: true,
Expand All @@ -30,12 +30,15 @@ const config: HardhatUserConfig = {
namedAccounts: {
deployer: 0,
simpleERC20Beneficiary: 1,
onRamper: 2,
offRamper: 3,
},
networks: addForkConfiguration({
hardhat: {
initialBaseFeePerGas: 0, // to fix : https://github.com/sc-forks/solidity-coverage/issues/652, see https://github.com/sc-forks/solidity-coverage/issues/652#issuecomment-896330136
},
localhost: {
autoImpersonate: true,
url: node_url('localhost'),
accounts: accounts(),
},
Expand Down
47 changes: 26 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,30 @@
"version": "0.0.1",
"description": "",
"devDependencies": {
"@nomicfoundation/hardhat-chai-matchers": "^2.0.1",
"@nomicfoundation/hardhat-ethers": "^3.0.2",
"@openzeppelin/contracts": "^4.9.2",
"@typechain/hardhat": "^8.0.0",
"@types/chai": "^4.3.5",
"@types/mocha": "^10.0.1",
"@types/node": "^20.3.1",
"chai": "^4.3.7",
"cross-env": "^7.0.2",
"dotenv": "^16.3.1",
"ethers": "^6.6.1",
"fs-extra": "^11.1.1",
"hardhat": "^2.16.0",
"hardhat-deploy": "^0.11.34",
"hardhat-deploy-ethers": "^0.4.0",
"@nomicfoundation/hardhat-chai-matchers": "^2.0.4",
"@nomicfoundation/hardhat-ethers": "^3.0.5",
"@openzeppelin/contracts": "^5.0.1",
"@typechain/hardhat": "^8.0.3",
"@types/chai": "^4.3.11",
"@types/mocha": "^10.0.6",
"@types/node": "^20.11.16",
"chai": "^4.4.1",
"cross-env": "^7.0.3",
"dotenv": "^16.4.1",
"ethers": "^6.10.0",
"fs-extra": "^11.2.0",
"hardhat": "^2.19.5",
"hardhat-deploy": "^0.11.45",
"hardhat-deploy-ethers": "^0.4.1",
"hardhat-deploy-tenderly": "^0.2.0",
"hardhat-gas-reporter": "^1.0.9",
"hardhat-gas-reporter": "^1.0.10",
"mocha": "^10.2.0",
"prettier": "^2.8.8",
"prettier-plugin-solidity": "^1.1.3",
"solidity-coverage": "^0.8.3",
"ts-node": "^10.9.1",
"typescript": "^5.1.3"
"prettier-plugin-solidity": "^1.3.1",
"solidity-coverage": "^0.8.6",
"solmate": "github:transmissions11/solmate",
"ts-node": "^10.9.2",
"typescript": "^5.3.3"
},
"scripts": {
"prepare": "node ./.setup.js && hardhat typechain",
Expand All @@ -50,5 +51,9 @@
"fork:node": "node ./_scripts.js fork:node",
"fork:test": "node ./_scripts.js fork:test",
"tenderly:push": "node ./_scripts.js tenderly:push"
},
"dependencies": {
"@openzeppelin/contracts-upgradeable": "^5.0.1",
"@zk-email/contracts": "^5.0.2"
}
}
}
Loading

0 comments on commit ce89eaa

Please sign in to comment.