Compare commits

...

5 Commits

Author SHA1 Message Date
smart_ex 4dea68f716 update readme 2022-06-24 17:21:40 +10:00
smart_ex 1c3381e280 add index.d.ts to package.json, update readme 2022-06-24 17:21:40 +10:00
smart_ex 7bded95560 bump version 1.0.7 2022-06-22 20:29:30 +10:00
smart_ex b531347384 Basic types definition for torn-token package 2022-06-22 20:29:30 +10:00
Danil Kovtonyuk 456beaafca
feat: add contracts 2022-02-16 19:58:18 +10:00
7 changed files with 164 additions and 5 deletions

View File

@ -22,5 +22,6 @@
"object-curly-spacing": ["error", "always"],
"comma-dangle": ["error", "always-multiline"],
"require-await": "error"
}
},
"ignorePatterns": ["*.d.ts"]
}

View File

@ -2,3 +2,4 @@
build
scripts
contracts/ECDSA.sol
*.d.ts

View File

@ -1,6 +1,6 @@
# Tornado.cash token (TORN) [![Build Status](https://github.com/tornadocash/torn-token/workflows/build/badge.svg)](https://github.com/tornadocash/torn-token/actions) [![npm](https://img.shields.io/npm/v/torn-token)](https://www.npmjs.com/package/torn-token)
## Dependencies
## Requirements
1. node 12
2. yarn
@ -11,3 +11,7 @@
$ yarn
$ yarn test
```
## Licence
MIT

View File

@ -38,6 +38,11 @@ module.exports = {
withdrawVerifier: { address: 'withdraw-verifier.contract.tornadocash.eth' },
poseidonHasher2: { address: 'poseidon2.contract.tornadocash.eth' },
poseidonHasher3: { address: 'poseidon3.contract.tornadocash.eth' },
feeManager: { address: 'fee-manager.contract.tornadocash.eth' },
tornadoStakingRewards: { address: 'staking-rewards.contract.tornadocash.eth' },
relayerRegistry: { address: 'relayer-registry.contract.tornadocash.eth' },
tornadoRouter: { address: 'tornado-router.contract.tornadocash.eth' },
instanceRegistry: { address: 'instance-registry.contract.tornadocash.eth' },
deployer: { address: 'deployer.contract.tornadocash.eth' },
vesting: {
team1: {

109
index.d.ts vendored Normal file
View File

@ -0,0 +1,109 @@
export const torn: Torn
export const governance: Address
export const governanceImpl: Address
export const voucher: Voucher
export const miningV2: Mining
export const rewardSwap: RewardSwap
export const tornadoTrees: TornadoTrees
export const tornadoProxy: Address
export const tornadoProxyLight: Address
export const rewardVerifier: Address
export const treeUpdateVerifier: Address
export const withdrawVerifier: Address
export const poseidonHasher2: Address
export const poseidonHasher3: Address
export const feeManager: Address
export const tornadoStakingRewards: Address
export const relayerRegistry: Address
export const tornadoRouter: Address
export const instanceRegistry: Address
export const deployer: Address
export const vesting: Vesting
export const instances: Instances
export type availableIds = 1 | 5 | 10 | 56 | 100 | 137 | 42161 | 43114
export type availableTokens = 'eth' | 'dai' | 'cdai' | 'usdc' | 'usdt' | 'wbtc' | 'xdai' | 'matic' | 'avax' | 'bnb'
export type netIds = `netId${availableIds}`
export type Address = {
address: string
}
export type Instances = {
[p in netIds]: NetInstances;
};
export type NetInstances = {
[p in availableTokens]?: TInstance;
}
export type TInstance = {
instanceAddress: InstanceAddress
tokenAddress?: string
symbol: string
decimals: number
}
export type InstanceAddress = {
'0.1'?: string
'1'?: string
'10'?: string
'100'?: string
'500'?: string
'1000'?: string
'5000'?: string
'10000'?: string
'50000'?: string
'100000'?: string
'500000'?: string
'5000000'?: string
}
export type Mining = Address & {
initialBalance: string
rates: Rate[]
}
export type Rate = {
instance: string
value: string
}
export type RewardSwap = Address & {
poolWeight: number
}
export type Torn = Address & {
cap: string
pausePeriod: number
distribution: { [key: string]: Distribution }
}
export type Distribution = {
to: string
amount: string
}
export type TornadoTrees = Address & {
levels: number
}
export interface Vesting {
team1: Governance;
team2: Governance;
team3: Governance;
team4: Governance;
team5: Governance;
governance: Governance;
}
export type Governance = Address & {
cliff: number
duration: number
beneficiary?: string
}
export type Voucher = Address & {
duration: number
}

View File

@ -1,14 +1,21 @@
{
"name": "torn-token",
"version": "1.0.5",
"version": "1.0.8",
"main": "config.js",
"repository": "https://github.com/tornadocash/torn-token.git",
"author": "Tornadocash team <hello@tornado.cash>",
"license": "MIT",
"keywords": [
"web3",
"ethereum",
"solidity"
],
"files": [
"config.js",
"contracts/*"
"contracts/*",
"index.d.ts"
],
"types": "index.d.ts",
"scripts": {
"compile": "truffle compile",
"coverage": "yarn compile && truffle run coverage",
@ -41,6 +48,7 @@
"@openzeppelin/contracts": "^3.1.0",
"eth-sig-util": "^2.5.3",
"ethereumjs-util": "^7.0.3",
"web3": "^1.2.11"
"web3": "^1.2.11",
"web3-utils": "^1.7.3"
}
}

View File

@ -357,6 +357,13 @@
dependencies:
"@types/node" "*"
"@types/bn.js@^5.1.0":
version "5.1.0"
resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.0.tgz#32c5d271503a12653c62cf4d2b45e6eab8cebc68"
integrity sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA==
dependencies:
"@types/node" "*"
"@types/color-name@^1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0"
@ -1945,6 +1952,17 @@ ethereumjs-util@^7.0.3:
ethjs-util "0.1.6"
rlp "^2.2.4"
ethereumjs-util@^7.1.0:
version "7.1.4"
resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.1.4.tgz#a6885bcdd92045b06f596c7626c3e89ab3312458"
integrity sha512-p6KmuPCX4mZIqsQzXfmSx9Y0l2hqf+VkAiwSisW3UKUFdk8ZkAt+AYaor83z2nSi6CU2zSsXMlD80hAbNEGM0A==
dependencies:
"@types/bn.js" "^5.1.0"
bn.js "^5.1.2"
create-hash "^1.1.2"
ethereum-cryptography "^0.1.3"
rlp "^2.2.4"
ethers@4.0.0-beta.3:
version "4.0.0-beta.3"
resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.0-beta.3.tgz#15bef14e57e94ecbeb7f9b39dd0a4bd435bc9066"
@ -5828,6 +5846,19 @@ web3-utils@1.2.6:
underscore "1.9.1"
utf8 "3.0.0"
web3-utils@^1.7.3:
version "1.7.3"
resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.7.3.tgz#b214d05f124530d8694ad364509ac454d05f207c"
integrity sha512-g6nQgvb/bUpVUIxJE+ezVN+rYwYmlFyMvMIRSuqpi1dk6ApDD00YNArrk7sPcZnjvxOJ76813Xs2vIN2rgh4lg==
dependencies:
bn.js "^4.11.9"
ethereum-bloom-filters "^1.0.6"
ethereumjs-util "^7.1.0"
ethjs-unit "0.1.6"
number-to-bn "1.7.0"
randombytes "^2.1.0"
utf8 "3.0.0"
web3@1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/web3/-/web3-1.2.1.tgz#5d8158bcca47838ab8c2b784a2dee4c3ceb4179b"