Skip to content

Commit

Permalink
add vault events
Browse files Browse the repository at this point in the history
  • Loading branch information
Namaskar-1F64F committed Feb 20, 2024
1 parent d7fb6d5 commit c87527f
Show file tree
Hide file tree
Showing 15 changed files with 2,340 additions and 2 deletions.
File renamed without changes.
111 changes: 111 additions & 0 deletions src/actions-local/ggpvault.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
import { config } from "dotenv";
import { TestRuntime } from "@tenderly/actions-test";

import { beforeAll, describe, test } from "vitest";

import { depositOrWithdraw, stakingTransactions, stateVariablesUpdated } from "../actions/ggpvault";

config();
/*
export interface XGGPDeposit extends Event {
sender: string;
owner: string;
assets: BigNumber;
shares: BigNumber;
}
export interface XGGPWithdraw extends Event {
sender: string;
receiver: string;
owner: string;
assets: BigNumber;
shares: BigNumber;
}
export interface GGPCapUpdated extends Event {
newMax: BigNumber;
}
export interface TargetAPRUpdated extends Event {
newTargetAPR: BigNumber;
}
export interface WithdrawnForStaking extends Event {
caller: string;
assets: BigNumber;
}
export interface DepositedFromStaking extends Event {
caller: string;
amount: BigNumber;
}
export interface RewardsDistributed extends Event {
amount: BigNumber;
}*/
describe("GGP Vault", () => {
const testRuntime = new TestRuntime();
beforeAll(() => {
/*
--> Shove all of the .env variables into the test runtime.
---> Is there a problem shoving all of them in?
-> I hope not.
*/
for (const [key, value] of Object.entries(process.env)) {
if (value) {
testRuntime.context.secrets.put(key, value);
}
}
});
describe("deposit or withdraw", () => {
test.concurrent("withdraw", async () => {
await testRuntime.execute(
depositOrWithdraw,
require("./payload/payload-ggpvault-redeem.json")
);
});
test.concurrent("deposit", async () => {
await testRuntime.execute(
depositOrWithdraw,
require("./payload/payload-ggpvault-deposit.json")
);
});
});
describe.skip("state variables updated", () => {
test.concurrent("GGP Cap", async () => {
await testRuntime.execute(
stateVariablesUpdated,
require("./payload/payload-ggpvault-ggpcap.json")
);
});
test.concurrent("Target APR", async () => {
await testRuntime.execute(
stateVariablesUpdated,
require("./payload/payload-ggpvault-targetapr.json")
);
});
});
describe("staking", () => {
test.concurrent("withdrawn for staking", async () => {
await testRuntime.execute(
stakingTransactions,
require("./payload/payload-ggpvault-staking-withdraw.json")
);
});
test.concurrent("deposited from staking", async () => {
await testRuntime.execute(
stakingTransactions,
require("./payload/payload-ggpvault-staking-deposit.json")
);
});
});
describe.skip("rewards", () => {
test.concurrent("distributed", async () => {
await testRuntime.execute(
depositOrWithdraw,
require("./payload/payload-ggpvault-rewards.json")
);
});
});
});
File renamed without changes.
47 changes: 47 additions & 0 deletions src/actions-local/payload/payload-ggpvault-deposit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"network": "43114",
"blockHash": "0xdd35896e61e31566fdd39ac8d54726d5ddd66f7906ce1a84ec6313d7df7a0cd2",
"blockNumber": 41815737,
"hash": "0xfb40ba9b9a0f7e00a269eb03fc212f2652d309ee31150bf3bc0312bad881ceec",
"from": "0xcafea1A2c9F4Af0Aaf1d5C4913cb8BA4bf0F9842",
"to": "0xdF34022e8a280fc79499cA560439Bb6f9797EbD8",
"logs": [
{
"address": "0x69260B9483F9871ca57f81A90D91E2F96c2Cd11d",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000cafea1a2c9f4af0aaf1d5c4913cb8ba4bf0f9842",
"0x000000000000000000000000df34022e8a280fc79499ca560439bb6f9797ebd8"
],
"data": "0x0000000000000000000000000000000000000000000000008ac7230489e80000"
},
{
"address": "0xdF34022e8a280fc79499cA560439Bb6f9797EbD8",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x000000000000000000000000cafea1a2c9f4af0aaf1d5c4913cb8ba4bf0f9842"
],
"data": "0x0000000000000000000000000000000000000000000000008ac7230489e80000"
},
{
"address": "0xdF34022e8a280fc79499cA560439Bb6f9797EbD8",
"topics": [
"0xdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7",
"0x000000000000000000000000cafea1a2c9f4af0aaf1d5c4913cb8ba4bf0f9842",
"0x000000000000000000000000cafea1a2c9f4af0aaf1d5c4913cb8ba4bf0f9842"
],
"data": "0x0000000000000000000000000000000000000000000000008ac7230489e800000000000000000000000000000000000000000000000000008ac7230489e80000"
}
],
"input": "0x6e553f650000000000000000000000000000000000000000000000008ac7230489e80000000000000000000000000000cafea1a2c9f4af0aaf1d5c4913cb8ba4bf0f9842",
"value": "0x0",
"nonce": "0x5",
"gas": "0x1ee34",
"gasUsed": "0x1e843",
"cumulativeGasUsed": "0x5e95e",
"gasPrice": "0x62b85e900",
"gasTipCap": "0x59682f00",
"gasFeeCap": "0x835105080",
"alertId": null
}
48 changes: 48 additions & 0 deletions src/actions-local/payload/payload-ggpvault-redeem.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"network": "43114",
"blockHash": "0xaadc72ac18530c08c6b08d2b7cab5260bb198e3c782dca33c87ec64af1abab27",
"blockNumber": 41815748,
"hash": "0x5ca76c6e29cf2a941cc08df11b97e5e47b65ffb174b4b863718c3edb786a01dd",
"from": "0xcafea1A2c9F4Af0Aaf1d5C4913cb8BA4bf0F9842",
"to": "0xdF34022e8a280fc79499cA560439Bb6f9797EbD8",
"logs": [
{
"address": "0xdF34022e8a280fc79499cA560439Bb6f9797EbD8",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000cafea1a2c9f4af0aaf1d5c4913cb8ba4bf0f9842",
"0x0000000000000000000000000000000000000000000000000000000000000000"
],
"data": "0x0000000000000000000000000000000000000000000000004563918244f40000"
},
{
"address": "0x69260B9483F9871ca57f81A90D91E2F96c2Cd11d",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000df34022e8a280fc79499ca560439bb6f9797ebd8",
"0x000000000000000000000000cafea1a2c9f4af0aaf1d5c4913cb8ba4bf0f9842"
],
"data": "0x0000000000000000000000000000000000000000000000004563918244f40000"
},
{
"address": "0xdF34022e8a280fc79499cA560439Bb6f9797EbD8",
"topics": [
"0xfbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db",
"0x000000000000000000000000cafea1a2c9f4af0aaf1d5c4913cb8ba4bf0f9842",
"0x000000000000000000000000cafea1a2c9f4af0aaf1d5c4913cb8ba4bf0f9842",
"0x000000000000000000000000cafea1a2c9f4af0aaf1d5c4913cb8ba4bf0f9842"
],
"data": "0x0000000000000000000000000000000000000000000000004563918244f400000000000000000000000000000000000000000000000000004563918244f40000"
}
],
"input": "0xba0876520000000000000000000000000000000000000000000000004563918244f40000000000000000000000000000cafea1a2c9f4af0aaf1d5c4913cb8ba4bf0f9842000000000000000000000000cafea1a2c9f4af0aaf1d5c4913cb8ba4bf0f9842",
"value": "0x0",
"nonce": "0x6",
"gas": "0x15d66",
"gasUsed": "0x159be",
"cumulativeGasUsed": "0x6f8db",
"gasPrice": "0x62b85e900",
"gasTipCap": "0x59682f00",
"gasFeeCap": "0x835105080",
"alertId": null
}
81 changes: 81 additions & 0 deletions src/actions-local/payload/payload-ggpvault-staking-deposit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"network": "43114",
"blockHash": "0xeda985f30fb4fb502f37960fc6db87b7d36ca5c49bb2f6434619b1b695681d7b",
"blockNumber": 41815971,
"hash": "0xbef6d12330c280ed5104ca0f68017e31045d34eb7af38821c3a33de8ebc4b67c",
"from": "0x2Ff60357027861F25C7a6650564C2A606d23369d",
"to": "0xdF34022e8a280fc79499cA560439Bb6f9797EbD8",
"logs": [
{
"address": "0x69260B9483F9871ca57f81A90D91E2F96c2Cd11d",
"topics": [
"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",
"0x000000000000000000000000df34022e8a280fc79499ca560439bb6f9797ebd8",
"0x000000000000000000000000b6ddbf75e2f0c7fc363b47b84b5c03959526aecb"
],
"data": "0x0000000000000000000000000000000000000000000000004563918244f40000"
},
{
"address": "0x69260B9483F9871ca57f81A90D91E2F96c2Cd11d",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000df34022e8a280fc79499ca560439bb6f9797ebd8",
"0x000000000000000000000000b6ddbf75e2f0c7fc363b47b84b5c03959526aecb"
],
"data": "0x0000000000000000000000000000000000000000000000004563918244f40000"
},
{
"address": "0xB6dDbf75e2F0C7FC363B47B84b5C03959526AecB",
"topics": [
"0x3cd32fbc628a7c1c5a309e823125e5a4b8d98b9b31ad71d8338cc5f05829b199",
"0x0000000000000000000000002ff60357027861f25c7a6650564c2a606d23369d"
],
"data": "0x0000000000000000000000000000000000000000000000004563918244f40000"
},
{
"address": "0x69260B9483F9871ca57f81A90D91E2F96c2Cd11d",
"topics": [
"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",
"0x000000000000000000000000b6ddbf75e2f0c7fc363b47b84b5c03959526aecb",
"0x000000000000000000000000d45cb6f5aca41afaaaebdbe4efba49c1bc41e6ba"
],
"data": "0x0000000000000000000000000000000000000000000000004563918244f40000"
},
{
"address": "0xd45Cb6F5AcA41AfAAAeBdBE4EFBA49c1bC41E6BA",
"topics": [
"0xc4c24354aa86aa3532ebd9da7ff92230de931c78c77fcdf84544f11bf8fae753",
"0xbea235ff677e781f981db3b8d8193dd2280c06e039b6f51dbfdad43fc6338e17",
"0x00000000000000000000000069260b9483f9871ca57f81a90d91e2f96c2cd11d"
],
"data": "0x0000000000000000000000000000000000000000000000004563918244f40000"
},
{
"address": "0x69260B9483F9871ca57f81A90D91E2F96c2Cd11d",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000b6ddbf75e2f0c7fc363b47b84b5c03959526aecb",
"0x000000000000000000000000d45cb6f5aca41afaaaebdbe4efba49c1bc41e6ba"
],
"data": "0x0000000000000000000000000000000000000000000000004563918244f40000"
},
{
"address": "0xdF34022e8a280fc79499cA560439Bb6f9797EbD8",
"topics": [
"0x14438a8606c512fda07a1e9dfefc371418ed542946338bfa1c87788e903b4d68",
"0x0000000000000000000000002ff60357027861f25c7a6650564c2a606d23369d"
],
"data": "0x0000000000000000000000000000000000000000000000004563918244f40000"
}
],
"input": "0xe591c64d0000000000000000000000000000000000000000000000004563918244f400000000000000000000000000002ff60357027861f25c7a6650564c2a606d23369d",
"value": "0x0",
"nonce": "0xf",
"gas": "0x3593e",
"gasUsed": "0x34c1c",
"cumulativeGasUsed": "0x13c6a6",
"gasPrice": "0x62b85e900",
"gasTipCap": "0x59682f00",
"gasFeeCap": "0x835105080",
"alertId": null
}
37 changes: 37 additions & 0 deletions src/actions-local/payload/payload-ggpvault-staking-withdraw.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"network": "43114",
"blockHash": "0xdc43ef6b53a842eca2a85b6a8983b89e45b4493489d0caae706c537e4303231f",
"blockNumber": 41816134,
"hash": "0xe8c82f8d96cd55999da629ef44bc1434ffa85f43cfa41e44215bca5259a199c1",
"from": "0x2Ff60357027861F25C7a6650564C2A606d23369d",
"to": "0xdF34022e8a280fc79499cA560439Bb6f9797EbD8",
"logs": [
{
"address": "0xdF34022e8a280fc79499cA560439Bb6f9797EbD8",
"topics": [
"0x8a1d779a99a81cbb4c7490413dea3684dd84f3dfeedeec01be4d6dfc3ac6107a",
"0x0000000000000000000000002ff60357027861f25c7a6650564c2a606d23369d"
],
"data": "0x0000000000000000000000000000000000000000000000004563918244f40000"
},
{
"address": "0x69260B9483F9871ca57f81A90D91E2F96c2Cd11d",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x0000000000000000000000002ff60357027861f25c7a6650564c2a606d23369d",
"0x000000000000000000000000df34022e8a280fc79499ca560439bb6f9797ebd8"
],
"data": "0x0000000000000000000000000000000000000000000000004563918244f40000"
}
],
"input": "0x4e0614150000000000000000000000000000000000000000000000004563918244f40000",
"value": "0x0",
"nonce": "0x11",
"gas": "0x137f2",
"gasUsed": "0x134bd",
"cumulativeGasUsed": "0x44264",
"gasPrice": "0x62b85e900",
"gasTipCap": "0x59682f00",
"gasFeeCap": "0x835105080",
"alertId": null
}
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit c87527f

Please sign in to comment.