Skip to content

Commit 7edfe77

Browse files
authored
Merge the develop branch to the master branch, preparation to v5.7.0-rc1
This set of changes includes the following improvements and few fixes: * [Improvement] Earn interest on locked tokens using Compound Protocol (#590) * [Other] Remove deprecated bridge types (#595) * [Other] Bump contracts and package version before 5.7.0-rc1 (#597)
2 parents c937711 + ccb4ffd commit 7edfe77

File tree

142 files changed

+52791
-40309
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+52791
-40309
lines changed

.solhint.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
"bracket-align": "off",
1111
"no-complex-fallback": "off",
1212
"no-simple-event-func-name": "off",
13+
"const-name-snakecase": "off",
14+
"no-empty-blocks": "off",
15+
"not-rely-on-time": "off",
1316
"compiler-version": ["error", "0.4.24"]
1417
}
1518
}

Dockerfile.dev

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ COPY ./upgrade/package.json ./upgrade/
1818
COPY ./upgrade/package-lock.json ./upgrade/
1919
RUN cd ./upgrade; npm install; cd ..
2020

21-
COPY ./scripts ./scripts
22-
2321
COPY truffle-config.js truffle-config.js
2422
COPY ./contracts ./contracts
2523
RUN npm run compile

GAS_CONSUMPTION.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
## Gas Consumption by Bridge Mode
22

3-
- [NATIVE-TO-ERC](docs/NATIVE-TO-ERC.md)
4-
- [NATIVE-TO-ERC-WITH-REWARD](docs/NATIVE-TO-ERC-WITH-REWARD.md)
5-
- [ERC-TO-ERC](docs/ERC-TO-ERC.md)
63
- [ERC-TO-NATIVE](docs/ERC-TO-NATIVE.md)
74
- [ERC-TO-NATIVE-WITH-REWARD](docs/ERC-TO-NATIVE-WITH-REWARD.md)

README.md

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ The POA bridge contracts consist of several components:
3535
* The **Home Bridge** smart contract. This is currently deployed in POA.Network.
3636
* The **Foreign Bridge** smart contract. This is deployed in the Ethereum Mainnet.
3737
* Depending on the type of relay operations the following components are also used:
38-
* in `NATIVE-TO-ERC` mode: the ERC20 token (in fact, the ERC677 extension is used) is deployed on the Foreign network;
39-
* in `AMB-NATIVE-TO-ERC` mode: the ERC20 token (in fact, the ERC677 extension is used) is deployed on the Foreign network;
40-
* in `ERC-TO-ERC` mode: the ERC20 token (in fact, the ERC677 extension is used) is deployed on the Home network;
4138
* in `AMB-ERC-TO-ERC` mode: the ERC20 token (in fact, the ERC677 extension is used) is deployed on the Home network;
4239
* in `ERC-TO-NATIVE` mode: The home network nodes must support consensus engine that allows using a smart contract for block reward calculation;
4340
* The **Validators** smart contract is deployed in both the POA.Network and the Ethereum Mainnet.
@@ -59,14 +56,9 @@ Responsibilities and roles of the bridge:
5956
- listen for `UserRequestForAffirmation` or `Transfer` (depending on the bridge mode) events on the Foreign Bridge and send approval to Home Bridge to relay assets from Foreign Network to Home
6057
- **User** role:
6158
- sends assets to Bridge contracts:
62-
- in `NATIVE-TO-ERC` mode: send native coins to the Home Bridge to receive ERC20 tokens from the Foreign Bridge, send ERC20 tokens to the Foreign Bridge to unlock native coins from the Home Bridge;
63-
- in `ERC-TO-ERC` mode: transfer ERC20 tokens to the Foreign Bridge to mint ERC20 tokens on the Home Network, transfer ERC20 tokens to the Home Bridge to unlock ERC20 tokens on Foreign networks;
6459
- in `ERC-TO-NATIVE` mode: send ERC20 tokens to the Foreign Bridge to receive native coins from the Home Bridge, send native coins to the Home Bridge to unlock ERC20 tokens from the Foreign Bridge;
6560
- in `ARBITRARY-MESSAGE` mode: Invoke Home/Foreign Bridge to send a message that will be executed on the other Network as an arbitrary contract method invocation;
6661
- in `AMB-ERC-TO-ERC` mode: transfer ERC20 tokens to the Foreign Mediator which will interact with Foreign AMB Bridge to mint ERC20 tokens on the Home Network, transfer ERC20 tokens to the Home Mediator which will interact with Home AMB Bridge to unlock ERC20 tokens on Foreign network.
67-
- in `AMB-NATIVE-TO-ERC` mode: send native coins to the Home Mediator which will interact with Home AMB Bridge to mint ERC20 tokens on the Foreign Network, transfer ERC20 tokens to the Foreign Mediator which will interact with Foreign AMB Bridge to unlock native coins from Home network.
68-
- in `AMB-ERC-TO-NATIVE` mode: send ERC20 tokens to the Foreign Mediator which will interact with Foreign AMB Bridge to receive native coins from the Home Mediator on the Home Network, send native coins to the Home Mediator which will interact with Home AMB Bridge to unlock ERC20 tokens from the Foreign Mediator.
69-
- in `MULTI-AMB-ERC-TO-ERC` mode: transfer any ERC20/ERC677 tokens to the Foreign Mediator which will interact with Foreign AMB Bridge to mint ERC677 tokens on the Home Network, transfer ERC677 tokens to the Home Mediator which will interact with Home AMB Bridge to unlock associated ERC20/ERC677 tokens on the Foreign network.
7062

7163
## Usage
7264

@@ -166,17 +158,6 @@ or with Docker:
166158
./deploy.sh token
167159
```
168160

169-
For testing bridge scripts in ERC20-to-NATIVE mode, you can deploy an interest receiver to the foreign network.
170-
This can be done by running the following command:
171-
```bash
172-
cd deploy
173-
node testenv-deploy.js interestReceiver
174-
```
175-
or with Docker:
176-
```bash
177-
./deploy.sh interestReceiver
178-
```
179-
180161
## Contributing
181162

182163
See the [CONTRIBUTING](CONTRIBUTING.md) document for contribution, testing and pull request protocol.

REWARD_MANAGEMENT.md

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,5 @@
11
# Reward Management
22

3-
## NATIVE-TO-ERC
4-
Configuration:
5-
```
6-
HOME_REWARDABLE=ONE_DIRECTION
7-
FOREIGN_REWARDABLE=ONE_DIRECTION
8-
```
9-
### Home to Foreign transfer
10-
Fees are calculated and distributed on Foreign network. Validators will receive ERC20 tokens.
11-
![native-erc-hometoforeign](https://user-images.githubusercontent.com/4614574/51607402-4bda6180-1ef3-11e9-91e3-50fe5d35d296.png)
12-
13-
### Foreign to Home transfer
14-
Fees are calculated and distributed on Home network. Validators will receive native coins.
15-
![native-erc-foreigntohome](https://user-images.githubusercontent.com/4614574/51607428-5d236e00-1ef3-11e9-8083-3669899c7252.png)
16-
17-
## NATIVE-TO-ERC - Fees collected on Home network only
18-
Configuration:
19-
```
20-
HOME_REWARDABLE=BOTH_DIRECTIONS
21-
FOREIGN_REWARDABLE=false
22-
```
23-
### Home to Foreign transfer
24-
Fees are calculated and distributed on Home network. Validators will receive native coins.
25-
![native-erc-homefee-hometoforeign](https://user-images.githubusercontent.com/4614574/53118155-43456d00-352b-11e9-80db-53e31494e09b.png)
26-
27-
### Foreign to Home transfer
28-
Fees are calculated and distributed on Home network. Validators will receive native coins.
29-
![native-erc-homefee-foreigntohome](https://user-images.githubusercontent.com/4614574/53118176-4b9da800-352b-11e9-8118-123f30e37d61.png)
30-
313
## ERC-TO-NATIVE - Fees distributed among bridge validators
324
Configuration:
335
```
@@ -57,33 +29,3 @@ Fees are calculated and distributed on Home network. Validators will receive nat
5729
### Home to Foreign transfer
5830
Fees are calculated and distributed on Home network. Validators will receive native coins.
5931
![POSDAO-ERC-Native-HomeToForeign](https://user-images.githubusercontent.com/4614574/59941982-f750f900-9434-11e9-8557-a90d9dfa6799.png)
60-
61-
## ERC-TO-ERC
62-
Configuration:
63-
```
64-
HOME_REWARDABLE=BOTH_DIRECTIONS
65-
FOREIGN_REWARDABLE=false
66-
```
67-
### Foreign to Home transfer
68-
Fees are calculated and distributed on Home network. Validators will receive ERC20 tokens.
69-
![ERC-ERC-ForeignToHome](https://user-images.githubusercontent.com/4614574/59939650-016ff900-942f-11e9-9593-9861455c7b62.png)
70-
71-
### Home to Foreign transfer
72-
Fees are calculated and distributed on Home network. Validators will receive ERC20 tokens.
73-
![ERC-ERC-HomeToForeign](https://user-images.githubusercontent.com/4614574/59939670-0cc32480-942f-11e9-9693-727125555c97.png)
74-
75-
## AMB-NATIVE-TO-ERC
76-
Configuration:
77-
```
78-
HOME_REWARDABLE=ONE_DIRECTION
79-
FOREIGN_REWARDABLE=ONE_DIRECTION
80-
```
81-
### Home to Foreign transfer
82-
Fees are calculated and distributed on Foreign network. The reward accounts will receive ERC20 tokens.
83-
![AMB-NATIVE-TO-ERC677-Home-Foreign](https://user-images.githubusercontent.com/4614574/74660965-dd0f1c80-5175-11ea-8d6c-51b8bd85f844.png)
84-
85-
### Foreign to Home transfer
86-
Fees are calculated and distributed on Home network. The reward accounts will receive native tokens.
87-
![AMB-NATIVE-TO-ERC677-Foreign-Home](https://user-images.githubusercontent.com/4614574/74660986-e6988480-5175-11ea-9216-7f008a6fdaf0.png)
88-
89-

contracts/interfaces/ICToken.sol

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
pragma solidity 0.4.24;
2+
3+
interface ICToken {
4+
function mint(uint256 mintAmount) external returns (uint256);
5+
function redeemUnderlying(uint256 redeemAmount) external returns (uint256);
6+
function balanceOf(address account) external view returns (uint256);
7+
function balanceOfUnderlying(address account) external view returns (uint256);
8+
function borrow(uint256 borrowAmount) external returns (uint256);
9+
function repayBorrow(uint256 borrowAmount) external returns (uint256);
10+
}

contracts/interfaces/IChai.sol

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pragma solidity 0.4.24;
2+
3+
interface IComptroller {
4+
function claimComp(address[] holders, address[] cTokens, bool borrowers, bool suppliers) external;
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pragma solidity 0.4.24;
2+
3+
interface IInterestReceiver {
4+
function onInterestReceived(address _token) external;
5+
}

contracts/interfaces/IPot.sol

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)