Skip to main content
Add formatting for future viewers
Source Link
Shane Fontaine
  • 18.3k
  • 20
  • 56
  • 83

I want to use the ERC223 approveAndCall()approveAndCall() || ERC677 transferAndCall()transferAndCall() functionality in a contract.

I can take the _extraData string

x="0xe359292df082828f595466de72062f2a1182b077",["0x3d4c4ecB5CAe14f20b916C2936a9d9A16acF14c9","0xBe227eE70d1AD43C4d1C9e173eD0f96AFDdB8a34"],["10","11"]

x="0xe359292df082828f595466de72062f2a1182b077",["0x3d4c4ecB5CAe14f20b916C2936a9d9A16acF14c9","0xBe227eE70d1AD43C4d1C9e173eD0f96AFDdB8a34"],["10","11"]

And convert it into a byte[]byte[] using y=byte(x)y=byte(x)

0x3078653335393239326466303832383238663539353436366465373230363266326131313832623037370x307865333539323932646630383238323866353935343636646537323036326632613131383262303737

but in the returning tokenFallback()tokenFallback() function I can't work out how to convert this back into an address and two arrays of address[]address[], uint[]uint[].

Edit: Maybe I shouldn't be starting from a string. Is there a way to stick addresses, ints, uints, byte32 etc. together into a byte format, and extract (assuming you know how they were put together).

I want to use the ERC223 approveAndCall() || ERC677 transferAndCall() functionality in a contract.

I can take the _extraData string

x="0xe359292df082828f595466de72062f2a1182b077",["0x3d4c4ecB5CAe14f20b916C2936a9d9A16acF14c9","0xBe227eE70d1AD43C4d1C9e173eD0f96AFDdB8a34"],["10","11"]

And convert it into a byte[] using y=byte(x)

0x307865333539323932646630383238323866353935343636646537323036326632613131383262303737

but in the returning tokenFallback() function I can't work out how to convert this back into an address and two arrays of address[], uint[].

Edit: Maybe I shouldn't be starting from a string. Is there a way to stick addresses, ints, uints, byte32 etc. together into a byte format, and extract (assuming you know how they were put together).

I want to use the ERC223 approveAndCall() || ERC677 transferAndCall() functionality in a contract.

I can take the _extraData string

x="0xe359292df082828f595466de72062f2a1182b077",["0x3d4c4ecB5CAe14f20b916C2936a9d9A16acF14c9","0xBe227eE70d1AD43C4d1C9e173eD0f96AFDdB8a34"],["10","11"]

And convert it into a byte[] using y=byte(x)

0x307865333539323932646630383238323866353935343636646537323036326632613131383262303737

but in the returning tokenFallback() function I can't work out how to convert this back into an address and two arrays of address[], uint[].

Edit: Maybe I shouldn't be starting from a string. Is there a way to stick addresses, ints, uints, byte32 etc. together into a byte format, and extract (assuming you know how they were put together).

added 209 characters in body
Source Link
user1938620
  • 681
  • 1
  • 6
  • 12

I want to use the ERC223 approveAndCall() || ERC677 transferAndCall() functionality in a contract.

I can take the _extraData string

x="0xe359292df082828f595466de72062f2a1182b077",["0x3d4c4ecB5CAe14f20b916C2936a9d9A16acF14c9","0xBe227eE70d1AD43C4d1C9e173eD0f96AFDdB8a34"],["10","11"]

And convert it into a byte[] using y=byte(x)

0x307865333539323932646630383238323866353935343636646537323036326632613131383262303737

but in the returning tokenFallback() function I can't work out how to convert this back into an address and two arrays of address[], uint[].

Edit: Maybe I shouldn't be starting from a string. Is there a way to stick addresses, ints, uints, byte32 etc. together into a byte format, and extract (assuming you know how they were put together).

I want to use the ERC223 approveAndCall() || ERC677 transferAndCall() functionality in a contract.

I can take the _extraData string

x="0xe359292df082828f595466de72062f2a1182b077",["0x3d4c4ecB5CAe14f20b916C2936a9d9A16acF14c9","0xBe227eE70d1AD43C4d1C9e173eD0f96AFDdB8a34"],["10","11"]

And convert it into a byte[] using y=byte(x)

0x307865333539323932646630383238323866353935343636646537323036326632613131383262303737

but in the returning tokenFallback() function I can't work out how to convert this back into an address and two arrays of address[], uint[].

I want to use the ERC223 approveAndCall() || ERC677 transferAndCall() functionality in a contract.

I can take the _extraData string

x="0xe359292df082828f595466de72062f2a1182b077",["0x3d4c4ecB5CAe14f20b916C2936a9d9A16acF14c9","0xBe227eE70d1AD43C4d1C9e173eD0f96AFDdB8a34"],["10","11"]

And convert it into a byte[] using y=byte(x)

0x307865333539323932646630383238323866353935343636646537323036326632613131383262303737

but in the returning tokenFallback() function I can't work out how to convert this back into an address and two arrays of address[], uint[].

Edit: Maybe I shouldn't be starting from a string. Is there a way to stick addresses, ints, uints, byte32 etc. together into a byte format, and extract (assuming you know how they were put together).

Source Link
user1938620
  • 681
  • 1
  • 6
  • 12

How to implement function() tokenFallback and decode the parameter bytes _extraData

I want to use the ERC223 approveAndCall() || ERC677 transferAndCall() functionality in a contract.

I can take the _extraData string

x="0xe359292df082828f595466de72062f2a1182b077",["0x3d4c4ecB5CAe14f20b916C2936a9d9A16acF14c9","0xBe227eE70d1AD43C4d1C9e173eD0f96AFDdB8a34"],["10","11"]

And convert it into a byte[] using y=byte(x)

0x307865333539323932646630383238323866353935343636646537323036326632613131383262303737

but in the returning tokenFallback() function I can't work out how to convert this back into an address and two arrays of address[], uint[].