Skip to content

Instantly share code, notes, and snippets.

View Amxx's full-sized avatar

Hadrien Croubois Amxx

View GitHub Profile
@Amxx
Amxx / project...ERC1363Upgradeable.sol
Last active September 30, 2023 17:04
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.21+commit.d9974bed.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
import { IERC165Upgradeable, ERC165Upgradeable } from "./ERC165Upgradeable.sol";
import { IERC1363Upgradeable } from "./IERC1363Upgradeable.sol";
contract ERC1363Upgradeable is IERC1363Upgradeable, ERC165Upgradeable {
function supportsInterface(bytes4 id) public view virtual override returns (bool) {
return id == type(IERC1363Upgradeable).interfaceId || super.supportsInterface(id);
}
@Amxx
Amxx / UniversalWrapper.sol
Last active August 9, 2023 08:08
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: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/interfaces/IERC20.sol";
import "@openzeppelin/contracts/interfaces/IERC721.sol";
import "@openzeppelin/contracts/interfaces/IERC721Receiver.sol";
import "@openzeppelin/contracts/interfaces/IERC1155.sol";
import "@openzeppelin/contracts/interfaces/IERC1155Receiver.sol";
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
@Amxx
Amxx / FullTestContract.sol
Last active February 8, 2022 16:28
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: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/proxy/Clones.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/StorageSlot.sol";
contract FullTestContract {
event ValueBool(string descr, bool value);
process.stdin.setEncoding('utf-8');
const readline = require('readline').createInterface({ input: process.stdin });
const buffer = [];
const uniqueBy = (array, selector) => array
.map(selector)
.filter((e, i, a) => a.indexOf(e) === i)
.map(v => array.find(e => selector(e) === v));
pragma solidity ^0.6.0;
interface IERC20
{
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);

Keybase proof

I hereby claim:

  • I am amxx on github.
  • I am amxx (https://keybase.io/amxx) on keybase.
  • I have a public key ASCpx2xqZIp0Tx-Mi0azHN7k2zI-5ndrXSCszQ-VYCyFeQo

To claim this, I am signing this object:

@Amxx
Amxx / App.sol
Created June 12, 2019 19: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.5.9+commit.e560f70d.js&optimize=true&gist=
pragma solidity ^0.5.8;
import "./Ownable.sol";
contract App is Ownable
{
/**
* Members
*/
string public m_appName;