Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssetManager Contract #1

Merged
merged 53 commits into from
Aug 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
96fc994
Initial draft of AssetManager Contract
johnwhitton Jul 28, 2022
96775c0
Make withdraw only able to be called by Owner
johnwhitton Jul 28, 2022
f5f2b29
Initial draft of transfer functionality
johnwhitton Jul 30, 2022
a3a232c
Remove extraneous folders
johnwhitton Jul 31, 2022
6dbf316
Index events, add errors and reverts, add operator role
johnwhitton Jul 31, 2022
7829e02
Working Transfer function, with events and tested for ERC20, ERC721 a…
johnwhitton Jul 31, 2022
206fd47
Testing cater for gas costs and check events emitted
johnwhitton Aug 1, 2022
f02de7f
Add user limits per destination address using two-level mapping
johnwhitton Aug 2, 2022
31de63c
Update AssetManager to be upgradeable, use access control(multiple op…
johnwhitton Aug 3, 2022
89caeb1
Add ability for admins to change globalUserAuthLimit and check limit …
johnwhitton Aug 4, 2022
f731def
Add in granular positive tests for deposit, withdraw, approve and tra…
johnwhitton Aug 4, 2022
d13252b
Addd global deposit limit
johnwhitton Aug 4, 2022
b19be50
Document AssetManager.sol
johnwhitton Aug 5, 2022
be2007d
Fix minor documentation formatting issues
johnwhitton Aug 5, 2022
06f151d
Add in capability to get operators and operator count by using Access…
johnwhitton Aug 5, 2022
284ec06
fix some typos
polymorpher Aug 7, 2022
918ddca
Merge branch 'main' into jw-contract
polymorpher Aug 7, 2022
88d8ec1
fix relayer description
polymorpher Aug 7, 2022
6c44982
plural add or remove operators
polymorpher Aug 7, 2022
220f637
improve initialize
polymorpher Aug 7, 2022
d419414
fix typos, formats, allow allowance to be called any time
polymorpher Aug 7, 2022
1b9ff86
fix bug re: allowance change after send
polymorpher Aug 7, 2022
67f54cd
fmt
polymorpher Aug 7, 2022
59c7475
fmt
polymorpher Aug 7, 2022
bc2c9e8
rm prettier; refine eslint rules
polymorpher Aug 7, 2022
71ba069
fmt
polymorpher Aug 7, 2022
7198fb5
ignore docs
polymorpher Aug 7, 2022
5af1139
rm docs
polymorpher Aug 7, 2022
636e4c6
fmt
polymorpher Aug 7, 2022
7ab226f
ignore openzeppellin
polymorpher Aug 7, 2022
4893499
ditto
polymorpher Aug 7, 2022
f1fcd34
fix typos and events in tests
polymorpher Aug 7, 2022
c0fc296
fix empty env json parse exception
polymorpher Aug 7, 2022
019fa66
rm duplicate env url
polymorpher Aug 7, 2022
e8791b7
fix bad doc parameters in .sol
polymorpher Aug 7, 2022
1fa401d
minor typo fix
polymorpher Aug 7, 2022
aa0289b
Fix tests on native token transfer to check recipient allowance is re…
johnwhitton Aug 7, 2022
dc73743
Display operators when deploying AssetManager.sol
johnwhitton Aug 7, 2022
722a874
Clean up unused environement variables and create config.test object
johnwhitton Aug 7, 2022
fc603ab
Add in hardhat-contract-sizer and change optimizer.runs to 200
johnwhitton Aug 7, 2022
73ddfd9
Testing modularization, 100 percent coverage, update configuration an…
johnwhitton Aug 8, 2022
960998d
fix typos
polymorpher Aug 9, 2022
a4c15d7
cleanup imports
polymorpher Aug 9, 2022
51ad980
fix minor typos
polymorpher Aug 10, 2022
c9d85ab
comment out suppressed test code and fix typo
polymorpher Aug 10, 2022
5ea1802
clean up "this"
polymorpher Aug 10, 2022
96c8bc1
cleanup imports and move config
polymorpher Aug 10, 2022
21ba43f
eliminates require
polymorpher Aug 10, 2022
26cdf9c
cleanup env
polymorpher Aug 10, 2022
a2d8980
fix compile
polymorpher Aug 10, 2022
539de19
readme
polymorpher Aug 10, 2022
ab6981e
rename stuff
polymorpher Aug 10, 2022
e405015
improve test readme
polymorpher Aug 10, 2022
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
24 changes: 24 additions & 0 deletions miniwallet/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Network config

ETHERSCAN_API_KEY=ABC123ABC123ABC123ABC123ABC123ABC1
PRIVATE_KEY=abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1
HARDHAT_URL=http://localhost:8545
LOCALNET_URL=http://localhost:9500
DEVNET_URL=https://api.s0.ps.hmny.io/
TESTNET_URL=https://api.s0.b.hmny.io
MAINNET_URL=https://api.harmony.one
LOCALGETH_URL=http://localhost:8645
ROPSTEN_URL=https://ropsten.infura.io/v3/abc123abc123abc123abc123abc123ab
SEPOLIA_URL=https://rpc.sepolia.dev
ETHEREUM_URL=https://mainnet.infura.io/v3/abc123abc123abc123abc123abc123ab

# Application config

INITIAL_OPERATOR_THRESHOLD=10
INITIAL_OPERATORS=["0x70997970C51812dc3A010C7d01b50e0d17dc79C8","0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC","0x90F79bf6EB2c4f870365E785982E1f101E93b906"]
INITIAL_USER_LIMIT=1000000
INITIAL_AUTH_LIMIT=100000
TEST_INITIAL_OPERATOR_THRESHOLD=10
TEST_INITIAL_OPERATORS=["0x70997970C51812dc3A010C7d01b50e0d17dc79C8","0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC","0x90F79bf6EB2c4f870365E785982E1f101E93b906"]
TEST_INITIAL_USER_LIMIT=1000
TEST_INITIAL_AUTH_LIMIT=100
4 changes: 4 additions & 0 deletions miniwallet/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
artifacts
cache
coverage
27 changes: 27 additions & 0 deletions miniwallet/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module.exports = {
env: {
browser: false,
es2021: true,
mocha: true,
node: true
},
plugins: ['@typescript-eslint'],
extends: [
'standard',
'plugin:node/recommended'
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 12
},
rules: {
'node/no-unsupported-features/es-syntax': [
'error',
{ ignores: ['modules'] }
],
'node/no-unpublished-import': 0,
'node/no-missing-import': ['error', {
tryExtensions: ['.js', '.json', '.node', '.ts']
}]
}
}
15 changes: 15 additions & 0 deletions miniwallet/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
node_modules
.env
coverage
coverage.json
typechain

#Hardhat files
cache
artifacts
build

# Additional files
docs
data
.openzeppelin
3 changes: 3 additions & 0 deletions miniwallet/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
hardhat.config.ts
scripts
test
7 changes: 7 additions & 0 deletions miniwallet/.solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "solhint:recommended",
"rules": {
"compiler-version": ["error", "^0.8.0"],
"func-visibility": ["warn", { "ignoreConstructors": true }]
}
}
1 change: 1 addition & 0 deletions miniwallet/.solhintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
11 changes: 11 additions & 0 deletions miniwallet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SMS Controlled Mini-Wallet

See design and specification at [mini-wallet in SMS Wallet Wiki](https://github.com/polymorpher/sms-wallet/wiki#sms-controlled-mini-wallet)

This folder contains the code for the smart contracts, tests, and deployment scripts.

The main smart contract is [AssetManager](./contracts/AssetManager.sol). See in-line documentations for technical references.




Loading