CRYPTO NEWS

Can you concatenate a string url in solidity before sending it to a Chainlink APi? I tried with this but it didn’t work

function requestFirstId( string memory _obid) public returns (bytes32 requestId) { Chainlink.Request memory req = buildChainlinkRequest(jobId, address(this), this.fulfill.selector); obj= _obid;

    req.add('get', 'string.concat(https://5fes4djdoxic.usemoralis.com:2053/server/functions/getid?_ApplicationId=yourMoralisAppId&objectId=,obj)'); 

Parameter function in Solidity

I am a newbie in Solidity. Below is the snippet of code I came across :- pragma solidity ^0.4.0; contract C { //1 function f(uint len) { // value passed to len = 7 //2 uint[] memory a = new uint[](7); //3 bytes memory b = new bytes(len); //4 // Here we have a.length ==::Listen

I am a newbie in Solidity. Below is the snippet of code I came across :-

pragma solidity ^0.4.0; contract C {                                           //1     function f(uint len) {                 // value passed to len = 7          //2          uint[] memory a = new uint[](7);                                       //3         bytes memory b = new bytes(len);                                       //4     // Here we have a.length == 7 and b.length == len a[6] = 8;                     // 5     } } 

I am unable to understand why (7) is written after new uint[] in RHS of line 3. Moreover bytes is a data type of fixed length i.e bytes1 , then how did they created a new instance of it with length equal to len . At last what is meant by this b.length == len a[6] = 8 in line 5 .

Can you concatenate a string url in solidity before sending it to a Chainlink APi? I tried with this but it didn’t work

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