Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1c03c97
feat: initial commit
sajanrajdev May 10, 2022
71b5d76
feat: merge stash
sajanrajdev May 10, 2022
d8f33b1
Merge branch 'main' into atomic-launch-test
sajanrajdev May 10, 2022
432cded
feat: test setup
sajanrajdev May 10, 2022
1f9a298
lint: fix
sajanrajdev May 10, 2022
47940d4
feat: added asset generation
sajanrajdev May 12, 2022
bf2c635
lint: fix
sajanrajdev May 12, 2022
106fb65
feat: added knighting round buy sim
sajanrajdev May 12, 2022
20e5ba1
feat: added rest of kr buy simulations
sajanrajdev May 12, 2022
00082de
feat: eth kr buy sim
sajanrajdev May 13, 2022
b27e21e
feat: most of atomic test done
sajanrajdev May 13, 2022
e4b86fe
test: borked curve pool deployment
sajanrajdev May 13, 2022
f0baa98
feat: deploying from bytecode - temporary
sajanrajdev May 13, 2022
d9c1f83
lint: fix
sajanrajdev May 13, 2022
8a2127d
fix: formatting
sajanrajdev May 13, 2022
4be104e
fix: use static array in deploy_pool interface
shuklaayush May 13, 2022
d796b53
feat: added liquidity provision
sajanrajdev May 16, 2022
5c78ee4
lint: fix
sajanrajdev May 16, 2022
3604c3c
feat: added post launch sim todo block
sajanrajdev May 16, 2022
c0475ec
fix: comment
sajanrajdev May 16, 2022
9ea1fe8
feat: minter role revoke and finilize krs
sajanrajdev May 16, 2022
44dc8ab
feat: add initial funding
sajanrajdev May 16, 2022
2716356
fix: time warp
sajanrajdev May 16, 2022
31b58c2
feat: funding params set
sajanrajdev May 17, 2022
3e3b953
feat: added further distributon checks
sajanrajdev May 17, 2022
8ae766c
feat: remove test functions
sajanrajdev May 17, 2022
2363f0f
feat: added shedule setup to test
sajanrajdev May 17, 2022
5e0818c
feat: added post atomic launch tests
Fatimanaz May 20, 2022
0410251
fix: linting resolve
Fatimanaz May 20, 2022
397c1da
feat: added locking test
Fatimanaz Jun 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
"prepare": "husky install",
"gen-types": "./gen-types.sh"
}
}
}
72 changes: 0 additions & 72 deletions src/SupplySchedule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ contract SupplySchedule is GlobalAccessControlManaged, DSTest {

function initialize(address _gac) public initializer {
__GlobalAccessControlManaged_init(_gac);
_setEpochRates();
}

/// =======================
Expand Down Expand Up @@ -170,75 +169,4 @@ contract SupplySchedule is GlobalAccessControlManaged, DSTest {
epochRate[_epoch] = _rate;
emit EpochSupplyRateSet(_epoch, _rate);
}

/// ========================
/// ===== Test actions =====
/// ========================

// @dev Set rates for the initial epochs
function _setEpochRates() internal {
epochRate[0] = 593962000000000000000000 / epochLength;
epochRate[1] = 591445000000000000000000 / epochLength;
epochRate[2] = 585021000000000000000000 / epochLength;
epochRate[3] = 574138000000000000000000 / epochLength;
epochRate[4] = 558275000000000000000000 / epochLength;
epochRate[5] = 536986000000000000000000 / epochLength;
}

function getMintableDebug(uint256 lastMintTimestamp) external {
require(
globalStartTimestamp > 0,
"SupplySchedule: minting not started"
);
require(
lastMintTimestamp > globalStartTimestamp,
"SupplySchedule: attempting to mint before start block"
);
require(
block.timestamp > lastMintTimestamp,
"SupplySchedule: already minted up to current block"
);

uint256 mintable = 0;

emit log_named_uint("mintable", mintable);
emit log_named_uint("block.timestamp", block.timestamp);
emit log_named_uint("lastMintTimestamp", lastMintTimestamp);
emit log_named_uint("globalStartTimestamp", globalStartTimestamp);
emit log_named_uint("epochLength", epochLength);

uint256 startingEpoch = (lastMintTimestamp - globalStartTimestamp) /
epochLength;
emit log_named_uint("startingEpoch", startingEpoch);

uint256 endingEpoch = (block.timestamp - globalStartTimestamp) /
epochLength;
emit log_named_uint("endingEpoch", endingEpoch);

for (uint256 i = startingEpoch; i <= endingEpoch; i++) {
uint256 rate = epochRate[i];

uint256 epochStartTime = globalStartTimestamp + i * epochLength;
uint256 epochEndTime = globalStartTimestamp + (i + 1) * epochLength;

emit log_named_uint("epoch iteration", i);
emit log_named_uint("epochStartTime", epochStartTime);
emit log_named_uint("epochEndTime", epochEndTime);

uint256 time = MathUpgradeable.min(block.timestamp, epochEndTime) -
MathUpgradeable.max(lastMintTimestamp, epochStartTime);

emit log_named_uint("time to mint over", time);

mintable += rate * time;

emit log_named_uint("mintable from this iteration", rate * time);
emit log_named_uint(
"total mintable after this iteration",
mintable
);
}

// return mintable;
}
}
Loading