Skip to content

Instantly share code, notes, and snippets.

View Vectorized's full-sized avatar
🎡

Vectorized Vectorized

🎡
View GitHub Profile
@Vectorized
Vectorized / RareSkills zk Bootcamp Testimonial.md
Last active February 3, 2024 07:42
RareSkills zk Bootcamp Testimonial

If you have ever felt FOMO from all the zk moon math talk, just take RareSkills zk bootcamp.

Yes, they have published superb free public reading materials, but you will learn much better with live, well-paced customized lessons, and the 1:1 homework feedback.

Even if you do not have concrete plans to use zk in your professional work, the zk bootcamp will help you achieve a much deeper understanding and appreciation of the EVM ecosystem in general.

Take the dive.

@Vectorized
Vectorized / MiladyRaveMaker.sol
Last active October 21, 2023 00:38
MiladyRaveMaker
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/access/Ownable.sol";
import "erc721a/contracts/ERC721A.sol";
import "erc721a/contracts/extensions/ERC721AQueryable.sol";
import "solady/src/utils/ECDSA.sol";
import "solady/src/utils/LibString.sol";
import "solady/src/utils/SafeTransferLib.sol";
@Vectorized
Vectorized / Sprinkly.sol
Last active August 3, 2022 02:04
Sprinkly Headers
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;
library SafeTransferLib {
/*´:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:*/
/* CUSTOM ERRORS */
/*.•°:°.´•˚.*°.˚:*.´•*.•°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´•*.•*/
error ETHTransferFailed();
@Vectorized
Vectorized / Multicallable.sol
Last active July 24, 2022 18:40
Multicallable
// SPDX-License-Identifier: MIT
// Author: vectorized.eth
pragma solidity ^0.8.4;
// Normal Solidity: 45845
// Yul: 45350
abstract contract Multicallable {
function multicall(bytes[] calldata data) public payable returns (bytes[] memory results) {
assembly {
results := mload(0x40)
@Vectorized
Vectorized / MappingTester.sol
Created June 22, 2022 17:09
Mapping Gas Tests
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;
import "@openzeppelin/contracts/utils/structs/BitMaps.sol";
contract MappingTester {
using BitMaps for BitMaps.BitMap;
mapping(uint256 => bool) public map;
mapping(address => bool) public addrMap;
@Vectorized
Vectorized / LibString.sol
Last active June 16, 2023 08:51
Solidity String Replace
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
library LibString {
function replace(
string memory subject,
string memory search,
string memory replacement
) internal pure returns (string memory result) {
assembly {
@Vectorized
Vectorized / Summary.md
Last active July 12, 2022 10:04
Vyper vs Solidity Gas Benchmarks

Vyper vs Solidity Gas Benchmarks

Summary

EDCSA.recover(bytes32 hash, bytes calldata signature)

Solidity: 26869
Vyper: 27729

Note that the Solidity version has the added functionality:

@Vectorized
Vectorized / YulSnippets.sol
Last active April 29, 2023 21:55
Solidity Yul Assembly Snippets
// SPDX-License-Identifier: MIT
// Author: vectorized.eth
pragma solidity ^0.8.0;
pragma abicoder v2;
// DISCLAIMER:
// This is experimental software and is provided on an "as is" and "as available" basis.
// We do not give any warranties and will not be liable for any loss incurred through any use of this codebase.
library Base64 {
@Vectorized
Vectorized / ToStringExamples.sol
Last active May 18, 2022 06:16
Solidity uint256 to string (base10)
// SPDX-License-Identifier: MIT
// Author: vectorized.eth
pragma solidity ^0.8.0;
pragma abicoder v2;
contract ToStringExamples {
constructor() {}
function toStringOriginal(uint256 value) public pure returns (string memory) {