Skip to content

Instantly share code, notes, and snippets.

View fredlacs's full-sized avatar

fredlacs

View GitHub Profile
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity ^0.8.0;
import { ISignatureValidatorConstants, ISignatureValidator } from "https://github.com/gnosis/safe-contracts/blob/v1.3.0/contracts/interfaces/ISignatureValidator.sol";
import { IERC721 } from "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.5.0/contracts/token/ERC721/IERC721.sol";
enum Flag { Nil, Validated, NotValidated }
/// @notice allows a 1 of 1 gnosis safe to be controlled by a NFT
@fredlacs
fredlacs / contracts...destroy.sol
Last active December 8, 2021 11:02
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.7+commit.e28d00a7.js&optimize=false&runs=200&gist=fdca67f3fb1325b4a85c4723dd9694cf
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
contract Caller {
uint256 flag = 0;
event InsideBeforeDelegate();
event InsideAfterDelegate();
event OutsideAfterAllWtf();
@fredlacs
fredlacs / contracts...BlockHashRelay.sol
Last active August 30, 2022 11:20
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.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
contract L1Sender {
address payable immutable l2Receiver;
constructor(address _l2Receiver) {
l2Receiver = payable(_l2Receiver);
}
@fredlacs
fredlacs / contracts...test1.sol
Created August 31, 2021 15:29
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.6.11+commit.5ef660b1.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.6.11;
library AddressAliasHelper {
uint160 constant offset = uint160(0x1111000000000000000000000000000000001111);
/// @notice Utility function that converts the msg.sender viewed in the L2 to the
/// address in the L1 that submitted a tx to the inbox
@fredlacs
fredlacs / contracts...L1Contract.sol
Created August 30, 2021 13:36
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.6.11+commit.5ef660b1.js&optimize=false&runs=200&gist=
pragma solidity ^0.6.11;
import "./ArbSys.sol";
import "./IInbox.sol";
contract L1Contract {
address constant ARBSYS_ADDR = address(0x0000000000000000000000000000000000000064);
address inbox;
event WithdrawalCreated(uint256 amount, uint256 indexed id);
@fredlacs
fredlacs / FredCoin.sol
Created February 24, 2018 19:15 — forked from anonymous/FredCoin.sol
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.20+commit.3155dd80.js&optimize=false&gist=
pragma solidity ^0.4.0;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;