Skip to content

Instantly share code, notes, and snippets.

View CarsonCase's full-sized avatar

Carson Case CarsonCase

  • Paxos Labs
View GitHub Profile
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IERC1155.sol";
import "./IERC1155Receiver.sol";
import "./extensions/IERC1155MetadataURI.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/introspection/ERC165.sol";
@CarsonCase
CarsonCase / contracts...HelloWorld.sol
Created December 20, 2023 08:46
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.22+commit.4fc1097e.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract HelloWorld {
string public str;
constructor(){
str = "Hello World";
}
@CarsonCase
CarsonCase / gist-4e80e1565dc77afeccc7d87feb0eb250...contracts...Challenge.sol
Created December 20, 2023 09:53
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.22+commit.4fc1097e.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
CHALLENGE
Replace the green comments below with the correct data type to get the code to run
and set result = 5
NOTE you won't need to use this but below there's uint(int256()) this is type casting. And it converts types to eachother. using uint256() on a int256 will convert it to a uint
@CarsonCase
CarsonCase / contracts...OwnerOnly.sol
Created December 27, 2023 22:07
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.22+commit.4fc1097e.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract OwnerOnly {
address owner;
constructor() {
owner = msg.sender;
}
@CarsonCase
CarsonCase / contracts...Functions.sol
Created December 28, 2023 17: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.22+commit.4fc1097e.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract Functions {
string public str;
/// NOTE if you're having a hard time reading the output in remix look at the last function for a way to make it easier.
// A constructor is technically a function too! Just a special one
@CarsonCase
CarsonCase / contracts...ViewPure.sol
Created January 4, 2024 20:00
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.22+commit.4fc1097e.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
Demo of state-changing functions, view and pure functions
**/
contract ViewPure {
uint price;
@CarsonCase
CarsonCase / contracts...KingOfTheHill.sol
Created January 6, 2024 23: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.8.22+commit.4fc1097e.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;
contract KingOfTheHill {
address public king;
uint public highestPaid;
function pay() external payable{
@CarsonCase
CarsonCase / contracts...ERC20.sol
Created January 10, 2024 01: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.22+commit.4fc1097e.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;
contract KingOfTheHill {
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
function name() public view returns (string memory){
{
"eth": {
"token": {
"WETH": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"WEETH": "0xCd5fE23C85820F7B72D0926FC9b05b43E359b7ee",
"apxETH": "0x9Ba021B0a9b958B5E75cE9f6dff97C7eE52cb3E6",
"pxETH": "0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6",
"pufETH": "0xD9A442856C234a39a81a089C06451EBAa4306a72",
"wstETH": "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0",
"stETH": "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84",