Skip to content

Commit

Permalink
fix: onlyvaultCreator
Browse files Browse the repository at this point in the history
  • Loading branch information
scolear committed Jul 1, 2024
1 parent 045e9ad commit ec192c7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
7 changes: 3 additions & 4 deletions contracts/DLCManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,8 @@ contract DLCManager is
_;
}

modifier onlyOwner(bytes32 _uuid) {
if (dlcs[dlcIDsByUUID[_uuid]].protocolContract != msg.sender)
revert NotOwner();
modifier onlyVaultCreator(bytes32 _uuid) {
if (dlcs[dlcIDsByUUID[_uuid]].creator != msg.sender) revert NotOwner();
_;
}

Expand Down Expand Up @@ -398,7 +397,7 @@ contract DLCManager is
function withdraw(
bytes32 uuid,
uint256 amount
) external onlyOwner(uuid) whenNotPaused {
) external onlyVaultCreator(uuid) whenNotPaused {
DLCLink.DLC storage dlc = dlcs[dlcIDsByUUID[uuid]];

// Validation checks
Expand Down
4 changes: 2 additions & 2 deletions deploymentFiles/arbsepolia/DLCManager.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"network": "arbsepolia",
"updatedAt": "2024-07-01T10:23:31.606Z",
"gitSHA": "2c4c17b",
"updatedAt": "2024-07-01T10:52:06.188Z",
"gitSHA": "045e9ad",
"contract": {
"name": "DLCManager",
"address": "0xE8FA6399d1b60968f04888F23Ed13Ed499C1Fd51",
Expand Down
4 changes: 0 additions & 4 deletions scripts/migrate-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,6 @@ async function main() {
]);
}

// if ready, valueLocked should be 0
// if funded, valueMinted should be valueLocked
// if closed do nothing

for (const vault of allVaults) {
switch (vault.status) {
case 0:
Expand Down

0 comments on commit ec192c7

Please sign in to comment.