Skip to content

Commit

Permalink
Attempt to upgrade everything (esp saddle), fix some tests (#67)
Browse files Browse the repository at this point in the history
* Attempt to upgrade everything (esp saddle), fix some tests

* CToken delegate for a comp-like token (#68)

* Add networks config for cUNI (#69)

Co-authored-by: Antonina Norair <[email protected]>
  • Loading branch information
jflatow and toninorair authored Oct 3, 2020
1 parent 4caf72a commit ca6bc76
Show file tree
Hide file tree
Showing 34 changed files with 4,184 additions and 1,210 deletions.
55 changes: 25 additions & 30 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ orbs:
jobs:
test:
docker:
- image: circleci/node:11
- image: circleci/node:13
working_directory: ~/repo
steps:
- run:
Expand All @@ -16,28 +16,26 @@ jobs:
- checkout
- restore_cache:
keys:
- v2-dependencies-{{ checksum "package.json" }}
- v2-dependencies-
- v3-dependencies-{{ checksum "yarn.lock" }}
- restore_cache:
keys:
- v2-scenario/dependencies-{{ checksum "scenario/package.json" }}
- v2-scenario/dependencies-
- v3-scenario/dependencies-{{ checksum "scenario/yarn.lock" }}
- restore_cache:
keys:
- v2-solcache
- v3-solcache
- restore_cache:
keys:
- v2-scencache
- run: yarn install
- run: cd scenario && yarn install
- v3-scencache
- run: yarn install || (yarn cache clean && yarn install)
- run: cd scenario && (yarn install || (yarn cache clean && yarn install))
- save_cache:
paths:
- node_modules
key: v2-dependencies-{{ checksum "package.json" }}
key: v3-dependencies-{{ checksum "yarn.lock" }}
- save_cache:
paths:
- scenario/node_modules
key: v2-scenario-dependencies-{{ checksum "scenario/package.json" }}
key: v3-scenario-dependencies-{{ checksum "scenario/yarn.lock" }}
- attach_workspace:
at: ~/repo
- run: mkdir ~/junit
Expand All @@ -50,12 +48,12 @@ jobs:
paths:
- .build
- .solcache
key: v2-solcache
key: v3-solcache
- save_cache:
paths:
- scenario/.tsbuilt
- .scencache
key: v2-scencache
key: v3-scencache
- store_test_results:
path: ~/junit
- store_artifacts:
Expand All @@ -76,7 +74,7 @@ jobs:

coverage:
docker:
- image: circleci/node:11
- image: circleci/node:13
working_directory: ~/repo
steps:
- run:
Expand All @@ -86,24 +84,22 @@ jobs:
- checkout
- restore_cache:
keys:
- v2-dependencies-{{ checksum "package.json" }}
- v2-dependencies-
- v3-dependencies-{{ checksum "yarn.lock" }}
- restore_cache:
keys:
- v2-scenario/dependencies-{{ checksum "scenario/package.json" }}
- v2-scenario/dependencies-
- v3-scenario-dependencies-{{ checksum "scenario/yarn.lock" }}
- restore_cache:
keys:
- v2-solcache
- v3-solcache
- restore_cache:
keys:
- v2-scencache
- run: yarn install
- run: cd scenario && yarn install
- v3-scencache
- run: yarn install || (yarn cache clean && yarn install)
- run: cd scenario && (yarn install || (yarn cache clean && yarn install))
- save_cache:
paths:
- node_modules
key: v2-dependencies-{{ checksum "package.json" }}
key: v3-dependencies-{{ checksum "yarn.lock" }}
- save_cache:
paths:
- scenario/node_modules
Expand All @@ -121,12 +117,12 @@ jobs:
paths:
- .build
- .solcachecov
key: v2-solcache
key: v3-solcache
- save_cache:
paths:
- scenario/.tsbuilt
- .scencache
key: v2-scencache
key: v3-scencache
- store_test_results:
path: ~/junit
- store_artifacts:
Expand All @@ -142,19 +138,18 @@ jobs:

lint:
docker:
- image: circleci/node:11
- image: circleci/node:13
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- v2-dependencies-{{ checksum "package.json" }}
- v2-dependencies-
- run: yarn install
- v3-dependencies-{{ checksum "yarn.lock" }}
- run: yarn install || (yarn cache clean && yarn install)
- save_cache:
paths:
- node_modules
key: v2-dependencies-{{ checksum "package.json" }}
key: v3-dependencies-{{ checksum "yarn.lock" }}
- attach_workspace:
at: ~/repo
- run: yarn run lint
Expand Down
28 changes: 28 additions & 0 deletions contracts/CCompLikeDelegate.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
pragma solidity ^0.5.16;

import "./CErc20Delegate.sol";

interface CompLike {
function delegate(address delegatee) external;
}

/**
* @title Compound's CCompLikeDelegate Contract
* @notice CTokens which can 'delegate votes' of their underlying ERC-20
* @author Compound
*/
contract CCompLikeDelegate is CErc20Delegate {
/**
* @notice Construct an empty delegate
*/
constructor() public CErc20Delegate() {}

/**
* @notice Admin call to delegate the votes of the COMP-like underlying
* @param compLikeDelegatee The address to delegate votes to
*/
function _delegateCompLikeTo(address compLikeDelegatee) external {
require(msg.sender == admin, "only the admin may set the comp-like delegate");
CompLike(underlying).delegate(compLikeDelegatee);
}
}
Loading

0 comments on commit ca6bc76

Please sign in to comment.