Skip to content

Commit

Permalink
feat: add ethernaut lvl 19
Browse files Browse the repository at this point in the history
  • Loading branch information
leovct committed Sep 25, 2024
1 parent dea971f commit d8efab7
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/EthernautCTF/AlienCode.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.5.0;

import '@openzeppelin-05/ownership/Ownable.sol';

contract AlienCodex is Ownable {
bool public contact;
bytes32[] public codex;

modifier contacted() {
assert(contact);
_;
}

function makeContact() public {
contact = true;
}

function record(bytes32 _content) public contacted {
codex.push(_content);
}

function retract() public contacted {
codex.length--;
}

function revise(uint256 i, bytes32 _content) public contacted {
codex[i] = _content;
}
}

0 comments on commit d8efab7

Please sign in to comment.