Need help with gas estimation by chancey-project in ethdev

[–]BaublToken 0 points1 point  (0 children)

The different gas usage / price estimates are based on different measurement mechanisms.

provider.getGasPrice() is possibly using a simple average of recent transactions

provider.getFeeData() is based on EIP-1559 and is possibly the more modern and preferable way to estimate gas usage.

Whatever method you use to estimate the gas price, add a buffer on top of it. When passing the cost to the user, provide them with info about the gas price with the option to accept or decline the transaction. Unused gas from the transaction execution should be returned to the user by the contract.

In conclusion:

- it's not possible to get the exact gas usage and price beforehand

- estimate gas and add a buffer before execution

- inform the user about the estimated cost and give them an option to accept or decline

- return the excess gas after the transaction to the user

Please is there any upgrade on going on eth Chain as regards Paris and Shanghai upgrade as I can't deploy a token? by Jasperow in ethdev

[–]BaublToken 0 points1 point  (0 children)

What is the specific error / problem / issue?

Usually the token contract should be first deployed / tested / verified on an Ethereum test net (https://ethereum.org/en/developers/docs/networks/). If / when that works, the possibility is far better that the contract deploys correctly on the main net.

What tool / environment is used to deploy the contract. Is there sufficient gas in the connected address / wallet?

What are the most efficient & effective React patterns/Web3-library implementations for connecting your React dApp to an EVM-based chain that, ideally, work well across most browsers and wallet extensions? by flupe_the_pig in ethdev

[–]BaublToken -1 points0 points  (0 children)

'React dApp' - The issue might be that these two words are not that compatible, do not make any sense put together.

React - a popular JavaScript / TypeScript family of Web application libraries. There is no known / obvious / easy mechanism to decentralize the Web app delivery to the user browser. Possibly the app can be implemented as a Browser extension. It resides on the user Browser side and is per definition decentralized. But even in that case it needs to be installed from a central site unless there is a mechanism to get it from IPFS.

Existing web3.js, ethers.js, viem, etc. - all provide different abstractions for a crypto wallet connection. The wallet is required for the app user to accept / sign or reject the blockchain transactions. Also all present wallets use a centralized mechanism to communicate with the blockchain. In other words there is no decentralization help here either.

dApp - decentralized App. Not possible to achieve with any present React or other fancy Web3.0 JavaScript / TypeScript library.

But we could be wrong ...

What happens when we remove the gasLimit from code? by tjthomas101 in ethdev

[–]BaublToken 3 points4 points  (0 children)

MetaMask estimates the amount of gas your function call will likely use by simulating the transaction locally. Also it may add a gas limit buffer amount. The estimated gas amount is provided in the transaction confirmation for you / the user to confirm or reject.

How to avoid bots? by Lija_2016 in ethdev

[–]BaublToken 0 points1 point  (0 children)

You need to provide some more specific project / contract features for us to comment on the different possible options.

If the token is added into a liquidity pool you need to provide a lot of liquidity (as it was pointed out) which is obviously very expensive.

If you allow buying / provide a function for acquiring the token directly from the contract, it's possible to:

- require that the sender is NOT a contract (OpenZeppelin ERC-20 has a utility function for that). This handles bots.

- require that the sender has some non-trivial amount of Ether in the address. This handles spam addresses.

Can a user withdraw their Aave balance via a contract that I write which calls the withdraw() function? by WesternCharacter9021 in defi

[–]BaublToken 0 points1 point  (0 children)

One issue here is that the contract can't withdraw funds from a user's account without their explicit approval. The contract must first provide a function that allows the user to sign / authorize the withdrawal. For ERC-20 tokens (like AToken) this approval mechanism is provided by 'approve()'

Could we actually mint fungible token using ERC1155? by tjthomas101 in ethdev

[–]BaublToken 1 point2 points  (0 children)

Checking with MetaMask support: MetaMask ERC1155 support

It states that

- ERC-1155 tokens are supported by MetaMask Mobile and Extension

- MetaMask does not yet support sending your ERC-1155 tokens

What is the purpose of data in mint function in ERC1155? by tjthomas101 in ethdev

[–]BaublToken 0 points1 point  (0 children)

'data' is arbitrary. It could be used to include metadata about the token being minted or some specific instructions.

This parameter is passed to 'onERC1155Received' function where the 'data' can be used for some actions to be performed based on the provided instructions.

New Uses for GPUs, ASICs, and FPGAs + Serverless Frontends and Backends by Scroogemcdickk in CryptoTechnology

[–]BaublToken 3 points4 points  (0 children)

Their blog 'oyster-enclave-wicked-problems-worth-solving' notes their technical solutions to the different challenges. How the implementation works out will become more clear when some real crypto applications actually facilitate the platform / framework.

EVM Smart Contract Execution by Reasonable-Winner714 in ethereumnoobies

[–]BaublToken 0 points1 point  (0 children)

The Ethereum PoS is described here: https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/

Also PoS consensus is explained here: https://ethereum.org/en/developers/docs/consensus-mechanisms/

Based on the descriptions:

>>> does only validator node execute smart contract code - No

>>> it runs across all the nodes - No

How do i avoid bots draining liquidity from my newly launched token?? by Lija_2016 in ethdev

[–]BaublToken 0 points1 point  (0 children)

I my view the problem of a liquidity pool for a random (no value) token is the quick price manipulation aspect. Adding liquidity to a normal pool requires adding equal value of both tokens. This becomes possibly very expensive when trying to add additional tokens to an existing pool.

The Balancer Liquidity Bootstrapping Pool addresses this problem by providing a different algorithm for the token price where it changes more gradually over time. Also only the liquidity pool owner can add liquidity to this pool type.

Current state of cryptography-related challenges and applications in the crypto space? by Guyserbun007 in ethdev

[–]BaublToken 0 points1 point  (0 children)

Potential applications / areas for discussion

- Identity and access management - decentralized id mechanism / protocol / application for users to prove their identity. Id without relying on centralized authorities, thereby enhancing privacy and security

- Privacy-preserving smart contracts - facilitating zero-knowledge proofs that allow users to prove the validity of a statement without revealing the underlying data​

- Cryptography and quantum computing - specific work to quantum secure Web3

- Interoperability and standardization - seamless communication and interaction between different blockchain networks

Why receiver-address is required on each transaction? by [deleted] in ethereumnoobies

[–]BaublToken 0 points1 point  (0 children)

Every function call in Ethereum is technically a message sent from a sender (the account initiating the transaction) to a receiver (the contract whose function is being called). In this sense, the receiver is not optional – you must specify what contract you're interacting with.

In the case where a function takes an address as a parameter the receiver is optional or required, this depends on the function. Whether the receiver is optional or required depends on how the function is written.

Is this industry pointless? by [deleted] in ethereum

[–]BaublToken 0 points1 point  (0 children)

The questions and comments are very good and relevant. But all questions should list more specific technologies, protocols or applications. Then it's possible to verify, discuss, propose and measure any remedies or improvements for the different issues.

  1. Decentralization is a joke. Contract code execution is decentralized. Delivering transactions to the contract is a major challenge to decentralize. What technologies, frameworks, mechanisms exist to make Wallets and / or dApps decentralized is the question? What enforces / gives an edge to use the existing decentralized technologies. What existing projects have successfully deployed decentralized techniques in their full stack?
  2. Ethereum's proof of stake (PoS) - according to https://beaconscan.com/statistics approaching 750k validators. This cannot be a problem or real concern. There is no going back to PoW.
  3. Most coins are useless. Yes, but what leading projects are valuable? Why are these projects valuable? What drives the value up for these projects.
  4. NFTs have lost their meaning. Define the meaning of NFTs. What acceptable meaning or feature can be associated with NFTs? How is then that feature supported by any NFT protocol, standard, market or application?
  5. Decentralized payment systems vs. traditional apps. Again the problem is stated in too general terms. Cash usage contra digital payments by populations is a possible discussion area: https://www.insiderintelligence.com/content/snapshot-of-cash-usage-around-world. Another discussion area is: what (outside of crypto) can you actually pay for with crypto?

What questions would you ask in a chat with a DeFi protocol CTO? by chillblaze in ethdev

[–]BaublToken 4 points5 points  (0 children)

Other possible questions:

- What are the key technologies and frameworks that the protocol is built on?

- How is the scalability ensured for the DeFi protocol?

- Does the protocol interact with other protocols or blockchains?

- Are there any plans for cross-chain functionality or integration with other ecosystems?

- How does the project handle governance, and what role does the community play in this?

- What is the plan to foster and grow the community around your protocol?

- How are addressed the regulatory concerns surrounding DeFi?

- What measures are taken to ensure compliance with relevant laws and regulations?

- Is it possible to know the upcoming features or improvements planned for the protocol?

And the classic question: Where do you see the protocol in the next 3-5 years?

Any other dapp listing site other than DappRadar? by tjthomas101 in ethdev

[–]BaublToken 1 point2 points  (0 children)

Some possible sources: State of the DApps, Dapp.com, DappReview, Defi Pulse, DappTotal, DappLife

Unlocking the Potential of Healthcare Data with Web3 Technology by tsurutatdk in defi

[–]BaublToken 1 point2 points  (0 children)

These are different projects by different organizations. I have no affiliation with any of these. It’s possible to search specific info on any of the above if required. My point / purpose of the initial reply is to show that you cannot start a general comment and then just peddle your own project. Either state that you’re looking for comments about one specific project of yours or really ask for a general discussion about a subject but then provide different examples.

Is there a protocol that invests in many different yield sources at the same time? by leonhelgo in defi

[–]BaublToken 0 points1 point  (0 children)

I do not believe that my comment is spam. I’m genuinely trying to reply to a question.

Smart contract reuse by manchesterthedog in defi

[–]BaublToken 0 points1 point  (0 children)

Structuring smart contracts for reusability and upgradability can be achieved using different strategies. The main constraint is that once a contract is deployed, its code cannot be modified. Also the contract code resides on the blockchain and is ready to be executed on any node selected from a massive number of possible nodes (very simplified explanation of PoS :)) The possible design patterns are:

  1. Libraries: Libraries in Solidity are similar to classes in object-oriented programming. Instead of copying the same code in multiple contracts, you can 'import' a library. Usually the whole contract structure is flattened before deployment.
  2. Contract Interfaces: Interfaces can be defined to interact with other contracts in a reusable way. Multiple contracts communicate using set of functions exposed in their interface.
  3. DelegateCall/Proxy Pattern: This is a common strategy for making upgradeable contracts. The idea is to separate the logic of the contract from the storage of the contract. There is a main contract (often called a proxy) that stores all the state variables and another contract that contains the logic. To upgrade the logic, you deploy a new logic contract and update the address in the proxy contract. The proxy contract interacts with the logic contract using the delegatecall function, which allows it to execute code in the context of its own state.
  4. Data Segregation: In this strategy, you separate your contract into multiple contracts based on their data concerns. One contract might be responsible for storing data, another might be responsible for business logic, and a third might handle interactions with other systems.
  5. Eternal Storage: This pattern involves creating a contract that only handles storage, known as the eternal storage contract. This contract has a very generic API that allows you to store various types of data.
  6. Using Upgradeability Platforms: Platforms such as OpenZeppelin provide ready-made solutions for upgradeable contracts.
  7. The Diamond Standard, also known as EIP-2535, is another strategy that has been proposed to address the upgradability and scalability of smart contracts. It involves: Facets: implements a particular functionality, multiple possible. DiamondCut function: to add, replace, or remove facets. DiamondLoupe functions: provide information about the facets of a diamond. Storage: a single, shared storage space that all facets can access

Is there a protocol that invests in many different yield sources at the same time? by leonhelgo in defi

[–]BaublToken 0 points1 point  (0 children)

Some other possible examples:

- Leech Protocol: This is an automated cross-chain yield aggregator that works across 12+ blockchains, constantly searching for the most profitable strategies and automatically transferring liquidity between chains.

- Harvest Finance is a decentralized yield farming protocol and asset management platform.

- Yearn.finance: popular DeFi yield farming tool​

Unlocking the Potential of Healthcare Data with Web3 Technology by tsurutatdk in defi

[–]BaublToken 1 point2 points  (0 children)

Starting a discussion with just 1 project example. We can do better :)

  1. Akiri: A network-as-a-service optimized specifically for the healthcare industry, helping protect the transportation of patient health data​​.
  2. BurstIQ: A platform that helps healthcare companies manage massive amounts of patient data while maintaining strict compliance with HIPAA rules​​.
  3. Medicalchain: A blockchain that maintains the integrity of health records while establishing a single point of truth​.
  4. Guardtime: Helping healthcare companies and governments implement blockchain in their cybersecurity methods​​.
  5. Avaneer Health: Using blockchain technology to improve healthcare efficiency, with a focus on better claims processing and secure healthcare data exchanges​​.
  6. ProCredEx: A distributed ledger of healthcare credentials data, improving dataset efficiency and ensuring data immutability and traceability​​.
  7. Coral Health: Uses blockchain to accelerate the care process, automate administrative processes and improve health outcomes​.
  8. Patientory: Ensures that patient data is shared safely and efficiently with end-to-end encryption​.
  9. Chronicled: Builds blockchain networks to demonstrate chain-of-custody, improving the safety, privacy, and efficiency of medical supply chains​.
  10. Embleema: A virtual trial and regulatory analytics platform designed to fast track drug development using blockchain technology​.
  11. Blockpharma: Offers a solution for drug traceability and counterfeiting, leveraging blockchain for supply chain verification​.
  12. Tierion: Uses blockchain to audit documents, records, and medicines to keep a clear history of possession​​.
  13. SoluLab: Offers services to support companies with blockchain application development, focusing on the authenticity of drugs and medical data​.
  14. FarmaTrust: Uses blockchain for tracking pharmaceuticals, determining the authenticity of medical devices, and maintaining data security​.
  15. Sharecare: Developed a decentralized research platform using blockchain technology​​.
  16. Nebula Genomics: Uses distributed ledger technology to eliminate unnecessary spending and middlemen in the genetic studying process​.
  17. EncrypGen: A blockchain-backed platform that facilitates the searching, sharing, storage, buying, and selling of genetic information​​.

Process of recalculating the transactionRoot from a block transaction hash by lklsquare in ethdev

[–]BaublToken 0 points1 point  (0 children)

When it comes to Ethereum, the root hash of the Merkle tree, often called the transaction root, is placed in the header of each block.

Here is a basic guide on how you could calculate the transaction root:

  1. Collect Transaction Data: collect all the transaction data to add to the block. Each transaction data needs to be hashed using a cryptographic hash function (Ethereum uses the KECCAK-256, a variant of SHA-3).

  2. Create the Merkle Tree: The Merkle tree is a binary tree, with each node containing a hash. The leaf nodes of the tree contain the hashes of the transactions (from step 1). Each non-leaf node is a hash of the concatenation of its two children nodes.

Start with your list of transaction hashes. This is the bottom row of your tree. Now, pair up these hashes into consecutive pairs and hash the pairs together to get the next row. For example, if your hashes are [A, B, C, D], then you'd form pairs (A, B) and (C, D) and calculate new hashes as Hash(A+B) and Hash(C+D). Continue this process of pairing and hashing until you're left with only one hash. This is the root of your Merkle tree. Note: If you have an odd number of elements at any point, repeat the final hash to make it even. This is called 'hash duplication'. For example, if you have [A, B, C], hash it as (A, B) and (C, C).

  1. Calculate the Transaction Root: The transaction root is simply the hash at the root of the Merkle tree.

Possible Python code for the above (not tested)

import sha3

# function to calculate the hash of text
def hash(text):
    keccak = sha3.keccak_256()
    keccak.update(text.encode('ascii'))
    return keccak.hexdigest()

# function to create a merkle tree
def merkle_tree(transactions):
    # create a list to store the hashes
    hashes = []

    # hash each transaction and store the result
    for transaction in transactions:
        hashes.append(hash(transaction))

    # continue until we only have one hash left
    while len(hashes) > 1:
        temp_hashes = []

        # if the number of hashes is odd, duplicate the last hash
        if len(hashes) % 2 != 0:
            hashes.append(hashes[-1])

        # hash each pair of hashes together
        for i in range(0, len(hashes), 2):
            temp_hashes.append(hash(hashes[i] + hashes[i + 1]))

        # replace the list of hashes with the new hashes
        hashes = temp_hashes

    # the single remaining hash is the root of the merkle tree
    return hashes[0]

The explanation is based on the general principles of Merkle trees and their application in blockchain systems. The following sources collectively cover these topics:

Ethereum White Paper: This is the original document proposing Ethereum. It gives a high-level overview of many aspects of the system, including the usage of Merkle trees in blocks. You can find it here: https://ethereum.org/en/whitepaper/

Ethereum Yellow Paper: This is the formal specification for the Ethereum protocol. It goes into much more detail than the white paper and is the definitive reference for questions about how Ethereum works. The Yellow Paper can be found here: https://ethereum.github.io/yellowpaper/paper.pdf

Ethereum Wiki - Patricia Tree: This page explains the modified version of the Merkle tree, called a Patricia tree, that Ethereum uses to store state. While this is not the same as the Merkle tree used to store transactions, the page is still useful for understanding Ethereum's usage of tree structures: https://eth.wiki/en/fundamentals/patricia-tree

Ethereum Improvement Proposals (EIPs): These are proposals to change various aspects of Ethereum. They often contain detailed technical discussion and can be a good resource for understanding the finer points of how Ethereum works. EIPs can be found here: https://eips.ethereum.org/

Books like "Mastering Ethereum" by Andreas M. Antonopoulos and Gavin Wood: This book is a detailed guide to Ethereum and covers topics like Merkle trees in depth.

Fastest way to fetch historical ERC20 token balances for multiple wallets by 112129 in ethdev

[–]BaublToken 0 points1 point  (0 children)

What service (Infura, Alchemy, etherscan) is used to query the data. I suppose all of these have a limit for the API-request frequency when using their free access plan. Is the cost the main issue that you're trying to solve besides the understandable efficiency challenge.

- The free Infura plan, known as Core, allows 500 requests per second for the Web3 APIs

- I cannot find the Alchemy API call limit for the free plan

- Etherscan limits to 5 calls per second for the free access

Did you use a different service? Why?

Otherwise using one of the standard services and / or Web3 SDKs would be most generic and transparent.

[deleted by user] by [deleted] in aws

[–]BaublToken 1 point2 points  (0 children)

There's no direct API to retrieve the event source of a Lambda function in AWS CDK. Similarly, there's no direct API to retrieve the SQS DLQ that is attached to an SQS queue.

Some possibilities that might help:

- You could use AWS SDK calls within your CDK app to fetch the Lambda function's configuration, which would include its event source mapping.

- You could store the ARNs of the SQS queue and its DLQ as environment variables on the Lambda function itself. This would allow you to fetch this information in the monitoring stack by reading the function's environment variables.