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.18; | |
import {IEntryPoint, UserOperation} from "@aa/core/BaseAccount.sol"; | |
import "@kinto-core/interfaces/IKintoWallet.sol"; | |
import {MigrationHelper} from "@kinto-core-script/utils/MigrationHelper.sol"; | |
import {stdJson} from "forge-std/StdJson.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
function extsload(bytes32 slot) external view returns (bytes32 value) { | |
/// @solidity memory-safe-assembly | |
assembly { | |
value := sload(slot) | |
} | |
} | |
function extsload(bytes32 startSlot, uint256 nSlots) external view returns (bytes memory) { | |
bytes memory value = new bytes(32 * nSlots); |
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.1; | |
/** | |
* @title NoMevProxy | |
* @dev Invokes a staticcall to an address from OFAC list to block MEV | |
*/ | |
contract NoMevProxy { | |
address immutable implementation; |
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.1; | |
/** | |
* @title ShutUpAndTakeMyMoney | |
* @dev Force target to accept msg.value amount of ETH | |
* https://docs.soliditylang.org/en/v0.8.13/introduction-to-smart-contracts.html?highlight=selfdestruct#deactivate-and-self-destruct | |
*/ | |
contract ShutUpAndTakeMyMoney { |
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
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v4.3/contracts/access/Ownable.sol"; | |
pragma solidity 0.8.0; | |
contract StorageBug is Ownable { | |
function write() onlyOwner external { | |
uint256[] storage arr; | |
arr.push(1); | |
} |
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
/** | |
* Can't await on transactionSend because it will never resolve due to | |
* automine disabled. Save a promise instead and resolve it later. | |
* Should set gasLimit on txs because default gasLimit is blockGasLimit. | |
* promise = signer.sendTransaction({ | |
* to: signer.address, | |
* value: 1, | |
* }); | |
* const txReceipt = await promise; | |
* @param {func} Lambda to run within the same block. |
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
const { expect } = require('chai'); | |
const { ethers } = require('hardhat'); | |
const { ONE_DAY_IN_SECONDS } = require('../../utils/constants'); | |
const { increaseTime, getTimestamp, mineInBlock } = require('./test-helpers'); | |
describe('Test Helpers', function () { | |
beforeEach(async () => {}); | |
it.only('can mine multiple transactions within the same block', async function () { |
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
const { ethers } = require('hardhat'); | |
/** | |
* Advance blockchain time by value. Has a random chance to deviate by 1 second. | |
* Consider this during tests. Use `closeTo`. | |
* @param {number} value - Amount of time to advance time by. | |
*/ | |
async function increaseTime(value) { | |
if (!ethers.BigNumber.isBigNumber(value)) { | |
value = ethers.BigNumber.from(value); |
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
pragma solidity ^0.5.0; | |
contract Fomo3d { | |
address public winner; | |
bool public gameover; | |
function win(address contender) public { | |
winner = contender; | |
} | |
} |
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
(![] + [])[+[]] + | |
(![] + [])[+!+[]] + | |
([![]] + [][[]])[+!+[] + [+[]]] + | |
(![] + [])[!+[] + !+[]]; |
NewerOlder