Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
5d44e69
Optimism L2 integration
krebernisak Apr 6, 2021
557b4f2
Add more LinkTokenChild tests
krebernisak Apr 28, 2021
9b30fba
Update with latest upstream changes
krebernisak May 4, 2021
242a046
Introduce contract versioning
krebernisak May 5, 2021
94f2aa3
Change v0.6 contracts code style
krebernisak May 7, 2021
a712092
Remove export of JS helper functions
krebernisak May 7, 2021
9a0e59c
Include vendor contract source
krebernisak May 7, 2021
27ecfda
Add CI network teardown step
krebernisak May 9, 2021
8731d53
Replace OZ AccessControl with CL SimpleWriteAccessController
krebernisak May 10, 2021
4413c43
Polish tests
krebernisak May 11, 2021
bf2e2f7
Rename IERC20Child deposit/withdraw as mint/burn
krebernisak May 11, 2021
0c557cc
Use submodules for vendor contracts
krebernisak May 11, 2021
3b0ca75
Rename interfaces and flatten contracts
krebernisak May 12, 2021
7c41212
Fix the L2 gasPrice to 1 gwei
krebernisak May 12, 2021
e317c66
Fix tests error handling (avoid TX_OVERRIDES_BUG)
krebernisak May 13, 2021
6c37ec6
Revert token name change
krebernisak Jun 2, 2021
9e0dcd8
Update to latest deps + compiler config bug fix
krebernisak Jul 12, 2021
70fca4f
Add README docs (NOTICE) for LinkTokenChild contract
krebernisak Jun 28, 2021
07371f6
Remove Optimism 1 gwei fixed price
krebernisak Jul 15, 2021
426f174
Update to latest upstream changes
krebernisak Jul 15, 2021
f8a0f44
Merge branch 'master' into feature/oe-token
krebernisak Jul 15, 2021
b641420
Revert to before merge updated deps
krebernisak Jul 16, 2021
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
27 changes: 27 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#
# This action checks PRs to see if any CHANGELOG* files were updated.
# If none were, it will add a message to the PR asking if it would make sense to do so.
#
name: Changelog

on: pull_request

jobs:
changelog:
name: Changelog checker
runs-on: ubuntu-latest
steps:
- name: Check for changed files
id: changedfiles
uses: futuratrepadeira/changed-files@186b5b30b1f5e44ed655a59652746c3ce00d53ef # Version v3.1.1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
pattern: '^CHANGELOG.*$'
- name: Make a comment
uses: unsplash/comment-on-pr@d1a1d5dd1eb1bb657a01f4d92dd5e4d5bb7857d3 # Version v1.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: contains(steps.changedfiles.outputs.files_updated, 'CHANGELOG') != true && contains(steps.changedfiles.outputs.files_created, 'CHANGELOG') != true
with:
msg: "I see that you haven't updated any CHANGELOG files. Would it make sense to do so?"
check_for_duplicate_msg: false
43 changes: 43 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Main

on:
push:
branches:
- master
pull_request: ~

jobs:
run-basic-checks:
name: Run linters and unit tests
runs-on: [self-hosted]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/setup-node@v2
with:
node-version: '14.x'
- run: npm install -g yarn
- run: yarn install
- run: yarn setup
- run: yarn lint
- run: yarn test
run-integration:
name: Setup and run integration tests
needs: [run-basic-checks]
runs-on: [self-hosted]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/setup-node@v2
with:
node-version: '14.x'
- run: npm install -g yarn
- run: yarn install
- run: yarn setup
- name: Setup Optimism L2 network
run: yarn script:oe:up
- run: yarn test --network optimism
- name: Tear down Optimism L2 network
run: yarn script:oe:clean
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ coverage.json

# Misc
.DS_STORE

# Optimism monorepo used for integration tests
/optimism
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "vendor/smartcontractkit/chainlink"]
path = vendor/smartcontractkit/chainlink
url = git@github.com:smartcontractkit/chainlink.git
[submodule "vendor/OpenZeppelin/openzeppelin-contracts"]
path = vendor/OpenZeppelin/openzeppelin-contracts
url = git@github.com:OpenZeppelin/openzeppelin-contracts.git
2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node 14.16.0
yarn 1.22.4
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Changelog LinkToken

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased] - Apr 2021

### Added

- Access controlled mintable & burnable LinkToken, for use on sidechains and L2 networks.
- Added versioning to v0.6 & v0.7 contracts

### Changed

- Migrated to Hardhat and Waffle

### Fixed

### Removed

- Truffle framework and tests dependencies

## [1.1.0] - Mar 2021

Initial @chainlink/token release!

### Added

- Solidity 0.6 support
- Simple token swapping contract

## [1.0.6] - Sep 2018

Initial link_token release!
73 changes: 60 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,95 @@
# LINK Token Contracts [![Build Status](https://travis-ci.org/smartcontractkit/LinkToken.svg?branch=master)](https://travis-ci.org/smartcontractkit/LinkToken)
# LINK Token Contracts

The LINK token is an [EIP20](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md) token with additional [ERC677](https://github.com/ethereum/EIPs/issues/677) functionality.

The total supply of the token is 1,000,000,000, and each token is divisible up to 18 decimal places.

To prevent accidental burns, the token does not allow transfers to the contract itself and to 0x0.

Security audit for [v0.4 version of the contracts](./contracts/v0.4/) is available [here](https://gist.github.com/Arachnid/4aa88041bd6e34835b8c0fd051245e79).
Security audit for [0.4 version of the contracts](./contracts/v0.4/) is available [here](https://gist.github.com/Arachnid/4aa88041bd6e34835b8c0fd051245e79).

## Details

- Deployments:
- Ethereum Mainnet [LinkToken v0.4](./flat/v0.4/LinkToken.sol): [0x514910771AF9Ca656af840dff83E8264EcF986CA](https://etherscan.io/address/0x514910771af9ca656af840dff83e8264ecf986ca)
- Ethereum Mainnet [LinkToken 0.4](./contracts-flat/v0.4/LinkToken.sol): [0x514910771AF9Ca656af840dff83E8264EcF986CA](https://etherscan.io/address/0x514910771af9ca656af840dff83e8264ecf986ca)
- Decimals: 18
- Name: ChainLink Token
- Symbol: LINK

## ABI
## Setup

- [v0.4](./contracts/v0.4#solidity-abi)
- [v0.6](./contracts/v0.6#solidity-abi)
The project contains [0.4 contracts](./contracts/v0.4/) that were used for LINK Ethereum Mainnet deployment in 2017. For deployments moving forward, we use the updated [0.6 contracts](./contracts/v0.6/) which use a more recent version of solc and the OpenZeppelin token standards. These updates include a minor ABI change around approval/allowance naming.

You can also find interfaces and ABIs after running through the install `yarn setup` process.
To mitigate supply chain attack type of risk, we currently avoid using NPM modules to pull Solidity vendor code, but instead use git submodules. Make sure you pull submodules explicitly:

## Installation
```bash
git submodule update --init --recursive
```

The project contains [v0.4 contracts](./contracts/v0.4/) that were used for LINK Ethereum Mainnet deployment in 2017. For deployments moving forward, we use the updated [v0.6 contracts](./contracts/v0.6/) which use a more recent version of solc and the OpenZeppelin token standards. These updates include a minor ABI change around approval/allowance naming.
After submodules are updated, we can run:

```bash
yarn install
yarn
```

## Testing

Setup contracts:

```bash
yarn setup
```

**NOTICE:** This will compile all versions of the contracts, but as Hardhat doesn't have robust support for multiple Solidity versions the resulting artifacts will include only final (latest) compiler output. To make sure you compile the specific version please use the specific command:

Setup v0.6 contracts using Solidity 0.6 compiler:

```bash
build:contracts:0.6
```

### ABI

- [v0.4](./build/artifacts/contracts/v0.4)
- [v0.6](./build/artifacts/contracts/v0.6)
- [v0.7](./build/artifacts/contracts/v0.7)

You can also find interfaces and ABIs after running through the install `yarn setup` process.

## Testing

Run tests:

```bash
yarn test
```

This will test both v0.4 and v0.6 versions of the contracts.
This will run unit tests for all versions of the contracts.

## Integration testing

Integration tests are currently setup for Optimism contracts, and to run them make sure you have a local network running first.

The network can be started using a helpful script, which will clone the [Optimism monorepo](https://github.com/ethereum-optimism/optimism), build the :

```bash
yarn script:oe:up
```

Run tests:

```bash
yarn test --network optimism
```

This will run unit tests for all versions of the contracts, plus supported integration tests against the local L1 & L2 networks.

The network can be stopped using another script:

```bash
yarn script:oe:down
```

Or use the clean script, which will also delete all the images:

```bash
yarn script:oe:clean
```
File renamed without changes.
Loading