Skip to content

Instantly share code, notes, and snippets.

@bertil291utn
Created August 15, 2022 16:52
Show Gist options
  • Save bertil291utn/38b7743fc98e7de212dd500bda2fa4e7 to your computer and use it in GitHub Desktop.
Save bertil291utn/38b7743fc98e7de212dd500bda2fa4e7 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.10+commit.fc410830.js&optimize=false&runs=200&gist=
pragma solidity 0.8.10;
// The goal of this challenge is to be able to sign offchain a message
// with an address stored in winners.
contract Challenge{
address[] public winners;
bool lock;
function exploit_me(address winner) public{
lock = false;
msg.sender.call("");
require(lock);
winners.push(winner);
}
function lock_me() public{
lock = true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment