Skip to content

Commit

Permalink
initial version, but it is not done
Browse files Browse the repository at this point in the history
1. replace Niflot to TradableStream
2. rename IncDec to CFALib
3. implement payOwner function
4. add refund logic in burn function
5. limit TradableStream only transfer one time
6. add onlyOwner access control for payOwner and burn

implement a new version

1. remove unused IReceivableAsset interface
2. convert Super token amount to underlying token amount

fix a permission issue of TradableStream burn

add view functions

add positive tests of Superfluid pool

replace require messages to errors

goerli deployment scripts

fixing forking error

remove forking for the whole hardhat network

updated workflow file

adding testing log

add deployment validation script

added env for testing

added env for testing

reverting debugging log

add error code

Borrow in one send (#298)

* code and one test

* 1. add the limit to call fixed function mintToWithAuthorization
2. add msg.sender check
3. update tests

* 1. add Multisend contract and tests
2. add permit function in TestToken
3. use block.chainid

* remove owner and nonce parameter

* deploy and verify new contracts about Superfluid

* 1. update superfluid pool tests on mumbai
2. fix bugs of goerli superfluid pool scripts
3. create mumbai superfluid pool scripts
4. deploy, verify and validate superfluid pool contracts on mumbai

* 1. refactor drawdownWithAuthorization function
2. remove drawdownWithReceivable function

* update tests to borrow the same amount as NFT locked value

* update based on review comments

* remove Superfluid v1 contracts

add more tests

conflict in yarn.lock

Refactor ReceivableFactoringPool (#299)

* 1. involve SuperApp framework
2. split SuperfluidPool to ReceivableFactoringPool and SuperfluidProcessor
3. implement drawdown function of SuperfluidProcessor

* implement payoff function of SuperfluidPoolProcessor

* add flow change logic

* fix approveCredit and mintAndDrawdown tests

* fix Superfluid tests

1. add logic to handle flow termination
2. add related tests

1. refactor SuperfluidPoolProcessor and TradableStream for adding logic in _handleFlowChange
2. add comments to describe options in _handleFlowChange

1. rename payoff to settlement
2. remove decreasing/increasing flow logic
3. revert transaction when decreasing/increasing flow
4. add tryTransferAllowance function
5. make settlement to be able called repeatedly

1. add new errors
2. add a new command 'gen-code-ids'
3. clean code

add negative tests for mintToAndDrawdown

1. fix a bug of settlement
2. add negative tests for settlement
3. add more comments

1. update deployment scripts
2. deploy new contracts on mumbai

1. add comments to describe one limitation of flow terminatation
2. use current flow rate instead of the initial flow rate when burn NFT

1. add new logic to handle multiple borrowers of one flow termination
2. revert increasing/decreasing flows
3. revert creating new flow to processor
4. fix tests and add new tests

add comments

deploy new contracts about Superfluid

deploy new contracts about Superfluid

fix some small bugs

superfluid processor event update (#306)

* superfluid processor event update

* update deployed contracts on mumbai for superfluid

* add unit test for settlement success event

* update receivableCleared and settlementMade events

* update deploy contract addresses

---------

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

Superfluid pool event update (#311)

update receivableCleared and settlementMade events to include flowKey

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

update receivableCleared and settlementMade events to include flowKey (#314)

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

03 fine tune to Superfluid changes (#315)

* Polish TradableStream.sol

* comment out one skipped test

* comment out logs in SuperfluidFactoringTest.sol

* 1. update burn function permission
2. change require to revert errors in TradableStream contract

* Added some comments

---------

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

New tests (#316)

* add new tests
  • Loading branch information
bin-57blocks committed Jul 19, 2023
1 parent 026cbf0 commit 8345d36
Show file tree
Hide file tree
Showing 83 changed files with 22,308 additions and 137 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/linter_ci_js_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ jobs:
- name: Check coding styles
run: yarn lint-solidity
- name: run tests
env:
GOERLI_URL: ${{ secrets.GOERLI_URL }}
MUMBAI_URL: ${{ secrets.MUMBAI_URL }}
run: yarn test
14 changes: 7 additions & 7 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"editor.formatOnSave": true,
"[solidity]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"solidity.defaultCompiler": "remote",
"solidity.compileUsingRemoteVersion": "v0.8.4+commit.c7e474f2"
}
"editor.formatOnSave": true,
"[solidity]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"solidity.compileUsingRemoteVersion": "v0.8.11+commit.d7f03943"
}
347 changes: 347 additions & 0 deletions abi/ERC20Permit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,347 @@
[
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"inputs": [],
"name": "DOMAIN_SEPARATOR",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "decimals",
"outputs": [
{
"internalType": "uint8",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "subtractedValue",
"type": "uint256"
}
],
"name": "decreaseAllowance",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "addedValue",
"type": "uint256"
}
],
"name": "increaseAllowance",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"name": "nonces",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
},
{
"internalType": "uint8",
"name": "v",
"type": "uint8"
},
{
"internalType": "bytes32",
"name": "r",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "s",
"type": "bytes32"
}
],
"name": "permit",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "symbol",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
]
Loading

0 comments on commit 8345d36

Please sign in to comment.