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
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol";
/// @author Casweeney Ojukwu
contract SavingLending is ERC20 {
address owner;
uint public constant maxTotalSupply = 10000000 * 10 ** 18;
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
contract B {
uint public num;
address public sender;
uint public amount;
address public sender2;
string public name;
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
contract Delegate {
address public owner;
constructor(address _owner) {
owner = _owner;
}
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.1;
import "./Proxiable.sol";
contract ImplementationA is Proxiable {
address public owner;
uint public count;
@casweeney
casweeney / LibCast.sol
Last active September 16, 2022 17:52 — forked from Realkayzee/LibCast.sol
uint256 constant SALARY=20000;
struct Workers{
uint8 count;
string name;
}
library Arithmetic{
function add(uint a,uint b) internal pure returns(uint){
@casweeney
casweeney / cast.sol
Created September 16, 2022 17:51 — forked from Realkayzee/cast.sol
import "./LibCast.sol";
contract Cast{
using Arithmetic for uint;
using Arithmetic for Arithmetic.Workers;
Arithmetic.Workers aw;
uint tem;
@casweeney
casweeney / orderSwap.sol
Last active September 27, 2022 06:09
Smart contract that implements swapping different tokens using order book.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol";
contract Swap {
struct Order {
address orderOwner;
address fromToken;
address toToken;
// SPDX-License-Identifier: MIT
// An example of a consumer contract that relies on a subscription for funding.
pragma solidity ^0.8.7;
import '@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol';
import '@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol';
import '@chainlink/contracts/src/v0.8/ConfirmedOwner.sol';
/**
* Request testnet LINK and ETH here: https://faucets.chain.link/
@casweeney
casweeney / git_workflow_best_practices.md
Created November 28, 2022 08:24 — forked from calaway/git_workflow_best_practices.md
Git Workflow Best Practices

Git Branch Merging Best Practices

  1. After you've selected a feature to work on, create a branch in your local repo to build it in.
    • $ git checkout -b calaway/short_description_of_feature
  2. Implement the requested feature, make sure all tests are passing, and commit all changes in the new branch.
  3. Checkout the master branch locally.
    • $ git checkout master
  4. Pull down the master branch from GitHub to get the most up to date changes from others. If you practice git workflow as described here you should never have a merge conflict at this step.
    • $ git pull origin master
  5. Make sure all tests are passing on master and then checkout your new branch.
  • $ git checkout calaway/short_description_of_feature
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract TypeCasting {
event Converted(address owner, string message);
bytes32 public x = "This is the beginning of Adddddd";
bytes32 public value = "100";
string public y = "This is the beginning of Adddddd";