Skip to content

Instantly share code, notes, and snippets.

View ilhamsa1's full-sized avatar
🎯
Focusing

Muhammad Ilham ilhamsa1

🎯
Focusing
View GitHub Profile
@ilhamsa1
ilhamsa1 / .deps...npm...hardhat...console.sol
Created November 30, 2021 10:33
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.4.22 <0.9.0;
library console {
address constant CONSOLE_ADDRESS = address(0x000000000000000000636F6e736F6c652e6c6f67);
function _sendLogPayload(bytes memory payload) private view {
uint256 payloadLength = payload.length;
address consoleAddress = CONSOLE_ADDRESS;
assembly {
@ilhamsa1
ilhamsa1 / votes.sol
Created September 17, 2022 09:23
simple smart contract
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/[email protected]/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
contract ProjectTest is AccessControl {
using Counters for Counters.Counter;
bytes32 public constant ADMIN_ROLE = keccak256("ADMIN");
@ilhamsa1
ilhamsa1 / BatchTransfer.sol
Created April 21, 2025 06:43
ERC20BatchTransfer contract allows batch transfers of ERC-20 tokens with support for gasless transactions using permit, reentrancy protection, and event logging. Includes methods for batch transfer, signed permit, and a simple ping counter with a limit.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";