Skip to content

Commit

Permalink
adapting to changes in exposure type
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelMorami committed Jan 25, 2024
1 parent 4817b9a commit f95b266
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion certora/GSM/harness/GsmHarness.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ contract GsmHarness is Gsm {
return _accruedFees;
}

function getCurrentExposure() external view returns (uint256) {
function getCurrentExposure() external view returns (uint128) {
return _currentExposure;
}

Expand Down
12 changes: 6 additions & 6 deletions certora/GSM/specs/gsm/otakar-gho-gsm-finishedRules.spec
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ rule buyAssetDecreasesExposure()
priceLimits(e);
uint128 amount;
address receiver;
uint exposureBefore = getCurrentExposure(e);
uint128 exposureBefore = getCurrentExposure(e);
require amount > 0;
buyAsset(e, amount, receiver);

Expand All @@ -74,7 +74,7 @@ rule sellAssetIncreasesExposure()
priceLimits(e);
uint128 amount;
address receiver;
uint exposureBefore = getCurrentExposure(e);
uint128 exposureBefore = getCurrentExposure(e);
require amount > 0;
sellAsset(e, amount, receiver);

Expand All @@ -93,8 +93,8 @@ rule cantSellIfExposureTooHigh()
address receiver;
sellAsset(e, amount, receiver);

uint256 exposureCap = getExposureCap(e);
uint256 currentExposure = getCurrentExposure(e);
uint128 exposureCap = getExposureCap(e);
uint128 currentExposure = getCurrentExposure(e);

assert currentExposure <= exposureCap;
}
Expand Down Expand Up @@ -176,10 +176,10 @@ rule whoCanChangeExposure(method f)
env e;
feeLimits(e);
priceLimits(e);
uint256 exposureBefore = getCurrentExposure(e);
uint128 exposureBefore = getCurrentExposure(e);
calldataarg args;
f(e, args);
uint256 exposureAfter = getCurrentExposure(e);
uint128 exposureAfter = getCurrentExposure(e);
assert exposureAfter > exposureBefore => canIncreaseExposure(f), "should not increase exposure";
assert exposureAfter < exposureBefore => canDecreaseExposure(f), "should not decrease exposure";
}
Expand Down

0 comments on commit f95b266

Please sign in to comment.