This file contains 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
function verifyTransfer(address _from, address _to, uint256 _amount) public view returns (bool success) { | |
return true; | |
} | |
/** | |
* @dev Overloaded version of the transfer function | |
*/ | |
function transfer(address _to, uint256 _value) public returns (bool success) { | |
require(verifyTransfer(msg.sender, _to, _value)); | |
return super.transfer(_to, _value); |
This file contains 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
143 | 0x2b6dc8362f76df34f493497a64df7d627720b8df | |
---|---|---|
708 | 0x917eccf1bef46a829d2067fae540736120e15a56 | |
152 | 0x3967b417ad03585c031f987341bf9a4565fce021 | |
846 | 0xd508c806157976aedbf94493c1f266f2142dadc4 | |
0 | 0xee8e50710d670e92a4373e77c163bfba1675464e | |
873 | 0x25c26fa100d21ffa4b6df1b4f15ed01cb1884a5d | |
860 | 0x4ec56b9c34d09dc6805b19cd24da495269f2cc9c | |
989 | 0x8ed097af0cb9d5551fb68ff3e01e01473ca18443 | |
709 | 0xc4011b89a7ec6d913e93811e651fa1408fa294f6 | |
187 | 0x6f41770d4d065de774d1a0bfb77b98eeb02f7f3e |
This file contains 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
// https://ethernaut.zeppelin.solutions/level/0xf70706db003e94cfe4b5e27ffd891d5c81b39488 | |
// How to test this: | |
// 1. Deploy Reentrance contract. Take note of the address. | |
// 2. With the same account, call donate() and send 1 ether. | |
// 3. With a second account, deploy Exploit contract and pass Reentrance address. | |
// 4. Call attack(), sending 0.1 ether. | |
// 5. Call ethBalance() to check Reentrance ether balance, should be 0. | |
// 6. Call ethBalance() to check Exploit balance, should be 1 ether | |
// 7. Call kill() to selfdestruct Exploit and get the 1 ether forwarded to attacker account. |
This file contains 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
// Once the auction end has been reached, we distribute the ether. | |
function finalizeAuction() public { | |
require (now > auctionEndTime); | |
require (!auctionFinalized); | |
auctionFinalized = true; | |
if(highestBidder == address(0)){ | |
//If no one bid at the auction, auctioneer can withdraw the funds. | |
balances[auctioneer] = auctionedEth; | |
}else{ |
This file contains 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
//Anyone can bid by calling this function and supplying the corresponding eth | |
function bid() public payable { | |
require(auctionStarted); | |
require(now < auctionEndTime); | |
require(msg.sender != auctioneer); | |
require(highestBidder != msg.sender); //If sender is already the highest bidder, reject it. | |
address _newBidder = msg.sender; | |
uint previousBid = balances[_newBidder]; |
This file contains 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
// The auctioneer has to call this function while supplying the 1th to start the auction | |
function startAuction() public payable{ | |
require(!auctionStarted); | |
require(msg.sender == auctioneer); | |
require(msg.value == (1 * 10 ** 18)); | |
auctionedEth = msg.value; | |
auctionStarted = true; | |
auctionEndTime = now + (3600 * 24 * 7); // Ends 7 days after the deployment of the contract | |
E_AuctionStarted(msg.sender,now, auctionEndTime); |
This file contains 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
pragma solidity ^0.4.18; | |
contract EtherAuction { | |
// The address that deploys this auction and volunteers 1 eth as price. | |
address public auctioneer; | |
uint public auctionedEth = 0; | |
uint public highestBid = 0; | |
uint public secondHighestBid = 0; |
This file contains 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
pragma solidity ^0.4.4; | |
import "./usingOraclize.sol"; | |
contract Raffle is usingOraclize{ | |
function Raffle(){ | |
scheduleRandomNumOnCreation(1000); | |
This file contains 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
0x0fC20E774EA6674087494a36F8F8f09a4Ee3a131 |