Skip to content

Commit

Permalink
replace Python util with hex-encode.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
sisyphusSmiling committed Jan 29, 2024
1 parent 60af686 commit c02a435
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 20 deletions.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,8 @@ Coordinated Upgrade.
- A Cadence 1.0 compatible contract serving as an update to your existing contract. Extending our example, if you're
staging `A` in address `0x01`, you should have a contract named `A` that is Cadence 1.0 compatible. See the references
below for more information on Cadence 1.0 language changes.
- Your contract as a hex string.
- Included in this repo is a Python util to hex-encode your contract which outputs your contract's code as a hex
string. With Python installed, run:
```sh
python3 ./src/get_code_hex.py <PATH_TO_YOUR_CONTRACT>
```
- Your contract as a hex string. You can get this by running `./hex-encode.sh <CONTRACT_FILENAME>` - **be sure to
explicitly state your contract's import addresses!**

### Staging Your Contract Update

Expand Down
11 changes: 11 additions & 0 deletions hex-encode.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

# Check if exactly one argument is provided
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <FILENAME>"
exit 1
fi

# Hex encode the file's contents
cat "$1" | xxd -p | tr -d '\n'

14 changes: 0 additions & 14 deletions src/get_code_hex.py

This file was deleted.

0 comments on commit c02a435

Please sign in to comment.