Production-ready Move smart contract for decentralized payments on Aptos blockchain.
- ✅ Direct APT payments between addresses
- ✅ Payment request creation and fulfillment
- ✅ Event emissions for tracking
- ✅ View functions for querying payment data
- ✅ Payment history management
- Install Aptos CLI:
curl -fsSL "https://aptos.dev/scripts/install_cli.py" | python3- Verify installation:
aptos --versioncd ignore1/contracts_lancerpay
./scripts/deploy.sh testnet./scripts/deploy.sh mainnetAfter deployment, copy the module address and update your .env:
NEXT_PUBLIC_INTEGRATION_APTOS=true
NEXT_PUBLIC_APTOS_NETWORK=testnet
NEXT_PUBLIC_APTOS_MODULE_ADDRESS=0xYOUR_MODULE_ADDRESS_HERE-
send_payment
- Direct APT payment to recipient
- Args:
recipient: address, amount: u64
-
create_payment_request
- Create a payment request
- Args:
recipient: address, amount: u64, token_type: String
-
fulfill_payment_request
- Fulfill an existing payment request
- Args:
request_owner: address, request_id: u64
-
get_payment_request
- Get details of a payment request
- Args:
owner: address, request_id: u64 - Returns:
(address, u64, String, bool, u64)
-
get_request_count
- Get total number of requests for an address
- Args:
owner: address - Returns:
u64
-
has_payment_history
- Check if address has payment history
- Args:
addr: address - Returns:
bool
Run contract tests:
cd contract
aptos move testcd contract
aptos move compileaptos move test --coveragenpm run move:publish- Publish Move contractsnpm run move:test- Run Move unit testsnpm run move:compile- Compile Move contractsnpm run move:upgrade- Upgrade Move contracts
contract/
├── Move.toml # Package configuration
├── sources/
│ └── payment_system.move # Main payment contract
└── tests/ # Contract tests
The contract emits the following events:
PaymentSentEvent- When a payment is sentPaymentRequestCreatedEvent- When a payment request is createdPaymentRequestFulfilledEvent- When a request is fulfilled
- All amounts are validated (must be > 0)
- Payment requests can only be fulfilled once
- Request IDs are validated before access
- Proper error handling with descriptive error codes
E_NOT_INITIALIZED = 1- Payment history not initializedE_ALREADY_FULFILLED = 2- Payment request already fulfilledE_INVALID_AMOUNT = 3- Amount must be greater than 0E_INVALID_REQUEST_ID = 4- Request ID does not exist
For issues or questions, please refer to the main repository documentation.