Skip to content

Commit

Permalink
feat: generate new abis (#332)
Browse files Browse the repository at this point in the history
* feat: generate new abis

* fix: update scripts

* feat: add IstakeToken interface
  • Loading branch information
sakulstra authored Jan 18, 2024
1 parent 7edbac4 commit f747345
Show file tree
Hide file tree
Showing 26 changed files with 5,957 additions and 3,676 deletions.
5 changes: 5 additions & 0 deletions scripts/configs/abis.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {SAFETY_MODULE} from '../generator/safetyModuleGenerator';
import {governanceConfigMainnet} from './governance/ethereum';
import {mainnetProtoV2Pool, mainnetProtoV3Pool} from './pools/ethereum';

Expand Down Expand Up @@ -45,4 +46,8 @@ export const DOWNLOAD_ABI_INTERFACES = [
address: mainnetProtoV3Pool.additionalAddresses.UI_POOL_DATA_PROVIDER,
name: 'IUiPoolDataProvider',
},
{
address: '0x50f9d4e28309303f0cdcac8af0b569e8b75ab857',
name: 'IStakeToken',
},
];
2 changes: 1 addition & 1 deletion scripts/generateABIs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ export async function generateABIs(removeExisting: boolean) {
}
}

generateABIs();
generateABIs(false);
2 changes: 1 addition & 1 deletion scripts/generator/safetyModuleGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from './utils';
import {ChainId} from '@bgd-labs/js-utils';

const SAFETY_MODULE = {
export const SAFETY_MODULE = {
STK_AAVE: '0x4da27a545c0c5B758a6BA100e3a049001de870f5',
STK_ABPT: '0xa1116930326D21fB917d5A27F1E9943A9595fb47',
STK_ABPT_ORACLE: '0x209Ad99bd808221293d03827B86cC544bcA0023b',
Expand Down
116 changes: 116 additions & 0 deletions src/common/IStakeToken.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
pragma solidity ^0.8.10;

interface StakeToken {
event Approval(address indexed owner, address indexed spender, uint256 value);
event AssetConfigUpdated(address indexed asset, uint256 emission);
event AssetIndexUpdated(address indexed asset, uint256 index);
event Cooldown(address indexed user, uint256 amount);
event CooldownSecondsChanged(uint256 cooldownSeconds);
event DistributionEndChanged(uint256 endTimestamp);
event EIP712DomainChanged();
event ExchangeRateChanged(uint216 exchangeRate);
event FundsReturned(uint256 amount);
event Initialized(uint64 version);
event MaxSlashablePercentageChanged(uint256 newPercentage);
event PendingAdminChanged(address indexed newPendingAdmin, uint256 role);
event Redeem(address indexed from, address indexed to, uint256 assets, uint256 shares);
event RewardsAccrued(address user, uint256 amount);
event RewardsClaimed(address indexed from, address indexed to, uint256 amount);
event RoleClaimed(address indexed newAdmin, uint256 role);
event Slashed(address indexed destination, uint256 amount);
event SlashingExitWindowDurationChanged(uint256 windowSeconds);
event SlashingSettled();
event Staked(address indexed from, address indexed to, uint256 assets, uint256 shares);
event Transfer(address indexed from, address indexed to, uint256 value);
event UserIndexUpdated(address indexed user, address indexed asset, uint256 index);

struct AssetConfigInput {
uint128 emissionPerSecond;
uint256 totalStaked;
address underlyingAsset;
}

function CLAIM_HELPER_ROLE() external view returns (uint256);
function COOLDOWN_ADMIN_ROLE() external view returns (uint256);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function EMISSION_MANAGER() external view returns (address);
function EXCHANGE_RATE_UNIT() external view returns (uint256);
function INITIAL_EXCHANGE_RATE() external view returns (uint216);
function LOWER_BOUND() external view returns (uint256);
function PRECISION() external view returns (uint8);
function REWARDS_VAULT() external view returns (address);
function REWARD_TOKEN() external view returns (address);
function SLASH_ADMIN_ROLE() external view returns (uint256);
function STAKED_TOKEN() external view returns (address);
function UNSTAKE_WINDOW() external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 value) external returns (bool);
function assets(address)
external
view
returns (uint128 emissionPerSecond, uint128 lastUpdateTimestamp, uint256 index);
function balanceOf(address account) external view returns (uint256);
function claimRewards(address to, uint256 amount) external;
function claimRewardsAndRedeem(address to, uint256 claimAmount, uint256 redeemAmount) external;
function claimRewardsAndRedeemOnBehalf(address from, address to, uint256 claimAmount, uint256 redeemAmount)
external;
function claimRewardsOnBehalf(address from, address to, uint256 amount) external returns (uint256);
function claimRoleAdmin(uint256 role) external;
function configureAssets(AssetConfigInput[] memory assetsConfigInput) external;
function cooldown() external;
function cooldownOnBehalfOf(address from) external;
function decimals() external view returns (uint8);
function distributionEnd() external view returns (uint256);
function eip712Domain()
external
view
returns (
bytes1 fields,
string memory name,
string memory version,
uint256 chainId,
address verifyingContract,
bytes32 salt,
uint256[] memory extensions
);
function getAdmin(uint256 role) external view returns (address);
function getCooldownSeconds() external view returns (uint256);
function getExchangeRate() external view returns (uint216);
function getMaxSlashablePercentage() external view returns (uint256);
function getPendingAdmin(uint256 role) external view returns (address);
function getTotalRewardsBalance(address staker) external view returns (uint256);
function getUserAssetData(address user, address asset) external view returns (uint256);
function inPostSlashingPeriod() external view returns (bool);
function initialize(
string memory name,
string memory symbol,
address slashingAdmin,
address cooldownPauseAdmin,
address claimHelper,
uint256 maxSlashablePercentage,
uint256 cooldownSeconds
) external;
function name() external view returns (string memory);
function nonces(address owner) external view returns (uint256);
function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)
external;
function previewRedeem(uint256 shares) external view returns (uint256);
function previewStake(uint256 assets) external view returns (uint256);
function redeem(address to, uint256 amount) external;
function redeemOnBehalf(address from, address to, uint256 amount) external;
function returnFunds(uint256 amount) external;
function setCooldownSeconds(uint256 cooldownSeconds) external;
function setDistributionEnd(uint256 newDistributionEnd) external;
function setMaxSlashablePercentage(uint256 percentage) external;
function setPendingAdmin(uint256 role, address newPendingAdmin) external;
function settleSlashing() external;
function slash(address destination, uint256 amount) external returns (uint256);
function stake(address to, uint256 amount) external;
function stakeWithPermit(uint256 amount, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external;
function stakerRewardsToClaim(address) external view returns (uint256);
function stakersCooldowns(address) external view returns (uint40 timestamp, uint216 amount);
function symbol() external view returns (string memory);
function totalSupply() external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
130 changes: 65 additions & 65 deletions src/ts/abis/AggregatorInterface.ts
Original file line number Diff line number Diff line change
@@ -1,130 +1,130 @@
// AUTOGENERATED - MANUALLY CHANGES WILL BE REVERTED BY THE GENERATOR
export const AggregatorInterface_ABI = [
{
type: 'function',
name: 'getAnswer',
anonymous: false,
inputs: [
{
indexed: true,
internalType: 'int256',
name: 'current',
type: 'int256',
},
{
indexed: true,
internalType: 'uint256',
name: 'roundId',
type: 'uint256',
internalType: 'uint256',
},
],
outputs: [
{
name: '',
type: 'int256',
internalType: 'int256',
indexed: false,
internalType: 'uint256',
name: 'updatedAt',
type: 'uint256',
},
],
stateMutability: 'view',
name: 'AnswerUpdated',
type: 'event',
},
{
type: 'function',
name: 'getTimestamp',
anonymous: false,
inputs: [
{
indexed: true,
internalType: 'uint256',
name: 'roundId',
type: 'uint256',
internalType: 'uint256',
},
],
outputs: [
{
name: '',
type: 'uint256',
indexed: true,
internalType: 'address',
name: 'startedBy',
type: 'address',
},
{
indexed: false,
internalType: 'uint256',
name: 'startedAt',
type: 'uint256',
},
],
stateMutability: 'view',
name: 'NewRound',
type: 'event',
},
{
type: 'function',
name: 'latestAnswer',
inputs: [],
inputs: [
{
internalType: 'uint256',
name: 'roundId',
type: 'uint256',
},
],
name: 'getAnswer',
outputs: [
{
internalType: 'int256',
name: '',
type: 'int256',
internalType: 'int256',
},
],
stateMutability: 'view',
type: 'function',
},
{
type: 'function',
name: 'latestRound',
inputs: [],
inputs: [
{
internalType: 'uint256',
name: 'roundId',
type: 'uint256',
},
],
name: 'getTimestamp',
outputs: [
{
internalType: 'uint256',
name: '',
type: 'uint256',
internalType: 'uint256',
},
],
stateMutability: 'view',
type: 'function',
},
{
type: 'function',
name: 'latestTimestamp',
inputs: [],
name: 'latestAnswer',
outputs: [
{
internalType: 'int256',
name: '',
type: 'uint256',
internalType: 'uint256',
type: 'int256',
},
],
stateMutability: 'view',
type: 'function',
},
{
type: 'event',
name: 'AnswerUpdated',
inputs: [
{
name: 'current',
type: 'int256',
indexed: true,
internalType: 'int256',
},
inputs: [],
name: 'latestRound',
outputs: [
{
name: 'roundId',
type: 'uint256',
indexed: true,
internalType: 'uint256',
},
{
name: 'updatedAt',
name: '',
type: 'uint256',
indexed: false,
internalType: 'uint256',
},
],
anonymous: false,
stateMutability: 'view',
type: 'function',
},
{
type: 'event',
name: 'NewRound',
inputs: [
inputs: [],
name: 'latestTimestamp',
outputs: [
{
name: 'roundId',
type: 'uint256',
indexed: true,
internalType: 'uint256',
},
{
name: 'startedBy',
type: 'address',
indexed: true,
internalType: 'address',
},
{
name: 'startedAt',
name: '',
type: 'uint256',
indexed: false,
internalType: 'uint256',
},
],
anonymous: false,
stateMutability: 'view',
type: 'function',
},
] as const;
Loading

0 comments on commit f747345

Please sign in to comment.