Skip to content

Commit

Permalink
build: dutch auction and factory (#36)
Browse files Browse the repository at this point in the history
* build: auction swapper

* build: auction factory

* fix: transfer to specific address

* chore: comments

* build: factory fixes

* chore: auction tweaks

* test: auction

* chore: add reentrancy gaurd

* fix: uni swapper

* build: callback

* feat: add callback

* test: swapper

* fix: small fixes

* fix: remove extra check

Co-authored-by: FP <[email protected]>

* feat: fp reviewssssszz

* feat: pack it up

* build: add hook flags

* test: hook flags

* chore: comments

* feat: track enabled auctions

* feat: check decimals and optional index

* chore: deploy

* fix: interface

---------

Co-authored-by: FP <[email protected]>
  • Loading branch information
Schlagonia and fp-crypto authored Feb 23, 2024
1 parent ae73e78 commit d4c3961
Show file tree
Hide file tree
Showing 13 changed files with 2,389 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .solhint.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"not-rely-on-time": "off",
"private-vars-leading-underscore": "off",
"reason-string": ["warn", { "maxLength": 64 }],
"no-console": "off"
"no-console": "off",
"custom-errors": "off"
}
}
36 changes: 36 additions & 0 deletions script/DeployAuctionFactory.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.18;

import "forge-std/Script.sol";

// Deploy a contract to a deterministic address with create2
contract DeployAuctionFactory is Script {

Deployer public deployer = Deployer(0xba5Ed099633D3B313e4D5F7bdc1305d3c28ba5Ed);

function run() external {
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
vm.startBroadcast(deployerPrivateKey);

// Get the bytecode
bytes memory bytecode = abi.encodePacked(vm.getCode("AuctionFactory.sol:AuctionFactory"));

// Pick an unique salt
bytes32 salt = keccak256("Auction Factory");

address contractAddress = deployer.deployCreate2(salt, bytecode);

console.log("Address is ", contractAddress);

vm.stopBroadcast();
}
}

interface Deployer {
event ContractCreation(address indexed newContract, bytes32 indexed salt);

function deployCreate2(
bytes32 salt,
bytes memory initCode
) external payable returns (address newContract);
}
2 changes: 1 addition & 1 deletion src/AprOracle/AprOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {IStrategy} from "@tokenized-strategy/interfaces/IStrategy.sol";

interface IOracle {
function aprAfterDebtChange(
address _asset,
address _strategy,
int256 _delta
) external view returns (uint256);
}
Expand Down
Loading

0 comments on commit d4c3961

Please sign in to comment.