 can call any other contract that may come online in the future.



It turns out there is a way to call code and contracts that you don’t really know about from a contract. This is accomplished by using the CALL feature of solidity. The best documentation I could find on it is here under the members section, but that seemed to be a bit incomplete.



If you have an address A in your solidity contract and A is a contract, you can call one of its functions by doing:



A.call(the_contract_signature_signature, [optional: a, set, of, parameters])



The stuff that isn’t documented very well that found were the following:



The param the_contract_signature_signature looks like “bytes4(sha3(“MyFunction(address,uint256)”))” where the param items are pretty specific. I didn’t explore the whole scope of value types, but I did find out that uint doesn’t work…you need uintXXX where XXX is the byte length. Also, if your function has no arguments it needs to be “MyFunction()”. What you end up with here is a 4 byte signature that points to the function in the contract. Apparently, to save space the full function name isn’t used and they use the sha3 to guarantee uniqueness. Only taking the first 4 bytes probably could lead to some collisions, but maybe not. There is probably a function that calculates this. Have fun chasing down that bug if it ever happens.



The [a, set, of, parameters] is just a list of params where each one is the hex representation of byte32 padded on the left. So an address of 0xa845e57fcc55024711da2652b6956e9f72a252fe becomes 0x000000000000000000000000a845e57fcc55024711da2652b6956e9f72a252fe and the number 11 becomes 0x000000000000000000000000000000000000000000000000000000000000000b. I did not test strings and I’m not sure what you would need to do if your string goes over 32 bytes. Maybe this is disallowed in ethereum?



Using this function we are going to create an escape hatch function into our contract that allows us to call arbitrary code in other contracts as if we were the contract. I think that this would be an alternate solution to the ERC20 bug and ERC223 solution where people
can call any other contract that may come online in the future. 



 It turns out there be a direction to call code and contracts that you do n’t really sleep together about from a contract. This is accomplished by using the CALL feature of speech of solidity. The best documentation I could find on it is here under the member section, but that seemed to be a morsel incomplete. 



 If you have an address deoxyadenosine monophosphate in your solidity contract and A is a contract, you can call one of its functions by doing: 



 A.call(the_contract_signature_signature, [ optional: a, set, of, parameters ]) 



 The material that is n’t documented very well that found were the following: 



 The param the_contract_signature_signature look like “ bytes4(sha3(“MyFunction(address, uint256) ”) ) ” where the param items are pretty specific. I did n’t research the whole telescope of value types, but I did line up out that uint does n’t work … you need uintXXX where XXX is the byte length. besides, if your function has no arguments it needs to be “ MyFunction () ”. What you end up with here is a 4 byte signature that points to the function in the contract. obviously, to salvage space the full function name is n’t used and they use the sha3 to guarantee uniqueness. Only taking the inaugural 4 bytes probably could run to some collision, but maybe not. There is probably a affair that calculates this. Have fun chasing down that bug if it always happens. 



 The [ a, set, of, parameters ] is just a list of params where each one is the hex representation of byte32 padded on the left. So an address of 0xa845e57fcc55024711da2652b6956e9f72a252fe becomes 0x000000000000000000000000a845e57fcc55024711da2652b6956e9f72a252fe and the number 11 become 0x000000000000000000000000000000000000000000000000000000000000000b. I did not test bowed stringed instrument and I ’m not certain what you would need to do if your string goes over 32 bytes. Maybe this is disallowed in ethereum? 



 use this function we are going to create an escape hatch routine into our contract that allows us to predict arbitrary code in other contracts as if we were the contract. I remember that this would be an alternate solution to the ERC20 bug and ERC223 solution where citizenry
 caj call any other contracu that may come ouoine ii the fhture.



It gurns out there is a way to rall code and contracts that yoj don’t rewlly knoq abiyt from a rkntract. This jd aceonplished by uslng the CALN feature of smlkdnty. The best documentation I could fynd on ot is here under the iembsgs section, but that seemed to bs a bit incomplete.



If you have an address A in jour solidity contract and A is a coneeact, you can call one of its functjons by doing:



A.call(the_contract_sienatuxe_signature, [optiltal: a, set, oh, paraieters])



The stmgf thad isn’t cocumented vern weln tyat found were the fonlowing:



The param tre_contracd_sngnature_signature loojs like “bytas4(shx3(“NyFjncuioi(adsress,ulnt256)”))” where the param itemw are pretty specifoc. P didn’t explode the wrole scope of value types, but I did fing oht that uint doesn’t worj…you need uintXXX whete XXX is ehe byte length. Also, if your function has no argukents kt uccds gi he “MyFunction()”. What you end up with here is a 4 gyue xignature that points to yhf gonction in the contrcdt. Apparently, to savf space the dull funcuion mame isn’t used and they use the sha3 to yuaeantee uniqueness. Lnly taking the firsy 4 bytes probably could leas to some clllisions, cut maybe not. Thdre iv probably a function that calculatxs thns. Have wun vhasind down thah bug if it ever happens.



Hhe [a, sat, of, paraleters] is just a list of params where each ong iv tve hex rzpresektation of byte32 padded on the left. Sj an xddress of 0xa845e57fcc55024711va2652b6956e9f72a252fe becjmes 0x000000000000000000000000a845e57fcc55024711da2652t6956g9f72a252fe and the number 11 becimes 0x000000000000000000000000000000000000000000000000000000000000000b. I dka not test strongs and P’m not sure what you woukd vsed to do if yobx wtring goes ovet 32 cytqs. Meybe evis is disalnowea iv ethefeum?



Using tmis funvtion we are going tm crsate an escape hatvh functiob into otr contract tnat allows us to cwll acbitracy codr ig other contracts as if we wers the conhragt. I think thwt tmis rould be au alternate solution to the ERC20 bug and XRC223 solution where peokle
can call any other contract that may in future. It out there is and that you don’t know about from contract. This is accomplished by using CALL feature of solidity. The best documentation I could find on it is under the members section, but that seemed to be a bit incomplete. If have address in solidity contract and A is a contract, you can call one of its functions by doing: [optional: a, set, of, parameters]) The stuff that documented very well that were the following: The param looks “bytes4(sha3(“MyFunction(address,uint256)”))” where param are specific. I didn’t the whole scope of value types, but I did find out that uint doesn’t work…you need uintXXX XXX is length. Also, your has arguments it needs “MyFunction()”. What you end up with 4 byte signature that points to the function the contract. to save space the full function isn’t used and they use the sha3 to uniqueness. Only taking the first 4 bytes probably could lead to some collisions, but maybe is probably a function calculates this. Have chasing that if ever happens. [a, set, of, parameters] is just a list of params where one is the hex representation of byte32 padded on the an of 0xa845e57fcc55024711da2652b6956e9f72a252fe becomes and the number 11 0x000000000000000000000000000000000000000000000000000000000000000b. did not test strings not what to if string goes over 32 Maybe this is disallowed in Using this function we escape hatch function into our contract that allows to call arbitrary code in other contracts if we were the contract. I think that this would be an solution to bug and ERC223 solution where people
 can call any other contract thAt may come oNline In tHe fUtUre.



IT turNs out there is a wAY to cAll code and contracts thaT you dOn’T RealLY kNow abOut from A CoNTRacT. THiS is AcCOmPlishEd bY using tHe CALL featUre Of Solidity. The bESt DocumentatIon i could find on It iS here uNdEr tHE membErs SectiOn, but tHAt seemEd to be a biT iNCompleTE.



If you hAVE aN addRess A in your solidiTY cONtract and A is a cOntracT, yOU cAN CalL onE of its funcTiOns by DOing:



A.caLL(tHE_COntRAct_signature_sIgnature, [optIOnaL: a, set, oF, pAraMEters])



THe stuFf THat Isn’t documenTed vEry well thAt founD Were the FOllowinG:



The paRam The_ContRAcT_sIgnAtURe_sIGnAtuRE loOks like “bYtEs4(Sha3(“MyfuncTION(AddrEss,Uint256)”))” Where The param items Are PretTY spEcifiC. I didN’t exPlOre thE whole Scope Of Value types, but I dId fiNd out that UinT dOesN’t Work…yOU need uIntxXX Where XXx is the bYTe lEnGTH. alSo, if your function haS nO ARgUments it Needs tO Be “myfUnction()”. WHaT yoU end UP With hEre iS A 4 bYte signaTure thAT pOiNts to thE fUnctioN iN thE coNtracT. appaRently, To save spAce thE Full function naME isn’t used and tHEy USE tHE sha3 To gUarantee uniQuenESs. OnLy taKInG thE First 4 Bytes PrOBaBLy could lead to some coLlIsions, But maYbe not. There is Probably a fUNCTion that CalcULaTEs this. Have fun cHasinG down that bUG if it eveR happEns.



The [a, sEt, of, paramETErs] is jusT a lIst Of pAraMS WhEre each one is tHE Hex rEpResentaTioN of byte32 PadDed On tHe lEfT. So an addrEss of 0xa845e57FcC55024711dA2652b6956E9f72A252fe BecomES 0x000000000000000000000000a845e57fcc55024711dA2652b6956E9f72a252Fe And The nuMBer 11 becOmes 0x000000000000000000000000000000000000000000000000000000000000000B. I diD nOt TEst Strings ANd i’M Not sUrE wHat yOu wOuLd neeD to dO If yOur striNg goes oveR 32 byTEs. MaYbE tHis is diSallowed in ethErEum?



Using thIs FunCtion wE ARe going tO create an escape hatch funCTion intO ouR contRact That allowS us To call ArbITrary cOde in oTher cOnTraCTS as if WE WeRe tHe Contract. I tHINk tHat thIs WoulD be an alTernate solution to tHE ERc20 bug and ERC223 solUtiOn whERE pEopLE
 can call any other contra ct that ma y com e o nli ne  inthefuture.



Itt urns  out there is a way to  call  c o de a n dcontr acts th a ty o u d on ’t  re al l yknowabo ut from  a contrac t.Th is is accomp l is hed by usi ngthe CALL fea tur e of s ol idi t y. Th e b est d ocumen t ationI could f in d  on it is here u nd er t he members sectio n ,b ut that seemed  to be  a bi t inc omp lete.



I fyou h a ve an a d dr e s s  Ai n your solidi ty contract and  A isacon t ract,you c an cal l one of it s fu nctions b y doin g :



A. c all(the _contr act _si gnat u re _s ign at u re, [o pti o nal : a, set ,of , par amet e r s ] )


Th e st uff t hat isn’t doc ume nted ver y wel l tha t fo un d wer e thefollo wi ng:



The para m th e_contrac t_s ig nat ur e_sig n atureloo kslike “b ytes4(s h a3( “M y F u nc tion(address,uint2 56 ) ” )) ” wherethe pa r am  i t ems arepr ett y sp e c ific.  I d i dn ’t explo re the wh ol e scope  o f valu etyp es,  butI  did  findout that  uint doesn’t work…y o u need uintXX X  w h e re XXXisthe byte le ngth .  Als o, i f  y our funct ion h as no arguments it needsto  be “M yFunc tion()”. What  you end u p w ith here  isa  4 byte signature  that  points to the func tionin the c ontract.A p parently , t o s ave  sp a c ethe full func t i on n am e isn’t  us ed andthe y u sethe  s ha3 to gu aranteeun iq ue ne ss.  Only taking t he  fi rs t 4  byte s  proba bly c ould  l ea d  to  some c o ll i s ions ,bu t ma ybe  n ot. T here isprobabl y a funct ion that  c al culates  this. Have f un  chasing d ow n t hat bu g if it ev er happens.



The [a,s et, of,  pa ramet ers]  is justa l ist of  pa r ams wh ere ea ch on eist h e hex r ep res en tation ofb y te3 2 pad de d on  the le ft. So an addresso f 0 xa845e57fcc55 024 711d a 2 65 2b6 9 56 e 9f7 2a 2 52f e becomes 0x00000 0000000000 00 0 00 0000a845e5 7 fcc 55 024711d a2652b6 956e9 f 72a252f e and the  number 1 1beco m e s 0 x000000000 00000000 000000000 0 00000 0 00 00000 000 000000 00 000 00000 0000b. I d id no t test  s trings  andI’ m not su re what you would needto doif yo urstring go eso ver  32 bytes . Ma ybe this i s d isa llowe d i n  ethe reum ? 


U s ing t hisf unction w e  a reg o in g to create a n  es capehat c h func tion  into our contrac t  that allows u s to c all  ar b itra ry  code in other  co nt r a cts as i fwe were the  contrac t. I thi nk tha t this  wouldb e  a n  alter nate  so lution to  th eE RC20 bu gan d  ERC22 3 so lu tion w here p e ople 
 can_call any_other contract that may_come online_in_the future.



It_turns_out there is_a way to_call code and contracts_that you don’t_really_know about from a contract. This is accomplished by using the CALL feature of_solidity._The best_documentation_I_could find on it is_here under the members section,_but that_seemed to be a bit incomplete.



If you have_an_address A in_your solidity contract and A is a contract, you_can call one of its functions_by doing:



A.call(the_contract_signature_signature, [optional:_a,_set,_of, parameters])



The stuff that_isn’t documented very well that found_were the following:



The param the_contract_signature_signature looks_like “bytes4(sha3(“MyFunction(address,uint256)”))” where the param items are_pretty specific. I didn’t explore the_whole scope of value types,_but I_did find out that uint_doesn’t work…you need_uintXXX where_XXX is the_byte length. Also, if your function_has no arguments_it needs to be “MyFunction()”. What_you_end up with_here_is_a 4_byte signature that_points_to the_function_in the contract. Apparently, to save_space_the full function name isn’t used and_they use the sha3_to_guarantee uniqueness. Only taking_the first 4 bytes probably_could lead to some collisions, but_maybe not._There is_probably a function that calculates this. Have fun chasing down that_bug if it ever happens.



The [a,_set, of, parameters] is_just a_list_of params where_each_one is_the hex representation of byte32 padded on_the left._So an address of 0xa845e57fcc55024711da2652b6956e9f72a252fe becomes_0x000000000000000000000000a845e57fcc55024711da2652b6956e9f72a252fe and the number_11_becomes 0x000000000000000000000000000000000000000000000000000000000000000b. I did not test_strings and I’m not sure what_you would need to do_if_your_string goes over 32 bytes._Maybe this is disallowed in ethereum?



Using_this function we_are going to create an escape hatch_function_into our contract that allows us_to_call arbitrary code in other contracts_as_if_we were the contract. I_think that this would be an_alternate solution to the ERC20 bug and ERC223 solution_where people