Skip to content

Instantly share code, notes, and snippets.

View bluenights004's full-sized avatar

Ocean_Sky bluenights004

View GitHub Profile
@bluenights004
bluenights004 / lineofcredit.sol
Created May 5, 2023 04:26
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.0;
contract SimpleLineOfCredit {
/// @notice - positions ids of all open credit lines.
/// @dev - may contain null elements
bytes32[] public ids;
/// @notice id -> position data
mapping(bytes32 => Credit) public credits;
@bluenights004
bluenights004 / contracts...gettersetter.sol
Created January 8, 2023 14:16
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.17+commit.8df45f5f.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
contract gettersandsetters {
// Declare variables
uint256 public myUint;
int public myInt;
string public myString;
@bluenights004
bluenights004 / tests...attack.sol
Created December 23, 2022 09:56
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.17+commit.8df45f5f.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
import "./Auction.sol";
contract Attacker{
Auction auction;
constructor(Auction _auctionaddr){
auction = Auction(_auctionaddr);
}