There is only one person with liquidity
There is only one person with liquidity on Spectrum. To have them not lose their ERGs in liquidity they need to withdraw before we send refund ERGs.
Furthermore, anyone with hodlErgs in contracts might be problematic.
I will be heading to sleep, I would appreciate if the community could come to a consensus on what to do and I will just follow that through when I am awake.
I propose that we wait until 100% of the hodlERGs are in p2pk before sending ERGs back OR if a check can be done to ensure hodlErgs tokens are secure in the hodlCoin contract then we put all ERG in a contract that people can redeem on their own using their hodlErgs (if we chose this could we get this contract built asap?)
Please discuss the options, I dread holding the ERGs any longer than needed.
101 Replies
I rewrote the contract in a way that is in imo a lot more professional and easier to read then what a lot of ergo contracts look like in the ecosystem, it is my own personal standard. It should be more easier to spot problems: https://github.com/lucagdangelo/hodlcoin-contracts/blob/contract-rewrite/hodlERG.es
GitHub
hodlcoin-contracts/hodlERG.es at contract-rewrite · lucagdangelo/ho...
Contribute to lucagdangelo/hodlcoin-contracts development by creating an account on GitHub.
I included the fix from pulsarz
There is no miner fee check, though not sure if this is by design or not
Also another problem is since there is no indication of user input/output it is not guaranteed that user will get exactly the hodlerg they pay for. One could manipulate the way the tx is built similar to the issue with the bank reserves.
@qx() @MGpai any thoughts?
@kb the person for LP came forward but too late, their 900+ is gone. they also did some swaps because they thought they were helping someone who made a bad swap...they are taking as much erg back as they can from pool and will sit tight. so as a holder they will have less hodl than they should, we should be able to verify the right amount from the mint.
just wanted to put in chat that current snapshots should not be used for airdrop but only for comparing to the mint adddresses/amounts
if u need help with multiple people deriving a list and amounts let me know, some of us can each run our own methods and compare
We should probably take a snapshot after the block of @kb 's exploit
other exploit found, for burning, the tx does not inforce all user input tokens get burned, so whoever builds tx could send some hodlerg to themselves
I think the best way to distribute is to put 90k erg in @Luca D'Angelo 's revised contract
As for the LP lost perhaps make a raffle
How many addresses lost LP?
@qx()
im working on implementing the errors i found
Do the same checks we do for lilium contracts
Enforce miner fee
Enforce outputs size
Very simple to have a secure contract
didn't look yet
i think it was just the one provider and then he did a swap again after the drain in a misunderstanding
kushti just compensated the LP provider it looks like
to clarify, compensated on the lost erg in the LP, not the hodl coin he originally had, we will need to make sure that he gets the erg from that with everyone else it the contract or drop
if you do a contract you have to whitelist now
oh your token method
but if you're going to airdrop a token to original minters, why not just airdrop the erg and be done with it
well a new contract is needed anyway for the actual protocol, so i will go as far as i can with that and make a pr to the project repo. prob best to just airdrop the erg now anyway as you say
this dapp interacts directly with your wallet so it makes writing strict conditions more difficult since you never know how many input boxes you need and if there will be a change box or not. this is why proxy contracts idea was developed.
Use my loop
hmm i think this protocol should be redesigned to use a proxy contract for the user, there are too many edge cases now
ill write it assuming there is only one user input and one user output then the creator can use it as reference for a proper rewrite with a proxy contract
other error: when devs withdraw fee, no one is paying the miner fee
Do it
I can easily add it to lilium off chain framework
this is not my project tho so idk what they want to do
Let's fork it :dopamineduck:
i did, that is how i am doing updates
but i dont want to steal project, im just helping out
I mean let's run it on our own
Proxy is the most secure
i guess it depends how much responsibility @Pulsarz wants to take and if he wants to redesign this and see it through to develop it properly
This is perfect for decentralized bots
yes i agree we should develop properly and we can run our own bot
True
I don't mind it bc it's not too much work
yes and good for community
lets call the bot phoenix
Also not using proxy doesn't scale at all
I agree
This really turned into a disaster
I original didn't want proxy for lilium
But then I realized after thinking through
If many people mint at once then there isn't a way to get the latest box
But then again this was supposed to be a low interaction contract, it doesnt have to scale that much
Then txns will fail
Yes this happened at start, 2x same box spent
90000 ERG is not low interaction
^
Was talking amount amount of interactions per day. But anyway, damage is done.
Like any professional engineer, when dealing with peoples lives, in this case their money, it is our responsibility to design and build things that are safe. In any other engineering discipline, engineers are held legally liable for mistakes. CS people get off the hook to easy imo
Are you interested in redesign?
The more I am digesting it the less I want to continue with it. As you can probably understand.
We rushed it for summit, thats the tldr.
I am happy to continue the frontend work and any changes needed, but not the SC
Fair enough, though redemption is good for the soul and character.
Well it all depends on what you guys/community want
I really have no say here
I want the idea to continue, its a great one.
I did not expect 90k erg tvl in a day. That was crazy.
Yeah i think it is cool that our community has a "legit" degen protocol
Lets just say I dont feel safe deploying any contract without multiple peoples contributions and reviews.
As you can imagine
Don't be discouraged from SC development
I started on testnet lol
I learned a lot, ergoscript itself is not that hard
Edge logic cases are
Deploying to mainnet at this stage was a mistake
Just be careful of not specifying outputs
Legit thats it lol
Im just happy it was Krass that drained it.
Yes!!!
Even I had a good chunk of my ergs in.
Not that that matters
Anyway, lets just say if tou guys want my involvement in anything I am happy to contribute, but not pull the project. Im sure Bruno is as well, we have been talking in private chat.
This was a hard lesson.
All I can say is sorry.
Also respect for duckpools contracts, I cannot imagine the stress with writing that. Thats scary.
So mgpai and I will work on proxy, bank contract, and bot. Frontend will only need to send exact amounts to proxy.
^
Happy to make any changes needed when Im back from vacation
yes, i read their contract breifly a few weeks ago. frankly it has the same problem as your contract in the sense of the structure it is written and many contracts on ergo are written. these complicated contracts need to be written more professionally instead of just dumping a bunch of conditions on each line
(Oh the joy)
He has the best method of writing contracts
Makes it incredibly easy to debug
Liliim has around 10 contracts
Probably over 1k lines of ergoscript
Couldn't have done it without @Luca D'Angelo
@Luca D'Angelo I saw your comment a out miner fee on withdrawal, but I fail to see the problem. I'd like to understand
Idea was the user executing it paid the fee.
Thus no check needed
bc no check is there, you put all the power in whoever builds the tx. you could take more input from the user, make the miner fee less and send leftover erg somewhere else
Fair, but that is a different category problem. But yes still a problem.
Biggest thing is frontrunning
Tx operator could build to get incentive erg
Then someone could hijack it with a larger fee to get incentive
I am humbled after today
Ehh you find out after playing around with it
But not with 90k ergs
It happend to me with comet lottery
for dev fee withdrawal, nobody pays miner fee too since it is not clear what any inputs should be other than the bank
I was scared when people started putting in 10ks of ergs
Degens
:lmao:
Not doing anything again this size anytime soon. I cant.
And my apologies for the work you guys had to put in to secure user funds.
really, lots of things learned today across devs and degens, people will still be excited for a new release and that more people are involved looking over the SC!
I am fairly sure I recorded the holders on hodlErg with my script last night
Any issue with just using that? If LP has been compensated for ERG side then we can just compensate them on hodlErg side
Can compare to any lists you guys have made
I presume the second exploit was malaicious
Will compare in a bit before bed. Then at least a compare effort was made.
I was thinking about that. Might not have been. If site was up still. Could have just been an opportunist with not much of a conscious.
If they did it headless and built their own tx then yah fo sho.
It went to a new address tho which is usually a dead giveaway they knew what’s up. I think lgd said it was a built tx too. So makes sense to conclude malicious yah.
But to send hodl to people today was weird.
Not sure what was going through his head. Different amounts too.
@kb
i did a compare on your and my data
https://docs.google.com/spreadsheets/d/1fRQXaYWQNno5lExAfjQb9TWYnkXWf5AidHMdtm0gdP4/edit?usp=sharing
Google Docs
hodl-redis
compare
qx today,qx today 7/3/23 10pm UTC,kras last night,kras last night
5vSUZRZbdVbnk4sJWjg2uhL94VZWRg4iatK9VgMChufzUgdihgvhR8yWSUEJKszzV7Vmi6K8hCyKTNhUaiP8p5ko6YEU9yfHpjVuXdQ4i5p4cRCzch6ZiqWrNukYjv7Vs5jvBwqg5hcEJ8u1eerr537YLWUoxxi1M4vQxuaCihzPKMt8NDXP4WcbN6mfNxxLZeGBvsHVvVmina5THaECosCWozKJFB...
my total: 96777
your total: 87309
hope this helps, i didn't get a chance to write the mint scripts yet but i think these two data points give a decent enough picture for you to be able to make an informed decision. IF MGpai gives me his data i can do a three way compare.
Not sure why yours is so much, especially since don't all the differences in mine seem to be more than yours?
There is only 90.3k ERG btw
90k ergs?
Mine with your +2k and and LP manual sending would hit 90k
mgpais script above showed 97k at time of your liquidation
from ergowatch
Well I aint paying the extra 7 lol
There was only 90k in the contract
hahahahaha
those spots must have minted free before site was shut down then
Are there any addresses in your list not in mine?
the ones i have and your data doesn't then
Or was it just differences in balances
Oh the blue ones!
yeah blue ones
sorry ijust colored
Yeah those blue ones make up like 7k
im guessing those were free mints from when u LQ'd and i snapshotted
Free mints?
when u pulled ergs it went down to very cheap to mint hodls
on the site
apparently
until it was shut down
No one interacted with the contract tho
So not sure where they got from
https://explorer.ergoplatform.com/en/addresses/7YErXocwTgQbejCSkKGS3GBorYCcyqcExQS23ErypeC7QtgrkqnJT4TxAaKKRgB1Lg1RjTxCbUhWCmP5qzfHeFSGZHhVBzX49PJNJzWeEb2nkbW9LYjQjvU1SBNwZBajSYZwk2Y2JVUwxm5CXYWoNMjZGPnTXd3oFG5zCBBjEgLYtvNPiJZKuRoWNbkPiiahB4TLeVGZcn4HZhFEaANj9yMvmUeqHhS8PsaHeSNpXEUxDGmeoNYqkNM2sEMyZtLDxBCHKLiA99eYhZoqA7VjxG4UPr7zVTg6dXE9ctfqmvPQyugn37ryRPx7K3WkTRb4D9yNnR4YEAZeUnLZjWX8XfoB2JT5KCUgyqtDtf5wYFNsRuq4RSUxnG9Cj1M3tEcY5f174R6PHCKPUKhDwYMiPHo67erww6ZL25m5cJ5BkMhpoVgnbhjboAr86wN2XWfmMh5mVEBB776pkamhADnu4JyfuY28tbZ89PVj6hJMU8xM9kW5RN3AvuBdLSez347XzynVnraVEBsYFUNgLqfbHXM4VsCqrb6SsquM65H3b2n19tKQ3R87Sho3pUFWFYfGvbdoyu1tjctkFgMLDVKj85KXGU6v3opFajoYSY7EbvX1N4pa2CaPqYKpDUFZaVZ1EiUtjRPV62evMotexxD3fVgoGzYZtxi1APXRK261pBU5qBgU2rkCMtAcCuQXkAQaKCpohaX5tNW2QzQUhcUAfAwvzBdakEAGfiopa
Only the one extra tx which was the malicious one at block: 1039186
shit you're right
lemme look up the contents of those blue ones manually sec
maybe my script effed up
checks out
9g8kB1gxgHvPHyPsbBwvDhrawP5R8XG7Q4fPqy3ap3ykAcXe91y
received 4281.76675 hodl

oh that fucker
that's at 14:00 hours
that means he sent random hodls to a couple people before he did the mass sends
lemme check the other blues on times
row 113 bought it from the spectrum LP
row 112 got it sent to them from row 113's wallet
row 108 got it from spectrum
Yeah you will need to scan before the tokens were taken
< 1039186
all my blues are from after
the others match with you
except for the 2 erg at bottom
My scan is about: 1038950 and I am quite confident with it
looks good to me ser
i think due diligence was done
But from 1038950 to 1039186 maybe people were interacting with spectrum
So I would kind of prefer the more updated one
yup
Hq did it at 1039186 so theirs is likely correct. I think if we just remove the entry they allocated to the dex address it would be correct
But yeah just need a json file to look properly really/ use to actually send on node
ser, u have access to ur tipper bot on here or tele (i noticed it made you a new one on tele)
ser, no ignoring me plz
ok, ill hit you on discord main side then, off to bed, i hope others follow suit
Site was unuseable at that point.
ok cool...from what i saw in what i just looked up it was people using spectrum
Did that guy really send hodlerg to everyone just to fuck with this?
Thats sad
it seems like it
weird numbers too
Will go over new contracts in a bit. Least I can do is learn from this.
Did you consider the dust that will occur at treasury contract?
You mean the fee contract?
Yes
That was the main reason we decided to go with a register, just checking.
We have not written the fee contract yet but the contract could allow box consolidation, like the tx would include multiple input fee boxes
^