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-design-patterns]

The tag has no usage guidance.

2
votes
2answers
22 views

How do I transfer an arbitrary erc 721 asset from a smart contract?

I'm trying to work with ERC 721 tokens in such a way that my contract freezes and unfreezes them (based on some conditions) but I'm having trouble wrapping function calls to the ERC 721 token contract ...
0
votes
0answers
21 views

How can I pass struct from one contract to another?

I have two contracts and I'm trying to pass the struct data from one to another, I can do this by creating a mapping and having a uint input associated with that struct but I'd like to get the struct ...
0
votes
1answer
17 views

Gas Estimatation

I am little confuse in the concept of Gas Estimation and price. When i add new user i get popup through metamask for the transaction amount and gas used which is totally fine. I checked my code in ...
1
vote
1answer
40 views

unable to understand how to use internal function types

I need help to understand below code which is from solidity offical documents "how to use internal function types". as it is very confusing for me. How to use library in solidity. Some one explain ...
4
votes
1answer
3k views

TypeError: Data location must be “storage” or “memory” for parameter in function, but none was given

/// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param ...
1
vote
1answer
82 views

How to handle dynamic size string array in solidity?

I have a shop owner and a shop owner can have multiple products. I want to keep the products id in an array. Also, A public method can return all the product id list of a shop owner. I tried the ...
0
votes
1answer
33 views

Why doesn't Solidity throw an error for overflows? [duplicate]

It seems like there are going to be a lot of people that forget to check for integer overflows in Solidity. I am wondering if there is a reason why Solidity doesn't throw errors for integer overflows ...
0
votes
1answer
33 views

Return an array of mappings reflecting global state between struct associations?

I am looking for a construct that's something like "return an list of key value pairs," which I think would be implemented as an array of mappings. Is that right? That is, I'd like a data structure ...
2
votes
3answers
227 views

How to map an address with a string array in solidity?

Goal: I wish to store an array of names with an address in a smart contract. It's more like Key-Value pairs where addresses are paired with a list of type strings. Can I use mapping to implement this?...
-1
votes
2answers
29 views

Solidity Token Sale? [closed]

How to build solid code Token Sale External? For example SmartContract : 0x5bE7E9B948cd6d026585F72CC567879ffd0b629b With fuction - updateTokenPerEth No need time. Give me recommend code.
0
votes
2answers
71 views

How to deploy complex Ethereum app split into multiple contracts

If you develop a complex dApp and have to split it into separate individual contracts because of the deployment gas limit, What's a clean process/pattern for deploying and linking the individual ...
0
votes
0answers
24 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 ...