Skip to content

Commit 93c8815

Browse files
kumaryash90Krishang NadgaudaKrishang Nadgauda
authored
Pack Contract (#175)
* new pack content struct * update pack interface * mock pack implementation * update pack interface with amountToDistributePerOpen * foundry * update Pack interface comments * implementation up till openPack * transfer pack contents into the contract on createPack * handle native token transfer case * up till compile * costly implementation, but works * cleanup * move pack to a directory * Add design doc * feature imports * update CurrencyTransferLib usage * format table in doc * created TempPack and ITempPack * refactor TempPack and ITempPack * PackInfo struct update * createPack test for TempPack * tests for TempPack * fix issues in Pack; tests for Pack and TempPack * benchmark test * remove twFee from Pack * remove unused imports from Pack * cleanup Pack * compile and run prettier * remove twFee * rename to nextTokenIdToMint * cleanup TempPack * avoid stack too deep error * update TempPack in tests * fix issue: getRewardUnits returning zero amount * forge updates * make createPack payable, to allow native tokens * add asset role * unit tests for TempPack * fuzz tests for TempPack * return rewardUnits from openPack in TempPack * fuzz test for openPack * separate function for random value generation * Fix bug: calculate pack total supply correctly * logs for tests * handling native tokens for pack * receive and withdraw functions for native token transfers * fuzz tests, and test logs * update currentTotalSupply in openPack * comment-out Pack -- not deleting yet * update tests * run prettier * update tests * scenario test -- reentrancy * perUnitAmounts -> numOfRewardUnits * run prettier * restrict receive() to native token wrapper * rename TempPack to Pack; delete older Pack * update tests * pull from main and update initialze fn * pkg update * deployment script for Pack * remove unused caller * fix import path Co-authored-by: Krishang Nadgauda <[email protected]> Co-authored-by: Krishang Nadgauda <[email protected]>
1 parent 2abaa42 commit 93c8815

22 files changed

+2264
-1520
lines changed

.gitmodules

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
url = https://github.com/brockelmore/forge-std
44
[submodule "lib/ds-test"]
55
path = lib/ds-test
6-
url = https://github.com/dapphub/ds-test
6+
url = https://github.com/dapphub/ds-test

assets/pack-diag-1.png

19.5 KB
Loading

assets/pack-diag-2.png

4.24 KB
Loading

assets/pack-diag-3.png

14.6 KB
Loading

0 commit comments

Comments
 (0)