Skip to content

Instantly share code, notes, and snippets.

View KcPele's full-sized avatar
🏠
Working from home

Kc pele KcPele

🏠
Working from home
View GitHub Profile
@KcPele
KcPele / Blockgames Task - Web3 Proposal - by Kelechi Ndukwe - Kcpele
Created March 17, 2022 11:09
Blockgames Task - Web3 Proposal - by Kelechi Ndukwe - Kcpele
Blockgames Task - Web3 Proposal - by Kelechi Ndukwe - Kcpele
Introduction
With the rapid development of cryptocurrencies such as Bitcoin and the application of blockchain technology in industries such as finance,
Internet of things (IoT), cloud computing and supply-chain, blockchain has gradually attracted global attention
Blockchain provides a programmable environment for smart contracts as an emerging technology with great potential.
Taking advantage of blockchain, smart contract has been widely used in blockchain.
Smart contract can not only change the existing business model, but also bring a lot of convenience to public life in reality.
Main Content
@KcPele
KcPele / contracts...UploadFileContract.sol
Created April 12, 2022 06:47
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=true&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.7;
contract Upload {
//task: upload files, retreive, share
//@geting the data format
struct DataFormat {
@KcPele
KcPele / contracts...DutchAuction.sol
Created April 12, 2022 08:15
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.7;
interface IERC721 {
function transferFrom(address _from, address _to, uint _nftId) external;
}
contract DutchAuction {
uint private constant DURATION = 7 days;
@KcPele
KcPele / eslintrc.js
Created May 25, 2022 05:36 — forked from adrianhajdin/eslintrc.js
ESLint Configuration
// eslintrc.js
module.exports = {
env: {
browser: true,
es6: true,
},
extends: [
'plugin:react/recommended',
'airbnb',
],
@KcPele
KcPele / graphql-cheat-sheet.md
Created June 11, 2022 13:11 — forked from jbritton/graphql-cheat-sheet.md
GraphQL Cheat Sheet

GraphQL Cheat Sheet

Overview

  • An alternative approach to RESTful APIs
  • Clients issue queries/mutations to read and update data
  • Clients can fetch only the entity fields that are required
  • GraphQL query syntax can express complex entity relations => nested objects
  • Mitigates the explosion of RESTful endpoints in scenarios where many different representations of an entity are needed
  • Graphiql is a query execution UI, also provides good documentation
@KcPele
KcPele / main.dart
Created October 7, 2022 05:29
task1
void main() {
//setting the range of numbers to generate
int num = 30;
//the for loop is generating the numbers from 1 to 30 inclusive that is why i added 1 to 30
for (int i = 1; i < num + 1; i++) {
if(i % 2 != 0){
print(i);
} else if (i == num){
print("The number is at $i");
}
@KcPele
KcPele / main.dart
Created October 28, 2022 23:16
hngi9
class Circle {
static const pie = 3.142;
double Radius;
String Color;
Circle.noValues() : Radius = 1, Color="red";
Circle.onlyRadius(this.Radius) : Color = "red";
@KcPele
KcPele / ERC1155...ERC1155.sol
Created August 16, 2023 07:10
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.18+commit.87f61d96.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
error ERC1155__AddressZero();
error ERC1155__AccountAndIdNotSameLength();
error ERC1155__InsufficientBalance();
error ERC1155__ReceiverNotImplemented();
error ERC1155__MsgSenderIsNotOwner();
@KcPele
KcPele / ERC-6551...ERC6551Account.sol
Created August 16, 2023 07:11
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.18+commit.87f61d96.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/interfaces/IERC1271.sol";
import "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
import "./lib/Bytecode.sol";
import "./interface/IERC6551Account.sol";
@KcPele
KcPele / ERC721...ERC721Contract.sol
Created August 16, 2023 07:11
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.18+commit.87f61d96.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
/// @title ERC-721 Non-Fungible Token Standard
/// @dev See https://eips.ethereum.org/EIPS/eip-721
/// Note: the ERC-165 identifier for this interface is 0x80ac58cd.
interface ERC721 /* is ERC165 */ {
event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId);