CryptoFly.us | CRYPTOCURRENCY BITCOIN SHIRTS CLOTHING APPAREL HATS

CRYPTO NEWS

Binance launches $1B BSC fund, BTC futures ETF approval could arrive soon, and Celsius raises $400M: Hodler’s Digest, Oct. 10-16

How to split a string in solidity?

I’m using the OpenZeppelin Preset of the 1155 Token Standard. (https://github.com/OpenZeppelin/openzeppelin-contracts/tree/master/contracts/token/ERC1155/presets) I’m able to mint tokens with that and I’m able to transfer 4 arguments with the transaction: address (of the receiver) id (of the Token) amount (amount of Tokens) data (additional data in bytes format) I use the id and data for transmitting data::Listen

I’m using the OpenZeppelin Preset of the 1155 Token Standard. (https://github.com/OpenZeppelin/openzeppelin-contracts/tree/master/contracts/token/ERC1155/presets) I’m able to mint tokens with that and I’m able to transfer 4 arguments with the transaction:

address (of the receiver) id (of the Token) amount (amount of Tokens) data (additional data in bytes format)

I use the id and data for transmitting data Now I’m confronted with the issue, that I want to transfer two variables (in string format) in the data field. First of all I have to convert the field data from bytes into string. Then I want to split the content of the data field into two variables. The one variable got 13 characters, the other one 15. Then I pobably have to assign each split to these two variables. With emit Event I transfer both variables on the blockchain and can access it in the Logs.

Please pardon, I’m a bloody noob in coding with solidity. Does someone knows how i can formulate a function that converts bytes to string, split the string into two parts and then assign it to new variables?

Binance launches $1B BSC fund, BTC futures ETF approval could arrive soon, and Celsius raises $400M: Hodler’s Digest, Oct. 10-16

Shopping cart
There are no products in the cart!
Continue shopping
0