Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [solidity-patterns]

The tag has no usage guidance.

1
vote
1answer
43 views

Issue in type conversion : Explicit type conversion not allowed from unit256 to bytes1

I am trying to convert the unit to string using the method. I have the "TypeError" in the line. Please check the screen shot below for the error message. function uint2str(uint i) internal pure ...
0
votes
1answer
24 views

Circular reference error in factory contract pattern

I've used the factory model before, but I've never encountered a circular reference error, and I'm having trouble seeing how this could be a circular reference when I'm creating a brand new ...
1
vote
2answers
55 views

Passing Struct as an argument in call

I am trying to pass a struct as an argument while calling the function of another contract: pragma solidity ^0.4.24; pragma experimental ABIEncoderV2; library Test { struct TStruct { int x; ...
2
votes
1answer
24 views

What about calls you can do safely in constructor?

As a matter of fact, there is more than one discussion about what are the call you can safely do in the constructor. Someone thinks “avoid all external call”, some other says “avoid to use ‘this’ or ...
1
vote
1answer
39 views

Data persistence in ethereum smart contract across deployments

I have developed a SmartContract using ethereum which has an internal struct to store some of the privilege mapping. I find that whenever there is any change in the smart contract and the deployment ...
2
votes
0answers
38 views

Interacting with a complex deployed contract from my other contract

For example, I want to call a create market function from augur in my contract. I'm using the recommended pattern, but there are additional contracts that this function brings in, ex ICash, IMarket ...
0
votes
0answers
26 views

Strange question about call triggering out of gas

pragma solidity ^0.4.23; contract hello{ uint time; function getInfo(address a, uint b, address c, bytes d) returns(bool){ time = now + b; return true; } } contract test{...
3
votes
1answer
109 views

Purpose of the function with the contract's name?

What is the purpose of the WithdrawalContract function in this case? If becomeRichest doing exactly same but with a certain condition and adding a pending withdrawal to the pendingWithdrawals.
2
votes
2answers
257 views

How to transfer Ether to ERC20 token contract?

I have a function that needs to make transfers to a token smart contract as well as personal accounts upon satisfaction of some conditions. function completeSale() onlyOwner public { if (...
0
votes
0answers
25 views

Why is Checks Effects Interactions pattern called Checks Effects Interactions pattern?

Why is Checks Effects Interactions pattern called Checks Effects Interactions pattern? Perhaps External interactions Pattern or External Call Pattern is a better term? In short this pattern is ...