Aptos contracts
Aptos CLI
- Initialize your aptos account
$ aptos init
you will get a ".aptos" folder in your current folder.
config.yaml
profiles:
default:
private_key: "0x0000000000000000000000000000000000000000000000000000000000000000"
public_key: "0x0000000000000000000000000000000000000000000000000000000000000000"
account: 3add3576f7f3f411a5bd5fbab22dff4747107f25ce8726bf9926542718ff8a26 # your_original_account
rest_url: "https://fullnode.devnet.aptoslabs.com/v1"
faucet_url: "https://faucet.devnet.aptoslabs.com/"
- Get test APT
$ aptos account fund-with-faucet --account your_original_account --amount 100000000
- Create your resource account
$ aptos move run --function-id '0x1::resource_account::create_resource_account_and_fund' --args 'string:any string you want' 'hex:your_original_account' 'u64:10000000'
- Get your resourc eaccount
$ aptos account list --account your_original_account
Or find it on explorer: https://explorer.devnet.aptos.dev/account/your_original_account
TYPE:
0x1::resource_account::Container
DATA:
{
"store": {
"data": [
{
"key": "0x929ac1ea533d04f7d98c234722b40c229c3adb1838b27590d2237261c8d52b68",
"value": {
"account": "0x929ac1ea533d04f7d98c234722b40c229c3adb1838b27590d2237261c8d52b68" # your_resource_account
}
}
]
}
}
-
Replace your_original_account with your_resource_account in config.yaml
-
Edit Move.toml file
[package]
name = "pancake-swap"
version = "0.0.1"
[dependencies]
AptosFramework = { git = "https://github.com/aptos-labs/aptos-core.git", subdir = "aptos-move/framework/aptos-framework/", rev = "2a458b5ffaaf6a9de6fac679a53912c0be9fe217" }
AptosStdlib = { git = "https://github.com/aptos-labs/aptos-core.git", subdir = "aptos-move/framework/aptos-stdlib/", rev = "2a458b5ffaaf6a9de6fac679a53912c0be9fe217" }
[addresses]
pancake = "71e609393d30dfacaf477c9a9cd7824ae14b5f8d2a20c0b1917325d41e4a4aac" //repalce this with your_resource_account
dev = "2e5cc2bff22d15be32613aace67b7386251b8ae808a99241ee34b4703f780e2c" // repalce this with your_original_account which you created the resource account
zero = "0000000000000000000000000000000000000000000000000000000000000000"
default_admin = "0000000000000000000000000000000000000000000000000000000000000000" // need to create an admin account, and replace this.
- Compile code
$ aptos move compile
- Publish package
$ aptos move publish