Skip to content

Bug fix/gas price #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 76 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
a52830d
untested
yaronvel Nov 3, 2021
80b9119
first test
yaronvel Nov 3, 2021
4e635ae
mock ctoken stub
yaronvel Nov 4, 2021
be3c0c9
tests
yaronvel Nov 4, 2021
28bda20
MockCToken
Nov 4, 2021
b7379ec
cleanUp
Nov 4, 2021
df10908
test tweak
Nov 4, 2021
ed57bfd
improvment
Nov 4, 2021
5534a0f
Merge pull request #26 from backstop-protocol/MockCToken
yaronvel Nov 4, 2021
b2ca8ad
all old tests work
yaronvel Nov 4, 2021
b47b8a4
merge
yaronvel Nov 4, 2021
b785e36
remove .only
yaronvel Nov 4, 2021
a418e87
canLiquidate test
Nov 7, 2021
b128926
fantom tests
yaronvel Nov 9, 2021
2752fe5
Merge pull request #28 from backstop-protocol/fantom-test
yaronvel Nov 9, 2021
7f19c88
working state
Nov 9, 2021
66259d0
merged hundred in
Nov 9, 2021
fcf8f8f
erc20 test
yaronvel Nov 9, 2021
8876c38
Merge pull request #29 from backstop-protocol/fantom-test
yaronvel Nov 9, 2021
2465cc7
bugFIx
Nov 9, 2021
9cebc8e
cleanUp
Nov 9, 2021
2b225d9
cleanUp
Nov 9, 2021
79a9c00
can liquidate with wrong address
Nov 9, 2021
02877d7
add missing awaits
yaronvel Nov 9, 2021
3fd8fdf
Merge pull request #30 from backstop-protocol/fantom-test
yaronvel Nov 9, 2021
945bc91
cleanUp
Nov 9, 2021
3b36226
cleanUp
Nov 9, 2021
41c916b
Merge pull request #27 from backstop-protocol/test/liquidations
yaronvel Nov 9, 2021
d08b56d
emit events
yaronvel Nov 10, 2021
d60fd61
remove todos
yaronvel Nov 10, 2021
7c386f7
fix test revert msg
yaronvel Nov 10, 2021
c448656
keeper test
yaronvel Nov 16, 2021
b4ceba2
keeper test
yaronvel Nov 18, 2021
492a60b
new comptroller
yaronvel Nov 22, 2021
23a25de
example liquidation bot
yaronvel Nov 23, 2021
4dcce8f
working state
Nov 28, 2021
6763022
Merge pull request #31 from backstop-protocol/liquidator_bot
yaronvel Nov 28, 2021
83bc8f6
added a bKeeper bot
Dec 5, 2021
7170432
fix
Dec 5, 2021
50fc4eb
testing the bKeeper preoform using hardhat
Dec 5, 2021
a439f9f
semantics
Dec 5, 2021
153fecf
compiles
yaronvel Dec 12, 2021
86a5abf
remove eth strings
yaronvel Dec 12, 2021
a04cd6e
set oracles
yaronvel Dec 12, 2021
8c2d229
decimals in price feed
yaronvel Dec 13, 2021
8541630
some tests
yaronvel Dec 14, 2021
992bd4b
fetch price tests
yaronvel Dec 14, 2021
cd0768a
all tests beside liquidation
yaronvel Dec 15, 2021
3f9554d
old tests revived
yaronvel Dec 15, 2021
aaf9bb8
whitelist ctokens
yaronvel Dec 15, 2021
18568ea
remove collateral test
yaronvel Dec 15, 2021
d0a4d2a
sad add collateral tests
yaronvel Dec 16, 2021
5fe7ce3
sad tests
yaronvel Dec 16, 2021
0d23e93
3.3.1 decimals in TokenAdapter Could Be Marked constant
yaronvel Dec 19, 2021
bb6fd3c
3.3.2 TokenAdapter Does Not Support Infinite Approvals
yaronvel Dec 19, 2021
961bcbd
3.4.1 decimals() of TokenAdapter Returns uint256 instead of uint8
yaronvel Dec 19, 2021
7dd4468
3.1.1 Tokens with Call-on-Transfer Hooks Can Be Used to Drain Funds Via
yaronvel Dec 19, 2021
95d873a
use safeERC20
yaronvel Dec 19, 2021
b180340
Merge pull request #33 from backstop-protocol/rari_audit_fix
yaronvel Dec 21, 2021
552f9f2
stable oracle
yaronvel Jan 6, 2022
c9f9434
fantom fork test
yaronvel Jan 6, 2022
37131ed
oracles
yaronvel Jan 10, 2022
f4920e9
liquidation bot smart contract
yaronvel Jan 10, 2022
7bb23b6
Merge pull request #32 from backstop-protocol/bots/bKeeper
yaronvel Jan 10, 2022
9a6c053
Merge pull request #34 from backstop-protocol/hundred-finance
yaronvel Jan 10, 2022
d1d116a
liquidator before tests
yaronvel Jan 10, 2022
1936544
liquidator script completed
yaronvel Jan 10, 2022
02da74e
arb smart contract
yaronvel Jan 11, 2022
1698815
keeper js
yaronvel Jan 11, 2022
ab71943
coAdmin
yaronvel Jan 12, 2022
7c90d1f
bammlike interface
yaronvel Jan 12, 2022
7c42b2d
liquidate according to biggest collateral
yaronvel Jan 13, 2022
37aca07
small configuration changes
Jan 13, 2022
757570f
bug fix in liquidator bot
yaronvel Jan 13, 2022
4492b2a
yml
yaronvel Jan 13, 2022
f795a7e
fix
Jun 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ node_modules

# Don't track NPM lockfile (we use Yarn)
package-lock.json
packages/liquidator/secret.json
50 changes: 50 additions & 0 deletions packages/contracts/contracts/B.Protocol/Admin.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.6.11;

import "./../Dependencies/Ownable.sol";

interface WithAdmin {
function admin() external view returns(address);
}

interface BAMMLikeInterface {
function setParams(uint _A, uint _fee, uint _callerFee) external;
function transferOwnership(address _newOwner) external;
}

contract Admin is Ownable {
WithAdmin public immutable comptroller;
BAMMLikeInterface public immutable bamm;

address public pendingOwner;
uint public ttl;

event PendingOwnerAlert(address newOwner);

constructor(WithAdmin _comptroller, BAMMLikeInterface _bamm) public {
comptroller = _comptroller;
bamm = _bamm;
}

function setParams(uint _A, uint _fee, uint _callerFee) public onlyOwner {
bamm.setParams(_A, _fee, _callerFee);
}

function setBAMMPendingOwnership(address newOwner) public {
require(msg.sender == comptroller.admin(), "only market admin can change ownership");
pendingOwner = newOwner;
ttl = now + 14 days;

emit PendingOwnerAlert(newOwner);
}

function transferBAMMOwnership() public onlyOwner {
require(pendingOwner != address(0), "pending owner is 0");
require(now >= ttl, "too early");

bamm.transferOwnership(pendingOwner);

pendingOwner = address(0);
}
}
Loading