smart contract_research_Rookie
  • Member for 1 year, 4 months
  • Last seen more than a month ago
I need to understand a line of code inside a contract => startTime: _startTime == 0 ? currentTime() : _startTime
1 votes

if( _startTime == 0) { startTime = currentTime() } else { startTime = _startTime }

View answer
Solidity How to pre-populate an Array with default values
1 votes

In your example. You may create another map to record the init price, the key is unint256 key = tokenID/50, the value is the init price. Then the size of the map changes from 5000 to 100. mapping (...

View answer
Contract to Contract Execution Visiblity
Accepted answer
1 votes

If contract A or B does not emit the event with information, the return information cannot be seen. The original caller can be got by tx.origin.

View answer
I ran into an error when using Pragma Solidity 0.4.24
Accepted answer
1 votes

By https://www.trufflesuite.com/docs/truffle/reference/configuration says, set the compile version in truffle.js module.exports = { compilers: { solc: { version: <string>, // A ...

View answer
Using solc command to compile a single sol file locally
0 votes

you can use the solc-select tool to install all versions of Solidity compiler https://github.com/crytic/solc-select

View answer
Link a library to a smart contract only with Solidity and bytecode
0 votes

Just compile the code and deploy contract B, no need to do the link thing. The library code will copy to contract B automatically by the compiler.

View answer
What is the Intent of smart contract and decentralization
0 votes

You have already got the key benefits of Smart Contract:public and fixed. public means no secret deal fixed means everyone has to perform the contract If you have ever done a civil engineering ...

View answer
In Solidity, trigger function and send ether at the same time
0 votes

The code looks like implement.triggerThisFunction{value: 10, gas: 800}(1); and you can get details from https://docs.soliditylang.org/en/v0.8.4/control-structures.html?highlight=contract%20%20%20%...

View answer
Can not deploy source code (Flatter Solidity file which I copy from Etherscan) on Remix ! Any helps?
0 votes

I see your code and the contract SAFEMARS depends on the IUniswapV2Router02 contract at the address 0x05fF2B0DB69458A0750badebc4f9e13aDd608C7F. I guess maybe you should have to create the ...

View answer
How to make modifier for authorization of nested mapping addresses
0 votes

if you want to traverse all address, may use a map from address to an array, but this costs a lot of gas. If you only want to tell whether the address already exists, maybe use another map to maintain ...

View answer
How to build an AST for Solidity?
0 votes

I have used 3 tools, maybe you can try: https://github.com/iamdefinitelyahuman/py-solc-ast https://github.com/ConsenSys/solc-typed-ast https://github.com/ethereum/solidity/tree/develop/docs/grammar

View answer