Aptos Verify
Aptos Verify is a Python library for verifying a module on Aptos Blockchain
Installation
Before install package, you need to setup Rust, Cargo and Aptos Cli
install Rust and Cargo: https://learning-rust.github.io/docs/installation/
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
install Aptos Cli: https://aptos.dev/tools/aptos-cli/install-cli/
curl -fsSL "https://aptos.dev/scripts/install_cli.py" | python3
Use the package manager pip to install aptos_verify.
pip install aptos-verify
Run with docker by load image from folder docker
Option 1 Build docker:
docker build -t aptos-verify-dk .
Option 2 Load docker by image:
docker load -i aptos-verify-dk.tar
Start container:
docker run -d -p 9998:9998 aptos-verify-dk
Usage
Use with CLI
Verify with source code that's published onchain
aptos-verify -m 0x8d2d7bcde13b2513617df3f98cdd5d0e4b9f714c6308b9204fe18ad900d92609::admin
Verify with source code on github
aptos-verify -m 0x190d44266241744264b964a37b8f09863167a12d3e70cda39376cfb4e3561e12::liquidity_pool -vm github -git https://github.com/pontem-network/liquidswap
Verify with local path (source code path)
aptos-verify -m 0x190d44266241744264b964a37b8f09863167a12d3e70cda39376cfb4e3561e12::liquidity_pool -vm local -path /<local_path>
Result:
**************** Rule: Compare bytecode between published bytecode and published source code onchain *****************
Result: True
Error Code: 0
Message: Verify success
Exception Class:
Use with sdk
from aptos_verify.main import start_verify
from aptos_verify.schemas import VerifyParams
import asyncio
async def main():
print('Start verify module: 0x8d2d7bcde13b2513617df3f98cdd5d0e4b9f714c6308b9204fe18ad900d92609::admin')
rs = await start_verify(
VerifyArgs(
module_id='0x8d2d7bcde13b2513617df3f98cdd5d0e4b9f714c6308b9204fe18ad900d92609::admin',
)
)
print('Result:')
print(rs)
if __name__ == "__main__":
asyncio.run(main())
Use with docker and API
http://localhost:9998/verify/<module_address>
Example:
http://localhost:9998/verify/0x8d2d7bcde13b2513617df3f98cdd5d0e4b9f714c6308b9204fe18ad900d92609::admin
Result:
{"message":"success","data":[{"title":"Compare bytecode between published bytecode and published source code onchain","message":"Verify success","is_skip":false,"error_code":0,"exeption_name":"","result":true,"traceback":"","error_message":""}]}
Run tests
pytest -s
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
Error Code
List error codes that returned from tool
| Error Code | Message |
|---|---|
| 0 | No Errors |
| 1 | Package Not Found |
| 2 | Module Not Found |
| 3 | Module Has No Source Code |
| 4 | Validation Error |
Metadata
Release files for aptos-verify 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aptos_verify-1.0.4-1-py3-none-any.whl | Python 3 | none | any | Details for aptos_verify-1.0.4-1-py3-none-any.whl |
Release files / aptos_verify-1.0.4-1-py3-none-any.whl
| Download URL | aptos_verify-1.0.4-1-py3-none-any.whl |
|---|---|
| Size | 18.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ea74f88ff04d46f399b2a3208285900b9381a150cc220120b6eede3592fd66a4
|
|
BLAKE2b-256 checksum How to use checksums |
b8b0b21977176bf76c58654252f666a2d72c72429451be4a03818ac579bd8f6a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Security for aptos-verify 1.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.