Skip to content

Instantly share code, notes, and snippets.

View casweeney's full-sized avatar
👨‍💻
Building Platforms

Coding Cas casweeney

👨‍💻
Building Platforms
View GitHub Profile
@casweeney
casweeney / Safemoon.sol
Created December 15, 2022 22:51
This is a well commented safemoon token contract for easy understanding
/**
#BEE
#LIQ+#RFI+#SHIB+#DOGE = #BEE
#SAFEMOON features:
3% fee auto add to the liquidity pool to locked forever when selling
2% fee auto distribute to all holders
I created a black hole so #Bee token will deflate itself in supply with every transaction
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
contract StakingRewards {
IERC20 public immutable stakingToken;
IERC20 public immutable rewardsToken;
address public owner;
// Duration of rewards to be paid out (in seconds)
@casweeney
casweeney / AtomicStaking.sol
Last active February 21, 2023 23:25
Staking Rewards contract with multiple staking positions for a particular user (address)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import "./IERC20.sol";
contract AtomicStaking {
IERC20 public rewardToken;
IERC20 public stakingToken;
address owner;
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
// original code
// https://github.com/optionality/clone-factory/blob/master/contracts/CloneFactory.sol
contract MinimalProxy {
function clone(address target) external returns (address result) {
// convert address to 20 bytes
bytes20 targetBytes = bytes20(target);
#![cfg_attr(not(feature = "std"), no_std, no_main)]
#[ink::contract]
mod setter_getter_contract {
use ink::prelude::string::String;
/// Defines the storage of your contract.
/// Add new fields to the below struct in order
/// to add new static storage fields to your contract.
#[ink(storage)]
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol";
contract StakingToken is ERC20("Staking Token", "STK") {
address public owner;
constructor() {
owner = msg.sender;
{
"message": "Completed Successfully",
"status": true,
"data": {
"banks": [
{
"bankCode": "090267",
"bankName": "Kuda."
},
{
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
contract FractionalNft is ERC20, Ownable, ERC20Permit, ERC721Holder {
IERC721 public collection;
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract HooziNFT is ERC721, Ownable {
constructor() ERC721("HooziNFT", "HOZ") Ownable(msg.sender) {}
function safeMint(address to, uint256 tokenId) public onlyOwner {
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract SaveEther {
mapping(address => uint256) savings;
event SavingSuccessful(address indexed user, uint256 indexed amount);
function deposit() external payable {
require(msg.sender != address(0), "wrong EOA");