- OP Stack Documentation
- Optimism Bedrock Specs, relevant parts are:
- Overview
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.13; | |
// From https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol | |
import {ERC20} from './ERC20.sol'; | |
contract Vault is ERC20 { | |
// Underlying asset | |
ERC20 public token; |
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.13; | |
import "forge-std/Test.sol"; | |
import "../../contracts/LSP0ERC725Account/LSP0ERC725Account.sol"; | |
contract Implementation { | |
// _pendingOwner is at slot 3 for LSP0ERC725Account | |
bytes32[3] __gap; | |
address _pendingOwner; |
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.19; | |
library Execution { | |
function functionCallWithValue( | |
address to, | |
uint256 value, | |
bytes memory data | |
) internal returns (bytes memory) { | |
assembly { |
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.13; | |
import "forge-std/Test.sol"; | |
import "@openzeppelin/contracts/utils/structs/EnumerableMap.sol"; | |
contract EnumerableMapTest is Test { | |
using EnumerableMap for EnumerableMap.AddressToUintMap; | |
EnumerableMap.AddressToUintMap map; |
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.0; | |
import "solmate/tokens/ERC20.sol"; | |
contract MockERC20Fee is ERC20 { | |
// 2% fee for all transfers | |
uint256 internal feeRate = (2 / 100) * 1 ether; | |
constructor( | |
string memory name_, |