Skip to content

Commit

Permalink
Merge branch 'staging' of github.com:teller-protocol/teller-protocol-…
Browse files Browse the repository at this point in the history
…v2 into staging
  • Loading branch information
ethereumdegen committed Oct 8, 2024
2 parents 7079a82 + e553795 commit 53aa021
Show file tree
Hide file tree
Showing 6 changed files with 557 additions and 194 deletions.
365 changes: 365 additions & 0 deletions packages/contracts/.openzeppelin/polygon.json
Original file line number Diff line number Diff line change
Expand Up @@ -9836,6 +9836,371 @@
},
"namespaces": {}
}
},
"536ab90e35dd8484dd229a8bef88b39796daa4892ce6e9cc6364b2ebfe50f655": {
"address": "0xE3BA6B6039E1313A00157f41F017df1d661B76Ec",
"txHash": "0x954a3983f83a7c933414911c957bcfa0b1e7914c7084cb5fec0db785e75b214b",
"layout": {
"solcVersion": "0.8.9",
"storage": [
{
"label": "_initialized",
"offset": 0,
"slot": "0",
"type": "t_uint8",
"contract": "Initializable",
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62",
"retypedFrom": "bool"
},
{
"label": "_initializing",
"offset": 1,
"slot": "0",
"type": "t_bool",
"contract": "Initializable",
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67"
},
{
"label": "__gap",
"offset": 0,
"slot": "1",
"type": "t_array(t_uint256)50_storage",
"contract": "ContextUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36"
},
{
"label": "_owner",
"offset": 0,
"slot": "51",
"type": "t_address",
"contract": "OwnableUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22"
},
{
"label": "__gap",
"offset": 0,
"slot": "52",
"type": "t_array(t_uint256)49_storage",
"contract": "OwnableUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94"
},
{
"label": "_paused",
"offset": 0,
"slot": "101",
"type": "t_bool",
"contract": "PausableUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:29"
},
{
"label": "__gap",
"offset": 0,
"slot": "102",
"type": "t_array(t_uint256)49_storage",
"contract": "PausableUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:116"
},
{
"label": "UNISWAP_V3_POOL",
"offset": 0,
"slot": "151",
"type": "t_address",
"contract": "LenderCommitmentGroup_Smart",
"src": "contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol:94"
},
{
"label": "poolSharesToken",
"offset": 0,
"slot": "152",
"type": "t_contract(LenderCommitmentGroupShares)8741",
"contract": "LenderCommitmentGroup_Smart",
"src": "contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol:96"
},
{
"label": "principalToken",
"offset": 0,
"slot": "153",
"type": "t_contract(IERC20)3742",
"contract": "LenderCommitmentGroup_Smart",
"src": "contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol:98"
},
{
"label": "collateralToken",
"offset": 0,
"slot": "154",
"type": "t_contract(IERC20)3742",
"contract": "LenderCommitmentGroup_Smart",
"src": "contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol:99"
},
{
"label": "_uniswapPoolFee",
"offset": 20,
"slot": "154",
"type": "t_uint24",
"contract": "LenderCommitmentGroup_Smart",
"src": "contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol:100"
},
{
"label": "marketId",
"offset": 0,
"slot": "155",
"type": "t_uint256",
"contract": "LenderCommitmentGroup_Smart",
"src": "contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol:102"
},
{
"label": "totalPrincipalTokensCommitted",
"offset": 0,
"slot": "156",
"type": "t_uint256",
"contract": "LenderCommitmentGroup_Smart",
"src": "contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol:105"
},
{
"label": "totalPrincipalTokensWithdrawn",
"offset": 0,
"slot": "157",
"type": "t_uint256",
"contract": "LenderCommitmentGroup_Smart",
"src": "contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol:106"
},
{
"label": "totalPrincipalTokensLended",
"offset": 0,
"slot": "158",
"type": "t_uint256",
"contract": "LenderCommitmentGroup_Smart",
"src": "contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol:108"
},
{
"label": "totalPrincipalTokensRepaid",
"offset": 0,
"slot": "159",
"type": "t_uint256",
"contract": "LenderCommitmentGroup_Smart",
"src": "contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol:109"
},
{
"label": "totalInterestCollected",
"offset": 0,
"slot": "160",
"type": "t_uint256",
"contract": "LenderCommitmentGroup_Smart",
"src": "contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol:113"
},
{
"label": "liquidityThresholdPercent",
"offset": 0,
"slot": "161",
"type": "t_uint16",
"contract": "LenderCommitmentGroup_Smart",
"src": "contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol:115"
},
{
"label": "collateralRatio",
"offset": 2,
"slot": "161",
"type": "t_uint16",
"contract": "LenderCommitmentGroup_Smart",
"src": "contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol:116"
},
{
"label": "_twapInterval",
"offset": 4,
"slot": "161",
"type": "t_uint32",
"contract": "LenderCommitmentGroup_Smart",
"src": "contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol:118"
},
{
"label": "maxLoanDuration",
"offset": 8,
"slot": "161",
"type": "t_uint32",
"contract": "LenderCommitmentGroup_Smart",
"src": "contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol:119"
},
{
"label": "interestRateLowerBound",
"offset": 12,
"slot": "161",
"type": "t_uint16",
"contract": "LenderCommitmentGroup_Smart",
"src": "contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol:120"
},
{
"label": "interestRateUpperBound",
"offset": 14,
"slot": "161",
"type": "t_uint16",
"contract": "LenderCommitmentGroup_Smart",
"src": "contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol:121"
},
{
"label": "poolSharesPreparedToWithdrawForLender",
"offset": 0,
"slot": "162",
"type": "t_mapping(t_address,t_uint256)",
"contract": "LenderCommitmentGroup_Smart",
"src": "contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol:126"
},
{
"label": "poolSharesPreparedTimestamp",
"offset": 0,
"slot": "163",
"type": "t_mapping(t_address,t_uint256)",
"contract": "LenderCommitmentGroup_Smart",
"src": "contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol:127"
},
{
"label": "activeBids",
"offset": 0,
"slot": "164",
"type": "t_mapping(t_uint256,t_bool)",
"contract": "LenderCommitmentGroup_Smart",
"src": "contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol:132"
},
{
"label": "tokenDifferenceFromLiquidations",
"offset": 0,
"slot": "165",
"type": "t_int256",
"contract": "LenderCommitmentGroup_Smart",
"src": "contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol:136"
},
{
"label": "firstDepositMade",
"offset": 0,
"slot": "166",
"type": "t_bool",
"contract": "LenderCommitmentGroup_Smart",
"src": "contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol:138"
},
{
"label": "withdrawlDelayTimeSeconds",
"offset": 0,
"slot": "167",
"type": "t_uint256",
"contract": "LenderCommitmentGroup_Smart",
"src": "contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol:139"
},
{
"label": "poolOracleRoutes",
"offset": 0,
"slot": "168",
"type": "t_array(t_struct(PoolRouteConfig)11835_storage)dyn_storage",
"contract": "LenderCommitmentGroup_Smart",
"src": "contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol:141"
},
{
"label": "maxPrincipalPerCollateralAmount",
"offset": 0,
"slot": "169",
"type": "t_uint256",
"contract": "LenderCommitmentGroup_Smart",
"src": "contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol:144"
}
],
"types": {
"t_address": {
"label": "address",
"numberOfBytes": "20"
},
"t_array(t_struct(PoolRouteConfig)11835_storage)dyn_storage": {
"label": "struct IUniswapPricingLibrary.PoolRouteConfig[]",
"numberOfBytes": "32"
},
"t_array(t_uint256)49_storage": {
"label": "uint256[49]",
"numberOfBytes": "1568"
},
"t_array(t_uint256)50_storage": {
"label": "uint256[50]",
"numberOfBytes": "1600"
},
"t_bool": {
"label": "bool",
"numberOfBytes": "1"
},
"t_contract(IERC20)3742": {
"label": "contract IERC20",
"numberOfBytes": "20"
},
"t_contract(LenderCommitmentGroupShares)8741": {
"label": "contract LenderCommitmentGroupShares",
"numberOfBytes": "20"
},
"t_int256": {
"label": "int256",
"numberOfBytes": "32"
},
"t_mapping(t_address,t_uint256)": {
"label": "mapping(address => uint256)",
"numberOfBytes": "32"
},
"t_mapping(t_uint256,t_bool)": {
"label": "mapping(uint256 => bool)",
"numberOfBytes": "32"
},
"t_struct(PoolRouteConfig)11835_storage": {
"label": "struct IUniswapPricingLibrary.PoolRouteConfig",
"members": [
{
"label": "pool",
"type": "t_address",
"offset": 0,
"slot": "0"
},
{
"label": "zeroForOne",
"type": "t_bool",
"offset": 20,
"slot": "0"
},
{
"label": "twapInterval",
"type": "t_uint32",
"offset": 21,
"slot": "0"
},
{
"label": "token0Decimals",
"type": "t_uint256",
"offset": 0,
"slot": "1"
},
{
"label": "token1Decimals",
"type": "t_uint256",
"offset": 0,
"slot": "2"
}
],
"numberOfBytes": "96"
},
"t_uint16": {
"label": "uint16",
"numberOfBytes": "2"
},
"t_uint24": {
"label": "uint24",
"numberOfBytes": "3"
},
"t_uint256": {
"label": "uint256",
"numberOfBytes": "32"
},
"t_uint32": {
"label": "uint32",
"numberOfBytes": "4"
},
"t_uint8": {
"label": "uint8",
"numberOfBytes": "1"
}
},
"namespaces": {}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ contract LenderCommitmentGroup_Smart is
liquidationProtocolFee
);


totalPrincipalTokensRepaid += amountDue;
tokenDifferenceFromLiquidations += int256(tokensToTakeFromSender - liquidationProtocolFee );


Expand All @@ -714,6 +714,7 @@ contract LenderCommitmentGroup_Smart is
amountDue - tokensToGiveToSender
);

totalPrincipalTokensRepaid += amountDue;
tokenDifferenceFromLiquidations -= int256(tokensToGiveToSender);


Expand Down
Loading

0 comments on commit 53aa021

Please sign in to comment.