Skip to content
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

Dev ex/cf build script #665

Open
wants to merge 99 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
87b7fb0
initial b.protocol commit
yaronvel Jun 23, 2021
ab6a53a
lp token
yaronvel Jun 26, 2021
02670c5
fuzzy share + staking
yaronvel Jun 26, 2021
dfd272b
fuzzy price formula test
yaronvel Jun 26, 2021
a596c94
share + eth test
yaronvel Jun 27, 2021
abe744d
withdraw with eth
yaronvel Jun 27, 2021
a5dc53d
4% max test
yaronvel Jun 27, 2021
9d10595
price > eth balance
yaronvel Jun 27, 2021
38bb5b9
more tests
yaronvel Jun 29, 2021
8d072fa
set params test
yaronvel Jun 29, 2021
072acde
front end support
yaronvel Jun 29, 2021
509b28c
transfer
yaronvel Jun 29, 2021
91070b5
pickle support
yaronvel Jun 30, 2021
c823767
remove erc20 operations from bamm
yaronvel Jun 30, 2021
7859259
compiler warning cleanups
yaronvel Jun 30, 2021
6a63feb
events
yaronvel Jun 30, 2021
3af7bcf
linter
yaronvel Jun 30, 2021
4d82e3e
function order according to linter
yaronvel Jun 30, 2021
ecb8e74
audit fixes
yaronvel Jul 7, 2021
5120787
more audit fixes
yaronvel Jul 7, 2021
72b4611
temp
Jul 7, 2021
3459b04
Merge pull request #1 from backstop-protocol/audit-fixes
yaronvel Jul 7, 2021
0093256
papers
yaronvel Jul 7, 2021
3bf6933
Merge pull request #2 from backstop-protocol/audit-fixes
yaronvel Jul 7, 2021
4f9a9d0
add smart contract assessment by Fixed Point Solutions
kmbarry1 Jul 7, 2021
aa327cc
Merge pull request #3 from Fixed-Point-Solutions/FPS-assessment
yaronvel Jul 7, 2021
d93ad9d
Delete TODO.txt
yaronvel Jul 7, 2021
b1e9a60
ownable - allow transfer ownership
yaronvel Jul 8, 2021
ca76864
stabilityDeposit.poolShare
Jul 11, 2021
60bb75a
cleanUp
Jul 11, 2021
92f716f
LQTY reward
Jul 11, 2021
1626072
Changing liquidation gain to BAMM ETH
Jul 12, 2021
6b01e9f
working state
Jul 12, 2021
62155bb
remove the Claim LQTY and move ETH to Trove BTN
Jul 12, 2021
d51f03e
text change
Jul 12, 2021
f2ce78d
text change
Jul 12, 2021
d1f3668
minor layout change
Jul 12, 2021
a279980
unlock
Jul 13, 2021
1dc6bc7
bamm pool share
Jul 14, 2021
c801f6b
lens
yaronvel Jul 15, 2021
4d50628
Merge pull request #4 from backstop-protocol/B-Lens
yaronvel Jul 15, 2021
03847c8
working state
Jul 19, 2021
3fef0e1
styleFix: whale friendly layout :)
Jul 19, 2021
91cf169
hide away really small rounding errors
Jul 19, 2021
5e35116
Merge remote-tracking branch 'origin/main' into B-frontend
Jul 19, 2021
054e632
adding bLens contract and reading LQTY reward from it
Jul 19, 2021
2001922
unlock bamm modal
Jul 19, 2021
64bb4f7
refactor:
Jul 20, 2021
a01f8b1
bugFix
Jul 20, 2021
8404868
improvment
Jul 20, 2021
68ed95f
validatind network connection
Jul 21, 2021
8d64582
minor style change
Jul 21, 2021
2e8cc41
CF worker
Jul 22, 2021
64d9509
adding b.protocol icon
Jul 22, 2021
ded16eb
adding a link to the terms
Jul 22, 2021
5630ca7
Merge pull request #5 from liquity/main
shmuel-web Jul 25, 2021
32478e5
Merge branch 'main-2' into feature/b-forntend-3
Jul 25, 2021
c572ff5
hide:
Jul 25, 2021
d5609b2
hide:
Jul 25, 2021
a296243
hide:
Jul 25, 2021
765de76
Refactor:
Jul 25, 2021
8f24999
mainnet address
Jul 25, 2021
bb7aa61
text change
Jul 25, 2021
84a1317
allowance pending spiner
Jul 25, 2021
9ad1d50
blocking mainnet
Jul 25, 2021
facbb0e
display logo
Jul 26, 2021
9140e9b
text change
Jul 26, 2021
3bcb7b5
Merge pull request #7 from liquity/main
yaronvel Jul 28, 2021
67aa903
merge main
Jul 29, 2021
5c83e39
yarnlock
Jul 29, 2021
5c38524
Stability Pool 1234
Jul 29, 2021
9c08bc3
hide BAMM Pool share
Jul 29, 2021
4a9b3e0
ETH tooltip
Jul 29, 2021
4561ce2
hide ETH if its Negligible
Jul 29, 2021
e11d722
cleanUp
Jul 29, 2021
d2ce882
fonts
Jul 30, 2021
02dc382
static assets
Jul 30, 2021
b147e2b
connect page
Jul 30, 2021
7a38dfa
responsiveness
Jul 30, 2021
e27c1bc
add devDependencies
Aug 1, 2021
6de5a57
style
Aug 1, 2021
eb1b4f0
change validation order
Aug 1, 2021
3c33919
text changes
Aug 1, 2021
4d4b297
dispalying eth and lusd witdraw amount
Aug 1, 2021
2fece7f
removing collateral gain (eth gain)
Aug 1, 2021
69a1e90
small text and style tweaks
Aug 2, 2021
6f52823
BugFix: storeUpdate changes wrong values
Aug 2, 2021
381262e
trimm roundeing error
Aug 2, 2021
4c91136
metamask mobile fix
Aug 2, 2021
af2237b
[mainnet]
Aug 2, 2021
2be43b4
text
Aug 2, 2021
8187934
showOverlay when SP transaction is in progress
Aug 2, 2021
6ba906d
full stop
Aug 2, 2021
4941b13
stability pool 1
Aug 2, 2021
cb71fd4
BugFix: withdraw
Aug 2, 2021
2151ba2
cf-build script
Aug 4, 2021
4976861
typo
Aug 4, 2021
e9d4e87
added generate static to the build step
Aug 8, 2021
135c307
Update remove-iframe-deny.js
yaronvel Aug 8, 2021
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
Prev Previous commit
Next Next commit
lp token
  • Loading branch information
yaronvel committed Jun 26, 2021
commit ab6a53a5a2a3d6845ca82dc1a2b98fdf44177aa1
32 changes: 7 additions & 25 deletions packages/contracts/contracts/B.Protocol/BAMM.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
pragma solidity 0.6.11;

import "./../StabilityPool.sol";
import "./crop.sol";
import "./LPToken.sol";
import "./PriceFormula.sol";
import "./../Interfaces/IPriceFeed.sol";
import "./../Dependencies/IERC20.sol";
import "./../Dependencies/SafeMath.sol";
import "./../Dependencies/Ownable.sol";
import "./../Dependencies/AggregatorV3Interface.sol";

contract BAMM is CropJoin, PriceFormula, Ownable {
contract BAMM is LPToken, PriceFormula, Ownable {
using SafeMath for uint256;

AggregatorV3Interface public immutable priceAggregator;
Expand All @@ -32,7 +32,7 @@ contract BAMM is CropJoin, PriceFormula, Ownable {
uint constant PRECISION = 1e18;

constructor(address _priceAggregator, address payable _SP, address _LUSD, address _LQTY, uint _maxDiscount, address payable _feePool) public
CropJoin(address(new Dummy()), "B.AMM", address(new DummyGem()), _LQTY) {
LPToken(_LQTY) {
priceAggregator = AggregatorV3Interface(_priceAggregator);
SP = StabilityPool(_SP);
LUSD = IERC20(_LUSD);
Expand Down Expand Up @@ -105,8 +105,8 @@ contract BAMM is CropJoin, PriceFormula, Ownable {
require(LUSD.transferFrom(msg.sender, address(this), lusdAmount), "deposit: transferFrom failed");
SP.provideToSP(lusdAmount, frontEndTag);

// update LQTY
join(msg.sender, newShare);
// update LP token
mint(msg.sender, newShare);
}

function withdraw(uint numShares) external {
Expand All @@ -119,8 +119,8 @@ contract BAMM is CropJoin, PriceFormula, Ownable {
// this withdraws lusd, lqty, and eth
SP.withdrawFromSP(lusdAmount);

// update LQTY
exit(msg.sender, numShares);
// update LP token
burn(msg.sender, numShares);

// send lusd and eth
if(lusdAmount > 0) LUSD.transfer(msg.sender, lusdAmount);
Expand Down Expand Up @@ -198,21 +198,3 @@ contract BAMM is CropJoin, PriceFormula, Ownable {

receive() external payable {}
}

contract Dummy {
fallback() external payable {}
}

contract DummyGem is Dummy {
function transfer(address, uint) external pure returns(bool) {
return true;
}

function transferFrom(address, address, uint) external pure returns(bool) {
return true;
}

function decimals() external pure returns(uint) {
return 18;
}
}
75 changes: 75 additions & 0 deletions packages/contracts/contracts/B.Protocol/LPToken.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
pragma solidity 0.6.11;

import "./crop.sol";

contract LPToken is CropJoin {
string constant public name = "B.AMM LUSD-ETH";
string constant public symbol = "LUSDETH";
uint constant public decimals = 18;
mapping(address => mapping(address => uint)) allowance;

event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);

constructor(address lqty) public
CropJoin(address(new Dummy()), "B.AMM", address(new DummyGem()), lqty) {}

function mint(address to, uint value) internal {
join(to, value);
emit Transfer(address(0), to, value);
}

function burn(address owner, uint value) internal {
exit(owner, value);
emit Transfer(owner, address(0), value);
}

function totalSupply() public view returns (uint256) {
return total;
}

function balanceOf(address owner) public view returns (uint256 balance) {
balance = stake[owner];
}

function transfer(address to, uint256 value) public returns (bool success) {
burn(msg.sender, value);
mint(to, value);

emit Transfer(msg.sender, to, value);
success = true;
}

function transferFrom(address from, address to, uint256 value) public returns (bool success) {
allowance[msg.sender][from] = sub(allowance[msg.sender][from], value);

burn(from, value);
mint(to, value);

emit Transfer(from, to, value);
success = true;
}

function approve(address spender, uint256 value) public returns (bool success) {
allowance[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
}
}

contract Dummy {
fallback() external payable {}
}

contract DummyGem is Dummy {
function transfer(address, uint) external pure returns(bool) {
return true;
}

function transferFrom(address, address, uint) external pure returns(bool) {
return true;
}

function decimals() external pure returns(uint) {
return 18;
}
}
Loading