龙头公链SOL:凭实力在币圈脱颖而出,它是不是你心中的白月光呢?

在币圈,永远不缺机会,缺的是发掘项目并静下心来了解机会的意愿,判断机会的眼光,尝试机会的勇气,坚持机会的恒心,以及相信自己的信念。只不过当机会来临时,往往都失之交臂,事后又追悔莫及。

 

今天就来聊聊Solana

早在2019年,Solana完成A轮融资,融资金额达到了2000万刀,由区块链投资机构Multicoin Capital领投,参投方包括Distributed Global、BlockTower、Foundation Capital、Blockchange VC、Slow Ventures、NGC、Passport Capital和Rockaway Blockchain。

​2000万刀以当时熊市的市场环境来看,足以见得投资机构们对于Solana的重视。

​Solana是一个高TPS,高扩展性的公链。

Solana的目标是在没有数据分区的情况下,在1GB网络上实现高达每秒710,000的交易量。最近它已经在单节点测试网络上已实现了每秒250,000次的交易量,最高峰值更达到每秒400,000次。可以这样说它是目前性能最快的公链了。

根据Staking Rewards显示,Solana目前是全网锁仓价值最高的币种,锁仓价值近322亿刀。

虽从曾经最高位的259刀,

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
你可以使用 Python 的 web3.py 库来连接以太坊网络并进行交易。以下是一个基本的示例代码,用于在以太坊上使用 578 个 USDC 换取 SOL: ```python from web3 import Web3 from web3.middleware import geth_poa_middleware import json # Connect to the Ethereum network w3 = Web3(Web3.HTTPProvider('https://mainnet.infura.io/v3/<your-infura-project-id>')) w3.middleware_onion.inject(geth_poa_middleware, layer=0) # Load the contract ABI and address with open('usdc_abi.json', 'r') as f: usdc_abi = json.load(f) usdc_address = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' with open('sol_abi.json', 'r') as f: sol_abi = json.load(f) sol_address = '0x...' # Set up the account that will be sending the transaction account_address = '0x...' account_private_key = '0x...' # Get the USDC and SOL contracts usdc_contract = w3.eth.contract(address=usdc_address, abi=usdc_abi) sol_contract = w3.eth.contract(address=sol_address, abi=sol_abi) # Get the current exchange rate of USDC to SOL usdc_to_sol_rate = sol_contract.functions.usdcToSolRate().call() # Calculate the amount of SOL to receive sol_amount = 578 * 10**18 / usdc_to_sol_rate # Approve the USDC contract to spend the desired amount of USDC usdc_approval_tx = usdc_contract.functions.approve(sol_address, 578 * 10**6).buildTransaction({ 'from': account_address, 'gas': 100000, 'gasPrice': w3.toWei('5', 'gwei'), 'nonce': w3.eth.getTransactionCount(account_address), }) usdc_approval_signed_tx = w3.eth.account.sign_transaction(usdc_approval_tx, private_key=account_private_key) usdc_approval_tx_hash = w3.eth.sendRawTransaction(usdc_approval_signed_tx.rawTransaction) print('USDC approval transaction sent:', usdc_approval_tx_hash.hex()) # Exchange USDC for SOL sol_exchange_tx = sol_contract.functions.exchangeUSDCForSol(578 * 10**6).buildTransaction({ 'from': account_address, 'gas': 100000, 'gasPrice': w3.toWei('5', 'gwei'), 'nonce': w3.eth.getTransactionCount(account_address), }) sol_exchange_signed_tx = w3.eth.account.sign_transaction(sol_exchange_tx, private_key=account_private_key) sol_exchange_tx_hash = w3.eth.sendRawTransaction(sol_exchange_signed_tx.rawTransaction) print('SOL exchange transaction sent:', sol_exchange_tx_hash.hex()) ``` 上述代码中需要注意以下几点: 1. 你需要在 Infura 注册一个项目并使用其提供的 API 端点来连接以太坊网络。 2. 你需要加载 USDC 和 SOL 合约的 ABI 和地址。你可以在 Etherscan 等网站上找到这些信息。 3. 你需要设置发送交易的账户地址和私钥。 4. 在交易 USDC 以换取 SOL 之前,你需要先批准 SOL 合约可以代表你操作 USDC 合约。这可以通过调用 USDC 合约的 `approve` 函数来完成。 5. 你需要根据当前 USDC 和 SOL 的汇率计算出要接收的 SOL 数量。在示例代码中,我们假设当前汇率为 `usdcToSolRate`,并将 578 个 USDC 转换为 `sol_amount` 个 SOL。 6. 一旦 USDC 被批准,你可以调用 SOL 合约的 `exchangeUSDCForSol` 函数来完成交易。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值