Skip to content

Instantly share code, notes, and snippets.

View developeruche's full-sized avatar
🤓
Building

Developer Uche developeruche

🤓
Building
View GitHub Profile
[
{
"inputs": [],
"name": "INSUFFICENT_POINTS",
"type": "error"
},
{
"inputs": [],
"name": "INVALID_INPUT",
"type": "error"
{
"abi": [
{
"inputs": [],
"name": "INSUFFICENT_POINTS",
"type": "error"
},
{
"inputs": [],
"name": "INVALID_INPUT",
@developeruche
developeruche / msgData.sol
Created January 6, 2023 06:53
This code snippet shows how to load and manipulated bytes data using assemble
contract MsgData {
function _fromUint(bytes memory data) internal pure returns(uint256 value) {
uint256 value1;
uint256 value2;
assembly {
value1 := mload(add(data, 36))
value2 := mload(add(data, 68))
value := add(value1, value2)
}
@developeruche
developeruche / staking.sol
Created November 21, 2022 23:43
This is the popular staing reward contract
pragma solidity 0.5.17;
/*
____ __ __ __ _
/ __/__ __ ___ / /_ / / ___ / /_ (_)__ __
_\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ /
/___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\
/___/
* Synthetix: StakingRewards.sol
/**
*Submitted for verification at BscScan.com on 2022-07-24
*/
/**
*Submitted for verification at BscScan.com on 2022-06-17
*/
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.8.0;
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.6.11;
Offchain Labs Solidity technical challenge:
Examine the DaoEscrowFarm contract provided.
This is a simple system that allows users to deposit 1 eth per block, and withdraw their deposits in a future date.
The implementation contains many flaws, including lack of optimisations and bugs that can be exploited to steal funds.
For this challenge we would like you to:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
contract MysteryBoxAuction {
address contractOwner;
uint auctionStartTime;
bool auctionInProgress;
address topBidder;
uint topBid;
{
"_format": "hh-sol-artifact-1",
"contractName": "ERC20",
"sourceName": "@openzeppelin/contracts/token/ERC20/ERC20.sol",
"abi": [
{
"inputs": [
{
"internalType": "string",
"name": "name_",
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import {IERC20} from "./interfaces/IERC20.sol";
contract NRFAirdrop {
/// @dev this is the merkle root computed from the valid addresses
bytes32 public merkleRoot = 0x747e8d346a2ec24ba37cef94c739e1157459a01a4002c7fae74874ec131dca6f;
// bytes32 public merkleRoot = 0x514311ffd07d0034858e944ecb905ddc1994886b0a542867dbc7cac7440f108f;
@developeruche
developeruche / Abi.js
Created September 9, 2022 21:27
Airdrop ABI
[
{
"inputs": [
{
"internalType": "uint256",
"name": "_claimAmount",
"type": "uint256"
},
{
"internalType": "address",