This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: UNLICENSED | |
pragma solidity ^0.8.15; | |
import "forge-std/Script.sol"; | |
// L1 | |
import { L1CrossDomainMessenger } from "../L1/L1CrossDomainMessenger.sol"; | |
import { L1ERC721Bridge } from "../L1/L1ERC721Bridge.sol"; | |
import { L1StandardBridge } from "../L1/L1StandardBridge.sol"; | |
import { L2OutputOracle } from "../L1/L2OutputOracle.sol"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: [push, pull_request] | |
jobs: | |
check: | |
name: Foundry project | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.13; | |
library InsertionSort { | |
function sort(uint256[] memory list) internal pure { | |
// Algorithm: | |
// | |
// for i = 2 to n do | |
// for j = 1 to i − 1 do // NOTE: we init do an extra sub instead of <= | |
// if A[i] < A[j] then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: UNLICENSE | |
pragma solidity >=0.8.0 <0.9.0; | |
contract Private { | |
function t_() private returns (uint256) { | |
return 1; | |
} | |
function rt() public returns (bytes32 fp) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: Unlicense | |
pragma solidity 0.8.11; | |
type PushArrayPtr is bytes32; | |
library PushArray { | |
function newArray(uint8 len) internal pure returns (PushArrayPtr s) { | |
assembly { | |
// grab free mem ptr, accounting for annoying return adjustment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: UNLICENSE | |
pragma solidity >=0.8.0 <0.9.0; | |
// NOT TESTED - USE AT YOUR OWN RISK | |
// Supports 32 byte word types. Could be easily extended to multiword types by | |
// passing in the size of the elements as well though | |
struct PushableArray { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: Unlicense | |
pragma solidity 0.8.10; | |
import "solmate/tokens/ERC20.sol"; | |
import "solmate/utils/SafeTransferLib.sol"; | |
import "ds-test/test.sol"; | |
contract MerkleTrust is DSTest { | |
using SafeTransferLib for ERC20; |