Skip to content

Commit 3d6d9a0

Browse files
committed
Cleanup: removed secret tokens and fixed License mention
1 parent daed527 commit 3d6d9a0

File tree

7 files changed

+78
-5
lines changed

7 files changed

+78
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
# TODO: Need to find a better solution to import files in python
77
unit-tests/dot_algo_registry.py
88
unit-tests/dot_algo_name_record.py
9+
unit-tests/mysecrets.py

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
# ANS 1.0 registry smart contracts
1+
# ANS v1.0 registry smart contracts
22

3-
Smart contract and logic signature code for Algorand Name Service 1.0
3+
Smart contract and logic signature code for Algorand Name Service v1.0
44

55
## Run unit tests
6+
Add PureStake API key to `unit-tests/mysecrets.py`
7+
```python
8+
# unit-tests/mysecrets.py
9+
MY_PURESTAKE_TOKEN="<your-token>"
10+
```
611

712
Change directory into unit-tests and run python scripts:
8-
```
13+
```bash
914
cd unit-tests
1015
python3 TestDotAlgoNameRegistry.py
1116
```

contracts/constants.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
'''
2+
Copyright (c) 2022 Algorand Name Service
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a copy
5+
of this software and associated documentation files (the "Software"), to deal
6+
in the Software without restriction, including without limitation the rights
7+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
copies of the Software, and to permit persons to whom the Software is
9+
furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in all
12+
copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
SOFTWARE.
21+
'''
122
COST_FOR_3 = 150000000
223
COST_FOR_4 = 50000000
324
COST_FOR_5 = 5000000

contracts/dot_algo_name_record.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@
77
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
88
copies of the Software, and to permit persons to whom the Software is
99
furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in all
12+
copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
SOFTWARE.
1021
'''
1122

1223
from pyteal import *

contracts/dot_algo_registry.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@
77
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
88
copies of the Software, and to permit persons to whom the Software is
99
furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in all
12+
copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
SOFTWARE.
1021
'''
1122

1223
from pyteal import *

unit-tests/TestDotAlgoNameRegistry.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@
77
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
88
copies of the Software, and to permit persons to whom the Software is
99
furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in all
12+
copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
SOFTWARE.
1021
'''
1122

1223
import unittest, time

unit-tests/ans_helper.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@
77
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
88
copies of the Software, and to permit persons to whom the Software is
99
furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in all
12+
copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
SOFTWARE.
1021
'''
1122

1223
from algosdk import mnemonic, account, encoding
@@ -24,6 +35,8 @@
2435
from contracts.dot_algo_name_record import ValidateRecord
2536
import base64
2637
import datetime,time
38+
# Import PureStake API
39+
import mysecrets
2740

2841

2942
def SetupClient(network):
@@ -36,9 +49,9 @@ def SetupClient(network):
3649
elif(network=="purestake"):
3750
# Purestake conn
3851
algod_address = "https://testnet-algorand.api.purestake.io/ps2"
39-
algod_token = "iG4m46pAcU5ws8WYhgYPu1rywUbfYT2DaAfSs9Tv"
52+
algod_token = mysecrets.MY_PURESTAKE_TOKEN
4053
headers = {
41-
"X-API-Key": algod_token,
54+
"X-API-Key": mysecrets.MY_PURESTAKE_TOKEN
4255
}
4356

4457
else:

0 commit comments

Comments
 (0)