Skip to content

Commit

Permalink
CompoundV3Deposit integration
Browse files Browse the repository at this point in the history
  • Loading branch information
pgbrandao committed Dec 12, 2023
1 parent 89ded6f commit 7325afb
Show file tree
Hide file tree
Showing 8 changed files with 1,655 additions and 0 deletions.
1,133 changes: 1,133 additions & 0 deletions core/src/abis/Compound/Comet.json

Large diffs are not rendered by default.

188 changes: 188 additions & 0 deletions core/src/abis/Compound/CometRewards.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
[
{
"inputs": [
{ "internalType": "address", "name": "governor_", "type": "address" }
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [{ "internalType": "address", "name": "", "type": "address" }],
"name": "AlreadyConfigured",
"type": "error"
},
{
"inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"name": "InvalidUInt64",
"type": "error"
},
{
"inputs": [{ "internalType": "address", "name": "", "type": "address" }],
"name": "NotPermitted",
"type": "error"
},
{
"inputs": [{ "internalType": "address", "name": "", "type": "address" }],
"name": "NotSupported",
"type": "error"
},
{
"inputs": [
{ "internalType": "address", "name": "", "type": "address" },
{ "internalType": "uint256", "name": "", "type": "uint256" }
],
"name": "TransferOutFailed",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "oldGovernor",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newGovernor",
"type": "address"
}
],
"name": "GovernorTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "src",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "token",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "RewardClaimed",
"type": "event"
},
{
"inputs": [
{ "internalType": "address", "name": "comet", "type": "address" },
{ "internalType": "address", "name": "src", "type": "address" },
{ "internalType": "bool", "name": "shouldAccrue", "type": "bool" }
],
"name": "claim",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "comet", "type": "address" },
{ "internalType": "address", "name": "src", "type": "address" },
{ "internalType": "address", "name": "to", "type": "address" },
{ "internalType": "bool", "name": "shouldAccrue", "type": "bool" }
],
"name": "claimTo",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "comet", "type": "address" },
{ "internalType": "address", "name": "account", "type": "address" }
],
"name": "getRewardOwed",
"outputs": [
{
"components": [
{ "internalType": "address", "name": "token", "type": "address" },
{ "internalType": "uint256", "name": "owed", "type": "uint256" }
],
"internalType": "struct CometRewards.RewardOwed",
"name": "",
"type": "tuple"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "governor",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [{ "internalType": "address", "name": "", "type": "address" }],
"name": "rewardConfig",
"outputs": [
{ "internalType": "address", "name": "token", "type": "address" },
{ "internalType": "uint64", "name": "rescaleFactor", "type": "uint64" },
{ "internalType": "bool", "name": "shouldUpscale", "type": "bool" }
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "", "type": "address" },
{ "internalType": "address", "name": "", "type": "address" }
],
"name": "rewardsClaimed",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "comet", "type": "address" },
{ "internalType": "address", "name": "token", "type": "address" }
],
"name": "setRewardConfig",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "newGovernor", "type": "address" }
],
"name": "transferGovernor",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "token", "type": "address" },
{ "internalType": "address", "name": "to", "type": "address" },
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
],
"name": "withdrawToken",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
4 changes: 4 additions & 0 deletions core/src/abis/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import IHypervisorRouterABI from "./Gamma/IHypervisorRouter.json";
import GammaRatiosCalculatorABI from "./Gamma/GammaRatiosCalculator.json";
import IParaswapABI from "./Paraswap/IParaswap.json";
import StargateRouterABI from "./Stargate/Router.json";
import CompoundCometABI from "./Compound/Comet.json";
import CompoundCometRewardsABI from "./Compound/CometRewards.json";
import UniswapV2FactoryABI from "./UniswapV2/UniswapV2Factory.json";
import UniswapV2PairABI from "./UniswapV2/UniswapV2Pair.json";
import UniswapV2Router02ABI from "./UniswapV2/UniswapV2Router02.json";
Expand All @@ -36,6 +38,8 @@ export const GammaRatiosCalculator = new Interface(
);
export const IParaswap = new Interface(IParaswapABI);
export const StargateRouter = new Interface(StargateRouterABI);
export const CompoundComet = new Interface(CompoundCometABI);
export const CompoundCometRewards = new Interface(CompoundCometRewardsABI);
export const UniswapV2Factory = new Interface(UniswapV2FactoryABI);
export const UniswapV2Pair = new Interface(UniswapV2PairABI);
export const UniswapV2Router02 = new Interface(UniswapV2Router02ABI);
Expand Down
Loading

0 comments on commit 7325afb

Please sign in to comment.