-
Notifications
You must be signed in to change notification settings - Fork 0
/
Calyptus396.sol
34 lines (28 loc) · 925 Bytes
/
Calyptus396.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// SPDX-License-Identifier:MIT
pragma solidity ^0.8.20;
//https://x.com/CalyptusCareers/status/1803703513970610512
//What are the potential security vulnerabilities in this smart contract?
contract MysticalVault {
struct Signature {
bytes32 hash;
uint8 v;
bytes32 r;
bytes32 s;
}
mapping (bytes32 => bool) public lapsed;
address owner = address(0xFACE);
function redeem (Signature[] calldata sigs) public {
for (uint i = 0; i < 4; i++) {
Signature calldata sig = sigs[i];
// Verify every signature
require(
owner == ecrecover (sig.hash, sig.v, sig.r, sig.s),
"Invalid signature"
);
require(!lapsed[sig.hash], "signature lapsed");
lapsed[sig.hash] = true;
}
payable(msg. sender). transfer(address(this).balance);
}
receive() external payable {}
}