This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // set up constants for input and output pins | |
| const int redLEDPin = 9; | |
| const int greenLEDPin = 10; | |
| const int blueLEDPin = 11; | |
| const int redSensorPin = A0; | |
| const int greenSensorPin = A1; | |
| const int blueSensorPin = A2; | |
| // add variables for incoming sensor and output values |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // declare global constant variables | |
| const int sensorPin = A0; | |
| const float baselineTemp = 20.0; | |
| void setup() { | |
| // open a serial port connection between the Arduino board and computer | |
| // allowing communication at 9600 bauds (bits per second) | |
| Serial.begin(9600); | |
| // assign digital pins as output and toggle off |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // initialize switch state variable | |
| int switchState = 0; | |
| // setup function runs once: when arduino is powered on | |
| void setup() { | |
| // configure digital pins | |
| pinMode(2, INPUT); | |
| pinMode(3, OUTPUT); | |
| pinMode(4, OUTPUT); | |
| pinMode(5, OUTPUT); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| contract FlashLoanAttacker is IFlashLoanEtherReceiver { | |
| Web3BridgeCXIPool private immutable pool; | |
| constructor(address poolAddress) { | |
| pool = Web3BridgeCXIPool(poolAddress); | |
| } | |
| function attack() external { | |
| pool.flashLoan(address(pool).balance); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: UNLICENSED | |
| pragma solidity ^0.8.13; | |
| import {Test, console2} from "forge-std/Test.sol"; | |
| import {ChallengeTwo, Exploit} from "../src/ChallengeTwo.sol"; | |
| contract ChallengeTwoTest is Test { | |
| ChallengeTwo public challenge; | |
| Exploit public exploit; | |
| uint count; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: MIT | |
| pragma solidity 0.8.26; | |
| interface IVIPBank { | |
| function deposit() external payable; | |
| function addVIP(address addr) external; | |
| function withdraw(uint _amount) external; | |
| } | |
| contract DoS_Attack { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.22; | |
| contract StudentPortal { | |
| address owner; | |
| struct Student { | |
| address walletAddress; | |
| string name; | |
| string email; |
NewerOlder