Skip to content

Commit

Permalink
Cleanup: removed secret tokens and fixed License mention
Browse files Browse the repository at this point in the history
  • Loading branch information
smedury committed Mar 9, 2022
1 parent daed527 commit 3d6d9a0
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
# TODO: Need to find a better solution to import files in python
unit-tests/dot_algo_registry.py
unit-tests/dot_algo_name_record.py
unit-tests/mysecrets.py
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# ANS 1.0 registry smart contracts
# ANS v1.0 registry smart contracts

Smart contract and logic signature code for Algorand Name Service 1.0
Smart contract and logic signature code for Algorand Name Service v1.0

## Run unit tests
Add PureStake API key to `unit-tests/mysecrets.py`
```python
# unit-tests/mysecrets.py
MY_PURESTAKE_TOKEN="<your-token>"
```

Change directory into unit-tests and run python scripts:
```
```bash
cd unit-tests
python3 TestDotAlgoNameRegistry.py
```
Expand Down
21 changes: 21 additions & 0 deletions contracts/constants.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
'''
Copyright (c) 2022 Algorand Name Service
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
'''
COST_FOR_3 = 150000000
COST_FOR_4 = 50000000
COST_FOR_5 = 5000000
Expand Down
11 changes: 11 additions & 0 deletions contracts/dot_algo_name_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
'''

from pyteal import *
Expand Down
11 changes: 11 additions & 0 deletions contracts/dot_algo_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
'''

from pyteal import *
Expand Down
11 changes: 11 additions & 0 deletions unit-tests/TestDotAlgoNameRegistry.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
'''

import unittest, time
Expand Down
17 changes: 15 additions & 2 deletions unit-tests/ans_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
'''

from algosdk import mnemonic, account, encoding
Expand All @@ -24,6 +35,8 @@
from contracts.dot_algo_name_record import ValidateRecord
import base64
import datetime,time
# Import PureStake API
import mysecrets


def SetupClient(network):
Expand All @@ -36,9 +49,9 @@ def SetupClient(network):
elif(network=="purestake"):
# Purestake conn
algod_address = "https://testnet-algorand.api.purestake.io/ps2"
algod_token = "iG4m46pAcU5ws8WYhgYPu1rywUbfYT2DaAfSs9Tv"
algod_token = mysecrets.MY_PURESTAKE_TOKEN
headers = {
"X-API-Key": algod_token,
"X-API-Key": mysecrets.MY_PURESTAKE_TOKEN
}

else:
Expand Down

0 comments on commit 3d6d9a0

Please sign in to comment.