Steempegged Smart Contract

in #steem-engine6 years ago (edited)

{
"id": "ssc-mainnet1",
"json": {
"contractName": "contract",
"contractAction": "update",
"contractPayload": {
"name": "steempegged",
"params": "",
"code": "LyogZXNsaW50LWRpc2FibGUgbm8tYXdhaXQtaW4tbG9vcCAqLwovKiBnbG9iYWwgYWN0aW9ucywgYXBpICovCgphY3Rpb25zLmNyZWF0ZVNTQyA9IGFzeW5jICgpID0+IHsKICBjb25zdCB0YWJsZUV4aXN0cyA9IGF3YWl0IGFwaS5kYi50YWJsZUV4aXN0cygnd2l0aGRyYXdhbHMnKTsKCiAgaWYgKHRhYmxlRXhpc3RzID09PSBmYWxzZSkgewogICAgYXdhaXQgYXBpLmRiLmNyZWF0ZVRhYmxlKCd3aXRoZHJhd2FscycpOwogIH0KfTsKCmFjdGlvbnMuYnV5ID0gYXN5bmMgKHBheWxvYWQpID0+IHsKICBjb25zdCB7IHJlY2lwaWVudCwgYW1vdW50U1RFRU1TQkQsIGlzU2lnbmVkV2l0aEFjdGl2ZUtleSB9ID0gcGF5bG9hZDsKCiAgaWYgKHJlY2lwaWVudCAhPT0gYXBpLm93bmVyKSByZXR1cm47CgogIGlmIChyZWNpcGllbnQgJiYgYW1vdW50U1RFRU1TQkQgJiYgaXNTaWduZWRXaXRoQWN0aXZlS2V5KSB7CiAgICBjb25zdCByZXMgPSBhbW91bnRTVEVFTVNCRC5zcGxpdCgnICcpOwoKICAgIGNvbnN0IHVuaXQgPSByZXNbMV07CgogICAgLy8gU1RFRU0KICAgIGlmIChhcGkuYXNzZXJ0KHVuaXQgPT09ICdTVEVFTScsICdvbmx5IFNURUVNIGNhbiBiZSB1c2VkJykpIHsKICAgICAgbGV0IHF1YW50aXR5VG9TZW5kID0gcmVzWzBdOwoKICAgICAgLy8gY2FsY3VsYXRlIHRoZSAxJSBmZWUgKHdpdGggYSBtaW4gb2YgMC4wMDEgU1RFRU0pCiAgICAgIGxldCBmZWUgPSBhcGkuQmlnTnVtYmVyKHF1YW50aXR5V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lKCd3aXRoZHJhd2FscycsIHsgaWQ6IGZpbmFsSWQgfSk7CgogICAgaWYgKHdpdGhkcmF3YWwpIHsKICAgICAgYXdhaXQgYXBpLmRiLnJlbW92ZSgnd2l0aGRyYXdhbHMnLCB3aXRoZHJhd2FsKTsKICAgIH0KICB9Cn07Cgpjb25zdCBpbml0aWF0ZVdpdGhkcmF3YWwgPSBhc3luYyAoaWQsIHJlY2lwaWVudCwgcXVhbnRpdHksIG1lbW8pID0+IHsKICBjb25zdCB3aXRoZHJhd2FsID0ge307CgogIHdpdGhkcmF3YWwuaWQgPSBpZDsKICB3aXRoZHJhd2FsLnR5cGUgPSAnU1RFRU0nOwogIHdpdGhkcmF3YWwucmVjaXBpZW50ID0gcmVjaXBpZW50OwogIHdpdGhkcmF3YWwubWVtbyA9IG1lbW87CiAgd2l0aGRyYXdhbC5xdWFudGl0eSA9IHF1YW50aXR5OwoKICBhd2FpdCBhcGkuZGIuaW5zZXJ0KCd3aXRoZHJhd2FscycsIHdpdGhkcmF3YWwpOwp9Owo="
}
}
}

Sort:  

thanks a lot, the steem are there now. best regards!

I send you 247 Steem (as you can see in your wallet), but i did not get this steem on the steem-engine.
Could you please check? So far i did not have this problems with your service.
best regards.

Dear @balte

I would like to thank you for filling our dlease request (project.hope) with another 5000 Steem power.

I was wondering if there is any way I could contact you directly? Perhaps I could rent from you larger amount of SP (once you other leases will finish)?

Do you use discord or telegram by any chance?

Yours,
Piotr

Dear crypto-piotr,
the best place for me is always dlease, there is a good market for leasing SP. Right now my hole SP is almost leased there, but i will have a look there form time to time. Best regards and much success with your projects.

please do you use regular social media apps i'll like to have a talk with you

Absolutely. Thanks for replying @balte

what can I do with the smat contract? What is its use?

Good Morning! I mistakenly sent 0.559 steem from my account @ pablo1601 to your steemit wallet when I really wanted to send it to my account on steem-engine.

Can you credit the funds in my account @pablo1601? @steem-peg

What's this?

Steem Smart Contracts is a sidechain powered by Steem, it allows you to perform actions on a decentralized database via the power of Smart Contracts.

I mistakenly sent 5 Steem to your account directly from my wallet instead of using 'Deposit' onSteem engine. Can I get a refund please? @steem-peg

I just mistakenly sent 5 Steem directly from my wallet to your account on the Steemitwallet site instead of using the 'Deposit' option on Steem-engine. Can you refund it please? @steem-peg

Hello, How can I create an intelligent contract with steem-peg ???

This is actually pretty easy, you basically need a Steem account and that's it. To interact with the Smart Contracts you simply post a message on the Steem blockchain (formatted in a specific way), the message will then be catched by the sidechain and processed.

What is this? I do not understand what it is about? Could someone explain to me?

I did't receive 15 steem (without fee) withdrawing from steem-engine a few minutes ago. Please check this and let me know.

Did you ever get your steem from steem-peg? It's been several hours and I haven't received the steem that I tried to withdraw

At that time, after some times, I had received my steem from steem-peg. There are some delay.

Coin Marketplace

STEEM 0.23
TRX 0.24
JST 0.038
BTC 95361.20
ETH 3282.78
USDT 1.00
SBD 3.29