Questions tagged [algorithm]
The algorithm tag has no usage guidance.
9
questions
0
votes
0
answers
15
views
Is there a gas effective algorithm to generating a permutation from a seed
I have an array [1,2,3,4,5,6] and I want to permute it randomly. Let's say I have a number bytes32 seed, that is obtained through a verifiably random number mechanism or for my purposes it just needs ...
0
votes
0
answers
68
views
Random DNA mix in Solidity
Hello I have DNA mix function and I am trying to implement random function while mixing DNA
for example dad DNA is 10 10 10 10 10 10 10 10 10 10 and mum DNA is 21 21 21 21 21 21 21 21 21 21 and child ...
1
vote
0
answers
27
views
Unexplained listing alert
Sorry for the newbie question
But there are actually telegram channel which deliver listing alert seconds to minutes before the actual listing on CoinMarketCap and CoinGecko
They claim they dont work ...
1
vote
1
answer
26
views
smart way to keep track of staking info
I have a contract for staking NFTs, called "Stake".
where someone will send a token and claim some rewards over time. I need to keep track of what/who sends.
something like this
struct ...
1
vote
1
answer
23
views
Distribution coefficient
I'm building a dapp and I need some help with creating the formula for a "distribution coefficient/index" (my math is rusted). The idea behind it is:
There's a total balance. Let's call it &...
1
vote
1
answer
18
views
What are the most prominent dispute resolution frameworks deployed on Ethereum
Dispute Resolution may become a very important paradigm for multidimensional consensus systems such as Ethereum in the near future. In this perspective, I am going through the existing dispute ...
0
votes
0
answers
1k
views
x*y = k Constant Product Market Maker
A short recap for Context
In its basic form, a liquidity pool holds 2 tokens and creates a new market for that particular pair of tokens.
When a new pool is created, the FIRST liquidity provider is ...
1
vote
0
answers
19
views
What is the fastest way to implement the find first set algorithm in Solidity?
As per Wikipedia, a find first algorithm is:
a bit operation that, given an unsigned machine word, designates the index or position of the least significant bit set to one in the word counting from ...
0
votes
0
answers
76
views
Pull-based reward distribution (Rewards Compounding) among stakeholders according to their shares in staking
In a naive implementation, the staking contract would
push fractional payments to all the participants each time a
reward gets distributed. However, in such an implementation
the distribute function ...