Skip to content

Instantly share code, notes, and snippets.

View DAVEALLCAPS's full-sized avatar

CAPS LOCK DAVE DAVEALLCAPS

View GitHub Profile
@DAVEALLCAPS
DAVEALLCAPS / TrusterLenderPoolAddOn.sol
Created February 2, 2023 01:36
TrusterAttacker contract
contract TrusterAttacker {
TrusterLenderPool public immutable pool;
ERC20 public immutable token;
constructor(address _pool, address _token) {
pool = TrusterLenderPool(_pool);
token = ERC20(_token);
}
function fakeLoan() external {
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
@DAVEALLCAPS
DAVEALLCAPS / TrusterLenderPool.sol
Created January 30, 2023 23:55
Challenge #3 of DVDFi v3.0.0
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "../DamnValuableToken.sol";
/**
* @title TrusterLenderPool
@DAVEALLCAPS
DAVEALLCAPS / Delegation.sol
Created January 30, 2023 21:03
The goal of this level is for you to claim ownership of the instance you are given.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract Delegate {
address public owner;
constructor(address _owner) {
owner = _owner;
}