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

chore: refactor script namings and readme #32

Merged
merged 29 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
1281c6f
chore: refactor script namings and readme
kupermind Oct 21, 2024
c534fc0
feat: contribute contracts stack
kupermind Oct 22, 2024
f0620e7
chore: name fix
kupermind Oct 22, 2024
badceb8
chore: removing unnecessary event
kupermind Oct 22, 2024
aa04650
feat: getting close to creating a service
kupermind Oct 22, 2024
6199f79
refactor: first implementation
kupermind Oct 22, 2024
8b52f29
chore: cleanup
kupermind Oct 22, 2024
b5b734c
refactor: polishing
kupermind Oct 22, 2024
0b24408
refactor: polishing
kupermind Oct 22, 2024
a43e44f
refactor: staking verifier
kupermind Oct 23, 2024
edf4380
refactor: service owner dependency first
kupermind Oct 23, 2024
585003f
chore: spacing
kupermind Oct 23, 2024
528f7c1
chore: adding deployment scripts
kupermind Oct 23, 2024
aaa2039
doc: v.1.4.0-internal-audit
Oct 23, 2024
63eedea
doc: v.1.4.0-internal-audit
Oct 23, 2024
bc9a4e9
refactor: NFT fix
kupermind Oct 23, 2024
3918217
chore: set initial contribute agent statuses
kupermind Oct 23, 2024
fda1740
Merge remote-tracking branch 'origin/v.1.4.0-internal-audit' into scr…
kupermind Oct 23, 2024
e5eb2de
addressing audit remarks and adding graphics
kupermind Oct 23, 2024
4dca0fd
chore: adding optimus deployment script for mode
kupermind Oct 23, 2024
80d45c2
test: add more tests
kupermind Oct 23, 2024
4783cd9
chore: missing ABIs
kupermind Oct 23, 2024
b9b5919
chore: adding ABIs
kupermind Oct 23, 2024
4c0c33d
chore: testnet re-deployment
kupermind Oct 23, 2024
b57872f
doc: update contribute flowchart
kupermind Oct 24, 2024
7bd49bb
doc: update contribute flowchart
kupermind Oct 24, 2024
011463c
test: next to full coverage
kupermind Oct 24, 2024
33044d6
Merge pull request #34 from valory-xyz/scripts_tests
DavidMinarsch Oct 24, 2024
e752848
Merge pull request #33 from valory-xyz/contribute
kupermind Oct 24, 2024
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: 5 additions & 3 deletions scripts/deployment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,16 @@ Parameters of the `globals.json` file:
liveness (activity). In other words, it's the minimum number of transactions the service multisig needs to perform in order
to pass the liveness check. To check this `rewardsPerSecond* livenessPeriod/1e18` should approximate the number of txs required per livenessPeriod.
Assuming the number of required tx-s per day is 10, the liveness ratio can be checked by means of [this formula](https://www.wolframalpha.com/input?i=%28115740740740740+*+60+*+60+*+24%29+%2F+10%5E18);
- `mechActivityCheckerAddress`: a mech activity checker contract address that is currently deployed using `agentMechAddress`
and `livenessRatio` values;
- `stakingActivityCheckerAddress`: a basic activity checker contract address that uses only the `livenessRatio` value;
- `singleMechActivityCheckerAddress`: a mech activity checker contract address that uses `agentMechAddress` and `livenessRatio` values;
- `mechActivityCheckerAddress`: a mech activity checker contract address that uses deliveries of `mechMarketplaceAddress` and `livenessRatio` values;
- `requesterActivityCheckerAddress`: a mech activity checker contract address that uses requests of `mechMarketplaceAddress` and `livenessRatio` values;
- `stakingTokenAddress`: a staking token implementation address all the instances are created with when deploying a proxy staking contract;
- `stakingFactoryAddress`: a staking proxy factory that creates each proxy staking contract;
- `stakingParams`: a set of staking contract parameters used to initiate each staking proxy contract. See [here](https://github.com/valory-xyz/autonolas-registries/blob/main/docs/StakingSmartContracts.pdf) for more details.

The script file name identifies the number of deployment steps taken from / to the number in the file name. For example:
- `deploy_01_mech_activity_checker.js` will complete step 1.
- `deploy_01_staking_token_instance.js` will complete step 1.

Export network-related API keys defined in `hardhat.config.js` file that correspond to the required network.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async function main() {
const stakingToken = await ethers.getContractAt("StakingToken", stakingTokenAddress);

// Transaction signing and execution
console.log("21. EOA to deploy StakingTokenInstance via the StakingFactory");
console.log("1. EOA to deploy StakingTokenInstance via the StakingFactory");
console.log("You are signing the following transaction: StakingFactory.connect(EOA).createStakingInstance()");
const gasPrice = ethers.utils.parseUnits(gasPriceInGwei, "gwei");
const initPayload = stakingToken.interface.encodeFunctionData("initialize", [stakingParams,
Expand All @@ -77,7 +77,7 @@ async function main() {
// Contract verification
if (parsedData.contractVerification) {
const execSync = require("child_process").execSync;
execSync("npx hardhat verify --constructor-args scripts/deployment/verify_02_staking_token_instance.js --network " + providerName + " " + stakingTokenInstanceAddress, { encoding: "utf-8" });
execSync("npx hardhat verify --constructor-args scripts/deployment/verify_01_staking_token_instance.js --network " + providerName + " " + stakingTokenInstanceAddress, { encoding: "utf-8" });
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async function main() {
const stakingNativeToken = await ethers.getContractAt("StakingNativeToken", stakingNativeTokenAddress);

// Transaction signing and execution
console.log("22. EOA to deploy StakingNativeTokenInstance via the StakingFactory");
console.log("2. EOA to deploy StakingNativeTokenInstance via the StakingFactory");
console.log("You are signing the following transaction: StakingFactory.connect(EOA).createStakingInstance()");
const gasPrice = ethers.utils.parseUnits(gasPriceInGwei, "gwei");
const initPayload = stakingNativeToken.interface.encodeFunctionData("initialize", [stakingParams]);
Expand All @@ -73,7 +73,7 @@ async function main() {
// Contract verification
if (parsedData.contractVerification) {
const execSync = require("child_process").execSync;
execSync("npx hardhat verify --constructor-args scripts/deployment/verify_03_staking_native_token_instance.js --network " + providerName + " " + stakingNativeTokenInstanceAddress, { encoding: "utf-8" });
execSync("npx hardhat verify --constructor-args scripts/deployment/verify_02_staking_native_token_instance.js --network " + providerName + " " + stakingNativeTokenInstanceAddress, { encoding: "utf-8" });
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async function main() {
console.log("EOA is:", deployer);

// Transaction signing and execution
console.log("0. EOA to deploy StakingActivityChecker");
console.log("3. EOA to deploy StakingActivityChecker");
const gasPrice = ethers.utils.parseUnits(gasPriceInGwei, "gwei");
const StakingActivityChecker = await ethers.getContractFactory("StakingActivityChecker");
console.log("You are signing the following transaction: StakingActivityChecker.connect(EOA).deploy()");
Expand All @@ -74,7 +74,7 @@ async function main() {
// Contract verification
if (parsedData.contractVerification) {
const execSync = require("child_process").execSync;
execSync("npx hardhat verify --constructor-args scripts/deployment/verify_00_basic_service_staking_activity_checker.js --network " + providerName + " " + stakingActivityChecker.address, { encoding: "utf-8" });
execSync("npx hardhat verify --constructor-args scripts/deployment/verify_03_basic_service_staking_activity_checker.js --network " + providerName + " " + stakingActivityChecker.address, { encoding: "utf-8" });
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ async function main() {
console.log("EOA is:", deployer);

// Transaction signing and execution
console.log("5. EOA to deploy SingleMechActivityChecker");
console.log("4. EOA to deploy SingleMechActivityChecker");
const gasPrice = ethers.utils.parseUnits(gasPriceInGwei, "gwei");
const SingleMechActivityChecker = await ethers.getContractFactory("SingleMechActivityChecker");
console.log("You are signing the following transaction: SingleMechActivityChecker.connect(EOA).deploy()");
Expand All @@ -65,7 +65,7 @@ async function main() {
// Contract verification
if (parsedData.contractVerification) {
const execSync = require("child_process").execSync;
execSync("npx hardhat verify --constructor-args scripts/deployment/verify_05_single_mech_activity_checker.js --network " + providerName + " " + singleMechActivityChecker.address, { encoding: "utf-8" });
execSync("npx hardhat verify --constructor-args scripts/deployment/verify_04_single_mech_activity_checker.js --network " + providerName + " " + singleMechActivityChecker.address, { encoding: "utf-8" });
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ async function main() {
console.log("EOA is:", deployer);

// Transaction signing and execution
console.log("1. EOA to deploy MechActivityChecker");
console.log("5. EOA to deploy MechActivityChecker");
const gasPrice = ethers.utils.parseUnits(gasPriceInGwei, "gwei");
const MechActivityChecker = await ethers.getContractFactory("MechActivityChecker");
console.log("You are signing the following transaction: MechActivityChecker.connect(EOA).deploy()");
Expand All @@ -65,7 +65,7 @@ async function main() {
// Contract verification
if (parsedData.contractVerification) {
const execSync = require("child_process").execSync;
execSync("npx hardhat verify --constructor-args scripts/deployment/verify_01_mech_activity_checker.js --network " + providerName + " " + mechActivityChecker.address, { encoding: "utf-8" });
execSync("npx hardhat verify --constructor-args scripts/deployment/verify_05_mech_activity_checker.js --network " + providerName + " " + mechActivityChecker.address, { encoding: "utf-8" });
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ async function main() {
console.log("EOA is:", deployer);

// Transaction signing and execution
console.log("4. EOA to deploy RequesterActivityChecker");
console.log("6. EOA to deploy RequesterActivityChecker");
const gasPrice = ethers.utils.parseUnits(gasPriceInGwei, "gwei");
const RequesterActivityChecker = await ethers.getContractFactory("RequesterActivityChecker");
console.log("You are signing the following transaction: RequesterActivityChecker.connect(EOA).deploy()");
Expand All @@ -65,7 +65,7 @@ async function main() {
// Contract verification
if (parsedData.contractVerification) {
const execSync = require("child_process").execSync;
execSync("npx hardhat verify --constructor-args scripts/deployment/verify_04_requester_activity_checker.js --network " + providerName + " " + requesterActivityChecker.address, { encoding: "utf-8" });
execSync("npx hardhat verify --constructor-args scripts/deployment/verify_06_requester_activity_checker.js --network " + providerName + " " + requesterActivityChecker.address, { encoding: "utf-8" });
}
}

Expand Down
Loading