Skip to content

Commit

Permalink
Add coverage badge (#140)
Browse files Browse the repository at this point in the history
* Add coverage badge

* Remove unused contracts

* Update Docs

* Update MockUniswapFactory
  • Loading branch information
antoncoding authored Aug 7, 2020
1 parent aab6a54 commit 8cbbb90
Show file tree
Hide file tree
Showing 31 changed files with 86 additions and 179 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Convexity Protocol [![CircleCI](https://circleci.com/gh/opynfinance/OptionsProtocol/tree/dev.svg?style=svg&circle-token=dff9c1ce21f639bc170ef267bf2a93f43a5e5870)](https://circleci.com/gh/opynfinance/OptionsProtocol/tree/dev)
# Convexity Protocol [![CircleCI](https://circleci.com/gh/opynfinance/OptionsProtocol/tree/dev.svg?style=svg&circle-token=dff9c1ce21f639bc170ef267bf2a93f43a5e5870)](https://circleci.com/gh/opynfinance/OptionsProtocol/tree/dev)[![Coverage Status](https://coveralls.io/repos/github/opynfinance/OptionsProtocol/badge.svg?branch=dev)](https://coveralls.io/github/opynfinance/OptionsProtocol?branch=dev)

This vault contains all the smart contracts for Opyn's Convexity Protocol. Convexity allows options sellers to earn premiums on their collateral and options buyers to protect themselves against technical, financial and systemic risks that the underlying token faces.

Expand Down
40 changes: 0 additions & 40 deletions contracts/OptionsUtils.sol

This file was deleted.

23 changes: 16 additions & 7 deletions contracts/lib/MockUniswapFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,28 @@ contract MockUniswapFactory {

address public exchangeTemplate;
uint256 public tokenCount;
mapping(uint256 => address) public idToToken;
mapping(address => address) public exchanges;
mapping(address => address) public tokens;
address public _exchange;

// Create Exchange
function createExchange(address token) external pure returns (address exchange) {
return 0x06D014475F84Bb45b9cdeD1Cf3A1b8FE3FbAf128;
return token; // return random address.
}
// Get Exchange and Token Info
function getExchange(address token) external pure returns (address exchange){
return 0x06D014475F84Bb45b9cdeD1Cf3A1b8FE3FbAf128;
function getExchange(address token) external view returns (address exchange){
return exchanges[token];
}
function getToken(address exchange) external view returns (address token) {
return tokens[exchange];
}
function getToken(address exchange) external pure returns (address token) {
return 0x06D014475F84Bb45b9cdeD1Cf3A1b8FE3FbAf128;
function getTokenWithId(uint256 tokenId) external view returns (address token) {
return idToToken[tokenId];
}
function getTokenWithId(uint256 tokenId) external pure returns (address token) {
return 0x06D014475F84Bb45b9cdeD1Cf3A1b8FE3FbAf128;
function setTokenExchange(address token, address exchange) public {
exchanges[token] = exchange;
tokens[exchange] = token;
}
// Never use
function initializeFactory(address template) external {
Expand Down
3 changes: 1 addition & 2 deletions docs/CTokenInterface.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CTokenInterface.sol

View Source: [contracts/lib/CTokenInterface.sol](../contracts/lib/CTokenInterface.sol)
View Source: [contracts/interfaces/CTokenInterface.sol](../contracts/interfaces/CTokenInterface.sol)

**CTokenInterface**

Expand Down Expand Up @@ -264,7 +264,6 @@ returns(uint256)
* [ERC20Detailed](ERC20Detailed.md)
* [ERC20Mintable](ERC20Mintable.md)
* [IERC20](IERC20.md)
* [IOptionsExchange](IOptionsExchange.md)
* [LibNote](LibNote.md)
* [Migrations](Migrations.md)
* [MinterRole](MinterRole.md)
Expand Down
3 changes: 1 addition & 2 deletions docs/CompoundOracleInterface.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CompoundOracleInterface.sol

View Source: [contracts/lib/CompoundOracleInterface.sol](../contracts/lib/CompoundOracleInterface.sol)
View Source: [contracts/interfaces/CompoundOracleInterface.sol](../contracts/interfaces/CompoundOracleInterface.sol)

**CompoundOracleInterface**

Expand Down Expand Up @@ -63,7 +63,6 @@ returns(uint256)
* [ERC20Detailed](ERC20Detailed.md)
* [ERC20Mintable](ERC20Mintable.md)
* [IERC20](IERC20.md)
* [IOptionsExchange](IOptionsExchange.md)
* [LibNote](LibNote.md)
* [Migrations](Migrations.md)
* [MinterRole](MinterRole.md)
Expand Down
1 change: 0 additions & 1 deletion docs/Context.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ returns(bytes)
* [ERC20Detailed](ERC20Detailed.md)
* [ERC20Mintable](ERC20Mintable.md)
* [IERC20](IERC20.md)
* [IOptionsExchange](IOptionsExchange.md)
* [LibNote](LibNote.md)
* [Migrations](Migrations.md)
* [MinterRole](MinterRole.md)
Expand Down
1 change: 0 additions & 1 deletion docs/Dai.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ function permit(address holder, address spender, uint256 nonce, uint256 expiry,
* [ERC20Detailed](ERC20Detailed.md)
* [ERC20Mintable](ERC20Mintable.md)
* [IERC20](IERC20.md)
* [IOptionsExchange](IOptionsExchange.md)
* [LibNote](LibNote.md)
* [Migrations](Migrations.md)
* [MinterRole](MinterRole.md)
Expand Down
1 change: 0 additions & 1 deletion docs/ERC20.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ function _burnFrom(address account, uint256 amount) internal nonpayable
* [ERC20Detailed](ERC20Detailed.md)
* [ERC20Mintable](ERC20Mintable.md)
* [IERC20](IERC20.md)
* [IOptionsExchange](IOptionsExchange.md)
* [LibNote](LibNote.md)
* [Migrations](Migrations.md)
* [MinterRole](MinterRole.md)
Expand Down
1 change: 0 additions & 1 deletion docs/ERC20Detailed.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ returns(uint8)
* [ERC20Detailed](ERC20Detailed.md)
* [ERC20Mintable](ERC20Mintable.md)
* [IERC20](IERC20.md)
* [IOptionsExchange](IOptionsExchange.md)
* [LibNote](LibNote.md)
* [Migrations](Migrations.md)
* [MinterRole](MinterRole.md)
Expand Down
1 change: 0 additions & 1 deletion docs/ERC20Mintable.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ returns(bool)
* [ERC20Detailed](ERC20Detailed.md)
* [ERC20Mintable](ERC20Mintable.md)
* [IERC20](IERC20.md)
* [IOptionsExchange](IOptionsExchange.md)
* [LibNote](LibNote.md)
* [Migrations](Migrations.md)
* [MinterRole](MinterRole.md)
Expand Down
1 change: 0 additions & 1 deletion docs/IERC20.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ returns(bool)
* [ERC20Detailed](ERC20Detailed.md)
* [ERC20Mintable](ERC20Mintable.md)
* [IERC20](IERC20.md)
* [IOptionsExchange](IOptionsExchange.md)
* [LibNote](LibNote.md)
* [Migrations](Migrations.md)
* [MinterRole](MinterRole.md)
Expand Down
56 changes: 0 additions & 56 deletions docs/IOptionsExchange.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/LibNote.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ function permit(address holder, address spender, uint256 nonce, uint256 expiry,
* [ERC20Detailed](ERC20Detailed.md)
* [ERC20Mintable](ERC20Mintable.md)
* [IERC20](IERC20.md)
* [IOptionsExchange](IOptionsExchange.md)
* [LibNote](LibNote.md)
* [Migrations](Migrations.md)
* [MinterRole](MinterRole.md)
Expand Down
1 change: 0 additions & 1 deletion docs/Migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ function upgrade(address new_address) public nonpayable restricted
* [ERC20Detailed](ERC20Detailed.md)
* [ERC20Mintable](ERC20Mintable.md)
* [IERC20](IERC20.md)
* [IOptionsExchange](IOptionsExchange.md)
* [LibNote](LibNote.md)
* [Migrations](Migrations.md)
* [MinterRole](MinterRole.md)
Expand Down
1 change: 0 additions & 1 deletion docs/MinterRole.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ function _removeMinter(address account) internal nonpayable
* [ERC20Detailed](ERC20Detailed.md)
* [ERC20Mintable](ERC20Mintable.md)
* [IERC20](IERC20.md)
* [IOptionsExchange](IOptionsExchange.md)
* [LibNote](LibNote.md)
* [Migrations](Migrations.md)
* [MinterRole](MinterRole.md)
Expand Down
1 change: 0 additions & 1 deletion docs/MockCompoundOracle.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ function updatePrice(uint256 newPrice) public nonpayable
* [ERC20Detailed](ERC20Detailed.md)
* [ERC20Mintable](ERC20Mintable.md)
* [IERC20](IERC20.md)
* [IOptionsExchange](IOptionsExchange.md)
* [LibNote](LibNote.md)
* [Migrations](Migrations.md)
* [MinterRole](MinterRole.md)
Expand Down
9 changes: 4 additions & 5 deletions docs/MockUniswapFactory.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function () public nonpayable
### createExchange

```js
function createExchange(address token) external nonpayable
function createExchange(address token) external pure
returns(exchange address)
```

Expand All @@ -49,7 +49,7 @@ returns(exchange address)
### getExchange

```js
function getExchange(address token) external view
function getExchange(address token) external pure
returns(exchange address)
```

Expand All @@ -62,7 +62,7 @@ returns(exchange address)
### getToken

```js
function getToken(address exchange) external view
function getToken(address exchange) external pure
returns(token address)
```

Expand All @@ -75,7 +75,7 @@ returns(token address)
### getTokenWithId

```js
function getTokenWithId(uint256 tokenId) external view
function getTokenWithId(uint256 tokenId) external pure
returns(token address)
```

Expand Down Expand Up @@ -107,7 +107,6 @@ function initializeFactory(address template) external nonpayable
* [ERC20Detailed](ERC20Detailed.md)
* [ERC20Mintable](ERC20Mintable.md)
* [IERC20](IERC20.md)
* [IOptionsExchange](IOptionsExchange.md)
* [LibNote](LibNote.md)
* [Migrations](Migrations.md)
* [MinterRole](MinterRole.md)
Expand Down
3 changes: 1 addition & 2 deletions docs/OptionsContract.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ int32 public underlyingExp;
contract IERC20 public collateral;
contract IERC20 public underlying;
contract IERC20 public strike;
contract CompoundOracleInterface public COMPOUND_ORACLE;
contract CompoundOracleInterface public compoundOracle;
string public name;
string public symbol;
uint8 public decimals;
Expand Down Expand Up @@ -718,7 +718,6 @@ returns(uint256)
* [ERC20Detailed](ERC20Detailed.md)
* [ERC20Mintable](ERC20Mintable.md)
* [IERC20](IERC20.md)
* [IOptionsExchange](IOptionsExchange.md)
* [LibNote](LibNote.md)
* [Migrations](Migrations.md)
* [MinterRole](MinterRole.md)
Expand Down
3 changes: 1 addition & 2 deletions docs/OptionsExchange.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ uint256 internal constant LARGE_BLOCK_SIZE;
uint256 internal constant LARGE_APPROVAL_NUMBER;

//public members
contract UniswapFactoryInterface public UNISWAP_FACTORY;
contract UniswapFactoryInterface public uniswapFactory;

```

Expand Down Expand Up @@ -198,7 +198,6 @@ function () external payable
* [ERC20Detailed](ERC20Detailed.md)
* [ERC20Mintable](ERC20Mintable.md)
* [IERC20](IERC20.md)
* [IOptionsExchange](IOptionsExchange.md)
* [LibNote](LibNote.md)
* [Migrations](Migrations.md)
* [MinterRole](MinterRole.md)
Expand Down
1 change: 0 additions & 1 deletion docs/OptionsFactory.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ returns(bool)
* [ERC20Detailed](ERC20Detailed.md)
* [ERC20Mintable](ERC20Mintable.md)
* [IERC20](IERC20.md)
* [IOptionsExchange](IOptionsExchange.md)
* [LibNote](LibNote.md)
* [Migrations](Migrations.md)
* [MinterRole](MinterRole.md)
Expand Down
5 changes: 2 additions & 3 deletions docs/OptionsUtils.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ View Source: [contracts/OptionsUtils.sol](../contracts/OptionsUtils.sol)
**Constants & Variables**

```js
contract UniswapFactoryInterface public UNISWAP_FACTORY;
contract CompoundOracleInterface public COMPOUND_ORACLE;
contract UniswapFactoryInterface public uniswapFactory;
contract CompoundOracleInterface public compoundOracle;

```

Expand Down Expand Up @@ -68,7 +68,6 @@ returns(bool)
* [ERC20Detailed](ERC20Detailed.md)
* [ERC20Mintable](ERC20Mintable.md)
* [IERC20](IERC20.md)
* [IOptionsExchange](IOptionsExchange.md)
* [LibNote](LibNote.md)
* [Migrations](Migrations.md)
* [MinterRole](MinterRole.md)
Expand Down
12 changes: 4 additions & 8 deletions docs/Oracle.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@ View Source: [contracts/Oracle.sol](../contracts/Oracle.sol)
**Constants & Variables**

```js
//internal members
mapping(address => bool) internal isCToken;
mapping(address => address) internal assetToCTokens;
address internal cETH;

//public members
contract CompoundOracleInterface public PriceOracle;
mapping(address => bool) public isCToken;
mapping(address => address) public assetToCTokens;
address public cETH;
contract CompoundOracleInterface public priceOracle;

```

Expand Down Expand Up @@ -86,7 +83,6 @@ returns(uint256)
* [ERC20Detailed](ERC20Detailed.md)
* [ERC20Mintable](ERC20Mintable.md)
* [IERC20](IERC20.md)
* [IOptionsExchange](IOptionsExchange.md)
* [LibNote](LibNote.md)
* [Migrations](Migrations.md)
* [MinterRole](MinterRole.md)
Expand Down
1 change: 0 additions & 1 deletion docs/Ownable.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ function _transferOwnership(address newOwner) internal nonpayable
* [ERC20Detailed](ERC20Detailed.md)
* [ERC20Mintable](ERC20Mintable.md)
* [IERC20](IERC20.md)
* [IOptionsExchange](IOptionsExchange.md)
* [LibNote](LibNote.md)
* [Migrations](Migrations.md)
* [MinterRole](MinterRole.md)
Expand Down
1 change: 0 additions & 1 deletion docs/Roles.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ bool
* [ERC20Detailed](ERC20Detailed.md)
* [ERC20Mintable](ERC20Mintable.md)
* [IERC20](IERC20.md)
* [IOptionsExchange](IOptionsExchange.md)
* [LibNote](LibNote.md)
* [Migrations](Migrations.md)
* [MinterRole](MinterRole.md)
Expand Down
Loading

0 comments on commit 8cbbb90

Please sign in to comment.