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

Deploy and proposal for USDT market on Goerli #801

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a669690
add usdt deployment
Aug 3, 2023
22a4dc8
add run scenario entry
Aug 3, 2023
f0d1503
when deploy all suply cap should be zero
Aug 3, 2023
132d591
use the same usdt contract that compoundV2 is using, so easier to get…
Aug 3, 2023
83dcc49
clean up
Aug 7, 2023
6c6e5bf
change targetreserver to 5 usdt
Aug 7, 2023
e791775
USDT fork from mainnet for better consistent scenario cases
Aug 8, 2023
fe550f4
move sol files to deploy branch
Aug 31, 2023
1844dd8
add some usdt token fees scenario tests
Sep 1, 2023
c25386d
add liquidation scenario tests
Sep 8, 2023
b4a026e
port migration deploy script changes to here
Sep 8, 2023
eed10de
Update scenario/SupplyScenario.ts
cwang25 Sep 8, 2023
01ed6e0
Update contracts/Comet.sol
cwang25 Sep 8, 2023
c68fc7f
Update scenario/SupplyScenario.ts
cwang25 Sep 8, 2023
3b9eeee
Update scenario/SupplyScenario.ts
cwang25 Sep 8, 2023
59d101c
address comments
Sep 8, 2023
eff6e14
add docling
Sep 8, 2023
736aee5
add unit test for supply/ supply collateral / buy colalteral into uni…
Sep 11, 2023
e94e693
addressed comments
Sep 11, 2023
8ad9799
Update contracts/test/NonStandardFaucetFeeToken.sol
cwang25 Sep 12, 2023
ba090f0
address comments
Sep 12, 2023
cd3776f
fixed some tsc error complains
Sep 12, 2023
12e5e8f
fix re-entry tests, that since evilToken never transfer anything, wit…
Sep 13, 2023
4b0fc48
another test case that need to set it to 0 balance
Sep 13, 2023
63f4061
EviltToken with more realistic attack, and adjusted test cases, and a…
Sep 15, 2023
277b286
add extra line
Sep 15, 2023
c0f710e
Merge branch 'main' into hans/goerli-usdt-deploy
cwang25 Sep 15, 2023
49588d6
add and leveraged oz's re-entrancy guard
Sep 15, 2023
d0f016a
reentrancy guard in Comet, isntead of importing external contracts wi…
Sep 16, 2023
976c81f
Revert "reentrancy guard in Comet, isntead of importing external cont…
Sep 18, 2023
a13050a
Revert "add and leveraged oz's re-entrancy guard"
Sep 18, 2023
513f451
Address OZ's feedback on USDT comet support (#818)
cwang25 Feb 7, 2024
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
6 changes: 3 additions & 3 deletions contracts/test/NonStandardFaucetFeeToken.sol
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.15;

import "../IERC20NonStandard.sol";
cwang25 marked this conversation as resolved.
Show resolved Hide resolved
/**
* @title Non-standard ERC20 token
* @dev Implementation of the basic standard token.
* See https://github.com/ethereum/EIPs/issues/20
* @dev With USDT fee token mechanism
* @dev Note: `transfer` and `transferFrom` do not return a boolean
*/
contract NonStandardFeeToken {
contract NonStandardFeeToken is IERC20NonStandard {
string public name;
string public symbol;
uint8 public decimals;
Expand Down Expand Up @@ -69,10 +70,9 @@ contract NonStandardFeeToken {
emit Transfer(src, dst, sendAmount);
}

function approve(address _spender, uint256 amount) external returns (bool) {
function approve(address _spender, uint256 amount) external {
allowance[msg.sender][_spender] = amount;
emit Approval(msg.sender, _spender, amount);
return true;
}

// For testing, just don't limit access on setting fees
Expand Down
6 changes: 3 additions & 3 deletions test/buy-collateral-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ describe('buyCollateral', function () {
expect(p0.internal).to.be.deep.equal({ USDT: 0n, COMP: 0n });
expect(p0.external).to.be.deep.equal({ USDT: exp(100, 6), COMP: 0n });
expect(p1.internal).to.be.deep.equal({ USDT: 0n, COMP: 0n });
expect(p1.external).to.be.deep.equal({ USDT: exp(50, 6), COMP: 54450000000000000000n });
expect(p1.external).to.be.deep.equal({ USDT: exp(50, 6), COMP: exp(54.45, 18) });
expect(r1).to.be.equal(exp(49.5, 6)); // 50 * 0.99 = 49.5
expect(event(txn, 0)).to.be.deep.equal({
Transfer: {
Expand All @@ -395,15 +395,15 @@ describe('buyCollateral', function () {
Transfer: {
from: comet.address,
to: alice.address,
amount: 54450000000000000000n,
amount: exp(54.45, 18),
}
});
expect(event(txn, 2)).to.be.deep.equal({
BuyCollateral: {
buyer: alice.address,
asset: COMP.address,
baseAmount: exp(49.5, 6),
collateralAmount: 55000000000000000000n,
collateralAmount: exp(55, 18),
}
});
});
Expand Down
1 change: 0 additions & 1 deletion test/supply-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,6 @@ describe('supplyTo', function () {
factory: (await ethers.getContractFactory('NonStandardFaucetFeeToken')) as NonStandardFaucetFeeToken__factory,
};

cwang25 marked this conversation as resolved.
Show resolved Hide resolved

const protocol = await makeProtocol({ base: 'USDC', assets: assets });
const { comet, tokens, users: [alice, bob] } = protocol;
const { FeeToken } = tokens;
Expand Down
Loading