Skip to content

Instantly share code, notes, and snippets.

View wrightkhlebisol's full-sized avatar
🎯
Focusing

Wright wrightkhlebisol

🎯
Focusing
View GitHub Profile
@wrightkhlebisol
wrightkhlebisol / BlockID...AccountsFactory.sol
Created August 17, 2022 17: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.15+commit.e14f2714.js&optimize=true&runs=100000&gist=
// SPDX-License-Identifier: Unlicensed
pragma solidity 0.8.15;
import "./RelationshipManager.sol";
contract AccountsFactory {
/*
* We deploy new contracts for each user and then call those contracts method,
that way events and state changes can easily be managed
@wrightkhlebisol
wrightkhlebisol / TestHash.sol
Created August 17, 2022 11: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.8.15+commit.e14f2714.js&optimize=true&runs=100000&gist=
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;
contract TestHash{
function HashAddressAndTokenId(
address tokenAddress,
uint256 tokenId
) external view returns(bytes32) {
// return bytes(msg.sender, tokenAddress, tokenId);
return keccak256(abi.encodePacked(msg.sender, tokenAddress, tokenId));
@wrightkhlebisol
wrightkhlebisol / recover.sol
Created March 22, 2022 22: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.5.17+commit.d19bba13.js&optimize=true&runs=100000&gist=
pragma solidity ^0.5.0;
contract Verify {
address public importantAddress;
constructor (address _importantAddress) public {
importantAddress = _importantAddress;
}
@wrightkhlebisol
wrightkhlebisol / solidity_resources.txt
Last active March 22, 2022 22:25
Links to resources i find very useful in Solidity
https://medium.com/@libertylocked/what-are-abi-encoding-functions-in-solidity-0-4-24-c1a90b5ddce8 -> Explains abi.encode functions and how to deduce the returned data
https://kermankohli.substack.com/p/how-to-become-a-defi-developer?utm_source=url&s=r -> How to become a DEFI developer
https://github.com/TrueFiEng/Waffle/issues/95 -> Fix revertedWith() issue in hardhat using hardhat-waffle
https://programtheblockchain.com/posts/2018/02/17/signing-and-verifying-messages-in-ethereum/ -> Sign Messages in Ethereum
@wrightkhlebisol
wrightkhlebisol / CheckInterface.sol
Created January 28, 2022 08:12
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.0+commit.c7dfd78e.js&optimize=true&runs=100000&gist=
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
/// @title Contract to check that a given address is an NFT
/// @notice Returns integer type representing the position of the returned value from the tokenType enum
@wrightkhlebisol
wrightkhlebisol / verify.txt
Created July 31, 2021 10:29
3Box Verification
This post links my 3Box profile to my Github account! Web3 social profiles by 3Box.
✅ did:3:bafyreig7sd74m4wd6cgzf4bokcvhmbxefvsoacn2qbzyfm5zwrwrbv5ci4 ✅
Create your profile today to start building social connection and trust online at https://3Box.io/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../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
* specific functions.
*
@wrightkhlebisol
wrightkhlebisol / requestDataSingleNode.sol
Created January 9, 2021 06:03
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.12+commit.27d51765.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.6.0;
import "https://github.com/smartcontractkit/chainlink/blob/develop/evm-contracts/src/v0.6/ChainlinkClient.sol";
contract ChainlinkExample is ChainlinkClient {
uint256 public currentPrice;
address public owner;
address public ORACLE_ADDRESS = 0x2f90A6D021db21e1B2A077c5a37B3C7E75D15b7e;
pragma solidity ^0.5.0;
contract Base {
uint public num;
address public sender;
function setNum(uint _num) public {
num = _num;
sender = msg.sender;
}