Skip to content

Commit

Permalink
Merge pull request #205 from Axis-Fi/dtl-cleanup
Browse files Browse the repository at this point in the history
Minor cleanup
  • Loading branch information
Oighty authored Jun 11, 2024
2 parents 76ea241 + 60a7dd0 commit 27ecd44
Show file tree
Hide file tree
Showing 31 changed files with 38 additions and 360 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Licensed Work: Axis Protocol
Additional Use Grant: Any uses listed and defined at
license-grants.axis.eth

Change Date: The earlier of 2028-[TODO] or a date specified at
Change Date: The earlier of 2028-07-01 or a date specified at
license-date.axis.eth

Change License: GNU Affero General Public License v3.0 or later
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "moonraker",
"name": "axis-core",
"version": "1.0.0",
"description": "",
"main": "index.js",
Expand Down
48 changes: 24 additions & 24 deletions script/salts/salts.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,38 +38,38 @@
"0xed4ba02077e70f78db70ce191509333d2dcccfff136d30dcb011f567305e88ad": "0x2b8bc588174d409692f1bd993942e3806c9a11344dbe674f46aed32a030aacf1"
},
"Test_AllocatedMerkleAllowlist": {
"0x1242d528fb3d9259e7192f83e1faf95370bfd8d7f2b1bae5d3ea350d3d9c563c": "0xb80697991eaa9d0a7bb1cb476ffcd740328b1cd4053a31a235c332ab518e2cef",
"0x7cca57da19a5847b2b87641c1b721a32d4778e3e58641d6771cd14ed112b3bc3": "0x7bdee14ccb49ce7eeb49e85f2fbd05aa0ef2533a16f23a874a705d60ae6d8ca2"
"0x1242d528fb3d9259e7192f83e1faf95370bfd8d7f2b1bae5d3ea350d3d9c563c": "0x0ec2c9d910490e897c952a3210e5915006080f59a14a022b941a8c8cef2886e3",
"0x7cca57da19a5847b2b87641c1b721a32d4778e3e58641d6771cd14ed112b3bc3": "0xe0631d27a3d241774729d8c3ee1d9efae407f1073f89fa0956b2d308bd3adec4"
},
"Test_CappedMerkleAllowlist": {
"0x240bdd876f7c0070009c234b8cde981c3865d49db15097f59cd4ffb15d818d1e": "0x1daf174abe93432b9d9477ee696e91595165db910369a788959277b2015a1649",
"0xb8a17b3ee693ebdcfc6913bb2f65d0fadbe8812d9ef4d927595a7dc75db68727": "0x896bbad5f52d535d137900a5bc67f8d1ac05b77535e1d0f063b792c8a3d43950"
"0x240bdd876f7c0070009c234b8cde981c3865d49db15097f59cd4ffb15d818d1e": "0xe68b5bbeed8a53eb7e97b7bc84ec08e1e6a5b360cae16f0653c60eff312dec3f",
"0xb8a17b3ee693ebdcfc6913bb2f65d0fadbe8812d9ef4d927595a7dc75db68727": "0x956b71c3545015d12e8bbefbad72019b673860f32a5b4313eeb866425d97be17"
},
"Test_MockCallback": {
"0x0825d99059fe0dc95e0b5cd7b853a5f3f50b58f25c5812fc7fd01d69ff4ec679": "0x1651f1c538aa5bd285c6adc8b93f7e67da8aa1a29d80e8c698744d21d45fc884",
"0x51526251ca3003df174c65f2fb581f61820ce57c14720e0d67480ed8c8b77925": "0xdd9130d0b972415e918b25614f6b4840f520ea47319adf3732b1fc56114c179f",
"0x6206c9845f35f3006fc507c15aaaf4a719380265cf472773a270ffe6d5eb5299": "0x93a8b2f8f82b55a0c37080a98664a8edaf85e547276d6b0c033e60a0d2bdef8f",
"0x6b7fa77ae82f95cc8c5fe53dca64702ea0dc8e3dad74749dc8cd77de2884e704": "0x76c418f9988972d5bb9bc4eeb4f08b2048673bcf7ae70fc53a02716dc960bd26",
"0x7310243dabd76344326f3659aabda0b846a9c8e9e7d50b990261c14f2b44d560": "0xb1bbcaa44b2450a9ee47a2fbdc33924300b34298fec9464aa4fad74c034de162",
"0x7602309c05771de8281f2f3f08e74ec9f19f1bfdaac8cd970d9f7a8d62173b6e": "0xbc83fe471ad18cff2adc4682afe916acac385fc9ef07a4ba91818de6ec1efece",
"0x892e1120a976151ae5375dca978040abe705c8cbdd3c7b64b41ff1087ee01c22": "0x0bfb9e85c536a3893badf90474a897babc0a354424eac59a399b9a1afbd80658",
"0x8a69dcb863773a3bb971a969233286e75cba80abf6ec8d881cada7ea0ad674b0": "0x24a009aa7da7d2a4ac05d36d48877deab4871b39e550be29219fc918c836c5f0",
"0x8d8681a539f3b359e94a05239187dc55cb9cb2dcfe01726d3053573206efe25f": "0x2bc525d742b50318b05508248d64cd1f921e12ce2c92e0bc6540a3b6a9bfa167",
"0x918d87a20c837fa93ce3089d2cb6386b66f79bbfd0f09bd6784bc52108b69938": "0xb28d63640bf4daec90083b7bd2bad4f3b2a022d0dc05112bcabf76912ab971ee",
"0x9569f58e5e127ceb73049eea8119bb21f8c4328d3b4770da5a67075be3f77c12": "0x21e165a2cfa59019517b2ccbfab94e5ad99bcba41683678c8a52b97018294372",
"0x96f0481f00eeec717fa8c0d41efd04b6e3fdccbebbaa223ee2118449ebea2406": "0x33f0b692b2d93a6c56c4c2c64f478238f9eace7ba2afe99c435feb14c7f1d969",
"0x9c35a3189126603f4b187149f54e09082403dac10b3e899a503e28e897edd6f9": "0x2f34589c949eb68f1bcb6a3184bea2943628eb53950d8fbf450bb26722777c26",
"0x9db4bc605469ede684fbaa475d320b3fbe6a707deaa953ee1ba29ecb3c1125fb": "0xd6e401f9d95933c00188f4be27a59c98469d0aaaafb7af16cfb4bbda70d900ed",
"0xb8e0b3cbd7273e83cfdbcb8269e5c3510a28892e815fe28bc0f515be0df2c8f9": "0x2a04e81f425ae24b794f9c4d418613717dce0ba4efff430542c513c047bc163f",
"0xc38bb4813ebdb9978d2485ae5ad92e1152f8a955430a63210b69b2277eed9477": "0x3f17a3630401129b9f926580be166ff3283062d85c2990ac4a81091b384d1dee",
"0xd75e639b43b1d29e1703abcd2616b6b67f3ae232d53915d472f3a5b6aae6083c": "0x9ff548e0d2a851a0c9660a4ddfe2e755a6eb3959f05c7947463c01e484d5a4b2",
"0xf2644573f57aea10dffac6e7215b409fa19236ae57b735b20b9fac9834391850": "0x0ec60e71b213d8edda9d1abd30b37229e08f48ab0b3f4593b8d06a2a1cab08ef"
"0x0825d99059fe0dc95e0b5cd7b853a5f3f50b58f25c5812fc7fd01d69ff4ec679": "0x222b47fd0259b3eacfbc04b9dddf5bb5ba060245c2c3c3673672ad4d815d01df",
"0x51526251ca3003df174c65f2fb581f61820ce57c14720e0d67480ed8c8b77925": "0xd25a3174b866cae4f78f513123ffebf33114f3df0093e06159010b3d9fbadff3",
"0x6206c9845f35f3006fc507c15aaaf4a719380265cf472773a270ffe6d5eb5299": "0xe9943f7c46c50e34e5f91da14d0ca6c58b5504172e156e19108bf2844fdaec63",
"0x6b7fa77ae82f95cc8c5fe53dca64702ea0dc8e3dad74749dc8cd77de2884e704": "0x600196a40f70c0b91ab3ace5873750bc77d14dddf6b1093b03def43f31ddb4c3",
"0x7310243dabd76344326f3659aabda0b846a9c8e9e7d50b990261c14f2b44d560": "0x86d15e2125c36574017c86d4fcd04bb470225e835b76e3cbe63c5908da46ab8c",
"0x7602309c05771de8281f2f3f08e74ec9f19f1bfdaac8cd970d9f7a8d62173b6e": "0xd28f39fd2d2e1a378b0fe177abc5ac22a4642634847865a096a5e96bd04c6411",
"0x892e1120a976151ae5375dca978040abe705c8cbdd3c7b64b41ff1087ee01c22": "0x748af80730f660a2400a4d6f8f4f41d21cca1cc117fc2f1c51e131e16fa43ce3",
"0x8a69dcb863773a3bb971a969233286e75cba80abf6ec8d881cada7ea0ad674b0": "0xd7bacad37fd5e507c6bc424ed88ae37e8d4935b54d7e41cf1306d46c37eaebb4",
"0x8d8681a539f3b359e94a05239187dc55cb9cb2dcfe01726d3053573206efe25f": "0x6f209918e9619b620b306b2014e6aabe3688c4a4043117b6835ab17bd70bf004",
"0x918d87a20c837fa93ce3089d2cb6386b66f79bbfd0f09bd6784bc52108b69938": "0x64473a26214c7b928ff6c08104e3b18ae36918097eefb554aa17c2b9347fd7f2",
"0x9569f58e5e127ceb73049eea8119bb21f8c4328d3b4770da5a67075be3f77c12": "0x2123580432d5ece19c5e099d5156a9598f2c49fdcbcc1029f7d21276ccab2ba3",
"0x96f0481f00eeec717fa8c0d41efd04b6e3fdccbebbaa223ee2118449ebea2406": "0x6bc41d5bab2740be84e43b053ed3b46acb6f3ac1cb9031fb3203edd92a833a07",
"0x9c35a3189126603f4b187149f54e09082403dac10b3e899a503e28e897edd6f9": "0xa35f7a6870564c7a14d71310c87a6816c3ef4f80eb0a5ac43d56235e075ae162",
"0x9db4bc605469ede684fbaa475d320b3fbe6a707deaa953ee1ba29ecb3c1125fb": "0x67f66566dfb091aeeb776b692eba5f570f5a310cf25e94f0e06120cf64737a9d",
"0xb8e0b3cbd7273e83cfdbcb8269e5c3510a28892e815fe28bc0f515be0df2c8f9": "0x17f7fbab547a6a69119fee8820b0ff11a8da7a1f9902a19d8f3917a6c8aff2da",
"0xc38bb4813ebdb9978d2485ae5ad92e1152f8a955430a63210b69b2277eed9477": "0x9bf9b60e2afb2faf561385c61d5c3f5b6b910c97bdd3bb4af59d193140215a31",
"0xd75e639b43b1d29e1703abcd2616b6b67f3ae232d53915d472f3a5b6aae6083c": "0xa45904df2431729c77de44b4b88e032130e12dcbc735f0f72a29af686e15f3ed",
"0xf2644573f57aea10dffac6e7215b409fa19236ae57b735b20b9fac9834391850": "0x3a824c912eb7f08b82a8d936c2e29cb2b6fdde7e33ea9af18d9ccbde9c454161"
},
"Test_UniswapV2DirectToLiquidity": {
"0x8aa87d37877643656e4c99ac5894ef1db7d58a30e3d0f576d3900163491b50de": "0x93ba4418a111f3fd9d30718f1d1adacf772b3c4515dac235676320b9b5753652"
"0x174201fc5371e6b5c38ac3e8a150aac595a79929c11ade671773a4af96e796b2": "0xf79f6bfb74c7ea1422de906b5c897cbc4e8e282d391348930a7f75feaa4fc6ce"
},
"Test_UniswapV3DirectToLiquidity": {
"0x205b2d8780f5fa0bb6edef93607aa4f671b524b5d2b2f3278d238d08dfdf900c": "0x52c359e9c03d7e4b2af98f5b70fc386406184608f7f882d2789be69a2743d09a"
"0xbbc3774034dce84cb792ad50a090b7c2b736a85af6e59e595e55e4f369523495": "0x2cb699095381555944575ef169da11fe4a944e6c6c382910eefd1a06c32b2c33"
},
"TokenAllowlist": {
"0x09db47d395a68db033a3b222b9d1a212cec8422b03aeafc313aa4d2813c6dd60": "0xe07a005213f35e1f050a4da040d6bc3cae2ad333647b51a6ffa2e7941980043a",
Expand Down
29 changes: 4 additions & 25 deletions src/callbacks/liquidity/BaseDTL.sol
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ abstract contract BaseDirectToLiquidity is BaseCallback {
uint256 capacity_,
bool prefund_,
bytes calldata callbackData_
) internal virtual override onlyIfLotDoesNotExist(lotId_) {
) internal virtual override {
// Decode callback data into the params
OnCreateParams memory params = abi.decode(callbackData_, (OnCreateParams));

Expand Down Expand Up @@ -218,12 +218,7 @@ abstract contract BaseDirectToLiquidity is BaseCallback {
/// - The lot is not registered
///
/// @param lotId_ The lot ID
function _onCancel(
uint96 lotId_,
uint256,
bool,
bytes calldata
) internal override onlyIfLotExists(lotId_) {
function _onCancel(uint96 lotId_, uint256, bool, bytes calldata) internal override {
// Mark the lot as inactive to prevent further actions
DTLConfiguration storage config = lotConfiguration[lotId_];
config.active = false;
Expand All @@ -243,7 +238,7 @@ abstract contract BaseDirectToLiquidity is BaseCallback {
uint256 curatorPayout_,
bool,
bytes calldata
) internal override onlyIfLotExists(lotId_) {
) internal override {
// Update the funding
DTLConfiguration storage config = lotConfiguration[lotId_];
config.lotCuratorPayout = curatorPayout_;
Expand Down Expand Up @@ -294,7 +289,7 @@ abstract contract BaseDirectToLiquidity is BaseCallback {
uint256 proceeds_,
uint256 refund_,
bytes calldata callbackData_
) internal virtual override onlyIfLotExists(lotId_) {
) internal virtual override {
DTLConfiguration memory config = lotConfiguration[lotId_];
address seller;
address baseToken;
Expand Down Expand Up @@ -408,22 +403,6 @@ abstract contract BaseDirectToLiquidity is BaseCallback {
bytes memory callbackData_
) internal virtual returns (ERC20 poolToken);

// ========== MODIFIERS ========== //

modifier onlyIfLotDoesNotExist(uint96 lotId_) {
if (lotConfiguration[lotId_].recipient != address(0)) {
revert Callback_InvalidParams();
}
_;
}

modifier onlyIfLotExists(uint96 lotId_) {
if (!lotConfiguration[lotId_].active) {
revert Callback_InvalidParams();
}
_;
}

// ========== INTERNAL FUNCTIONS ========== //

function _getAmountWithSlippage(
Expand Down
Loading

0 comments on commit 27ecd44

Please sign in to comment.