Skip to content

Commit

Permalink
Correct Hub1369p14 -> Hub1369p13
Browse files Browse the repository at this point in the history
  • Loading branch information
cblp committed Sep 24, 2024
1 parent af586a5 commit fb9c9fb
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 28 deletions.
8 changes: 4 additions & 4 deletions .well-known/stellar.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ is_unlimited=false
image="https://nft.montelibero.org/images/UB2117.png"

[[CURRENCIES]]
code="Hub1369p14"
issuer="GCTE2BR4WYD73Y3KRC6JOX2LYFH5WKAWO7VYCZXVZ5XLNWMYCIQFDNFT"
code="Hub1369p13"
issuer="GBGWJMXGISX5YXQMTWOPJT6QZADQLFJPHREXDTM7JJCSOZWC7BVM3NFT"
name="Montelibero-City Corporate hub"
desc="Corporate hub at plot 1369/14"
desc="Corporate hub at plot 1369/13"
status="live"
display_decimals=0
is_unlimited=false
image="https://nft.montelibero.org/images/Hub1369p14.jpeg"
image="https://nft.montelibero.org/images/Hub1369p13.jpeg"

[[CURRENCIES]]
code="MtlDome001"
Expand Down
Binary file added images/Hub1369p13.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/Hub1369p14.jpeg
Binary file not shown.
64 changes: 40 additions & 24 deletions mtl_nft.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,22 @@
from stellar_sdk import Asset, Keypair, Network, Server, TransactionBuilder


OPERATOR_KP = Keypair.from_secret("")
OPERATOR_KP = Keypair.from_secret(open("/tmp/a").read().strip())

ISSUER_KP = Keypair.from_secret(
"SBOEURAX4BL5LQVLIN6LOMPM2DFLOYTVCQ5HHRK4IMVQGOYKDJ67EEIS"
"SCGZP5RWVGLZ6HQHF4ANMZHRSQANRZ2SVJEHFWEDN5P6WQUAWA7FWGIW"
)
ISSUER_ACCOUNT = (
ISSUER_KP.public_key
# GCTE2BR4WYD73Y3KRC6JOX2LYFH5WKAWO7VYCZXVZ5XLNWMYCIQFDNFT
# GBGWJMXGISX5YXQMTWOPJT6QZADQLFJPHREXDTM7JJCSOZWC7BVM3NFT
)

TOKEN_NAMES = ["Hub1369p14", "MtlDome001", "MtlDome002", "WH1369p20"]
TOKEN_NAMES = ["Hub1369p13"]
TOKENS_TO_MINT = [Asset(name, ISSUER_ACCOUNT) for name in TOKEN_NAMES]
TOKENS_TO_BURN = [
Asset("BP1369p14", "GC2ZK7OONSYECUWI42A5KXG2M7XIGEC2CIBOD4BJ4EHWYJWV6BHC6NFT"),
Asset("BP1369p20", "GC2ZK7OONSYECUWI42A5KXG2M7XIGEC2CIBOD4BJ4EHWYJWV6BHC6NFT"),
]
TOKENS_TO_BURN = []

TOKEN_HOLDER = "GBJ3HT6EDPWOUS3CUSIJW5A4M7ASIKNW4WFTLG76AAT5IE6VGVN47TIC"
# TOKEN_HOLDER = "GCOJHUKGHI6IATN7AIEK4PSNBPXIAIZ7KB2AWTTUCNIAYVPUB2DMCITY"

DISTRIBUTOR_ACCOUNT = "GDPHAKGLJ3B56BK4CZ2VMTYEDI6VZ2CTHUHSFAFSPGSTJHZEI3ATOKEN"
DISTRIBUTOR_KP = Keypair.from_public_key(DISTRIBUTOR_ACCOUNT)
Expand All @@ -47,9 +46,11 @@ def __init__(self, source_address: str, issuer_address: str):
def create_issuer(self):
self.append_create_account_op(self.issuer_address, "1")

def init_issuer(self):
def init_and_lock_issuer(self):
self.append_set_options_op(
home_domain="nft.montelibero.org", source=self.issuer_address
home_domain="nft.montelibero.org",
master_weight=0,
source=self.issuer_address,
)

def create_and_init_issuer(self):
Expand All @@ -59,13 +60,13 @@ def create_and_init_issuer(self):
def set_issuer_data(self, key, value):
self.append_manage_data_op(key, value, source=self.issuer_address)

def trust(self, asset: Asset, account: Optional[str] = None):
self.append_change_trust_op(asset, limit=ATOMIC_TOKEN, source=account)
def trust(self, asset: Asset, source: Optional[str] = None):
self.append_change_trust_op(asset, limit=ATOMIC_TOKEN, source=source)

def mint_to(self, asset: Asset, receiver: str):
self.trust(
asset,
account=(
source=(
None if receiver == self.source_account.account.account_id else receiver
),
)
Expand All @@ -76,9 +77,6 @@ def mint_to(self, asset: Asset, receiver: str):
def mint(self, asset: Asset):
self.mint_to(asset, DISTRIBUTOR_ACCOUNT)

def lock_issuer(self):
self.append_set_options_op(master_weight=0, source=self.issuer_address)

def build_and_sign(self, signers):
transaction = self.build()
for signer in signers:
Expand All @@ -91,7 +89,7 @@ def send(self, asset: Asset, source: str, destination: str):
def send_from_distributor(self, asset: Asset, destination: str):
self.send(asset, DISTRIBUTOR_ACCOUNT, destination)

def untrust(self, asset: Asset, source: str):
def untrust(self, asset: Asset, source: Optional[str] = None):
self.append_change_trust_op(asset=asset, limit="0", source=source)

def burn(
Expand All @@ -113,16 +111,34 @@ def main():
builder = TokenBuilder(
source_address=DISTRIBUTOR_ACCOUNT, issuer_address=ISSUER_ACCOUNT
)
# builder.create_and_init_issuer()
for token in TOKENS_TO_MINT:
builder.trust(token)
# builder.mint_to(token, TOKEN_HOLDER)
builder.add_text_memo("+Hub13")

# builder.create_issuer()
# for token in TOKENS_TO_MINT:
# # builder.trust(token, DISTRIBUTOR_ACCOUNT)
# builder.mint_to(token, TOKEN_HOLDER)
# builder.init_and_lock_issuer()

# correct mistakes
builder.untrust(
Asset("BP1369p13", "GC2ZK7OONSYECUWI42A5KXG2M7XIGEC2CIBOD4BJ4EHWYJWV6BHC6NFT")
)
builder.trust(
Asset("BP1369p14", "GC2ZK7OONSYECUWI42A5KXG2M7XIGEC2CIBOD4BJ4EHWYJWV6BHC6NFT")
)
builder.untrust(
Asset("Hub1369p14", "GCTE2BR4WYD73Y3KRC6JOX2LYFH5WKAWO7VYCZXVZ5XLNWMYCIQFDNFT")
)
builder.trust(
Asset("Hub1369p13", "GBGWJMXGISX5YXQMTWOPJT6QZADQLFJPHREXDTM7JJCSOZWC7BVM3NFT")
)

# for token in TOKENS_TO_BURN:
# builder.burn(token, source=TOKEN_HOLDER)
# builder.lock_issuer()
# builder.burn(token)
# builder.untrust(token)

transaction = builder.build_and_sign([OPERATOR_KP]) # ISSUER_KP,
# transaction = builder.build()
transaction = builder.build_and_sign([OPERATOR_KP])
print(transaction.to_xdr())
print(SERVER.submit_transaction(transaction))

Expand Down

0 comments on commit fb9c9fb

Please sign in to comment.