I am not able to store and retrieve some values of Float types from smart contract. I am about to store the values of IP Address, Geo-location, Mac address etc.. which all are of float types. I know float types are not currently supported in solidity, is there any work around for the same !
Smart Contract – Usage of Float Numbers in Solidity
ethereumjssolidity
Related Solutions
I am trying to create a smart contract that holds static data (resembling a paper contract) that is able to be sent around different users (a trade).
The contract itself cannot be sent to any particular user. It exists within the block chain and is accessible (its methods can be called) to any peer that synchronizes with that block chain.
The tricky part is that I would like different permissions for different account types such as requiring multiple people to authenticate the transaction (buyer, seller and middle-men).
All data in an account is publicly available. You won't be able to achieve any proper authentication using only the block chain (you need an secure side channel through which peers convey a shared secret).
What you could do on the other hand is employ secret sharing.
I am struggling to understand a few basic concepts and overall structure of the smart contracts in solidity.
You may have done this already but if not have a look at this demo and a few examples.
Do I create a "factory" contract that controls the system and assigns different users a 'role' and based on the role the contract will need to be verified by all the required users of each 'role' before being sent?
You can't really do that since contracts are public. What you can do, is filter users out by their address (check the msg.sender attribute at the beginning of each contract method).
I forgot to mention that as a contract is swapped between users, I am not really interested in any monetary representation to be exchanged.
Once deployed, the contract is mined and included in the block chain (it is a transaction after all). Afterwards, everyone accessing the block chain "has" the contract.
Firstly, great that you are learning more about DApps, it's always great to see the community growing. However, you do have some misunderstanding about the way the DApps should be designed, so I'll try to point you in the helpful direction.
Technology Used: Ruby on Rails (Back-End), React (Front end), Solidity(Smart Contract)
As pointed in this answer:
A DApp has its backend code running on a decentralized peer-to-peer network.
DApps by definition don't have classic backend, like the RoR would be. That means, in order for your application to be called DApp, the smart contracts should contain all your backend logic. The frontend could be any JavaScript, really, along with the web3 library that gives you the APIs to communicate with the smart contract backend.
This is a completely different paradigm, which I had problems wrapping my head around for quite some time. There are decentralized alternatives for some of the classic technologies, such as IPFS or Swarm for storage or hosting your DApp website on, "users" should be tied to blockchain addresses, you could use PouchDB, etc. The DApp should be fully open-source and autonomous.
If you wish to build the betting DApp, you really don't need to store user information in database - you can program the frontend and, for example, interact through the contract which sends the % of any bet to contract in your control and have sound business model while providing good service DApp users. But if you want each bet on blockchain, the transaction costs would sometimes prove too high. However, this doesn't mean that you can't have hybrid app - true DApps in their current state do have some limitations.
Working on Lemon Email, we had to weigh some of the benefits of the established technologies (SMTP server for example) along with the benefits of decentralized applications - so we decided to create the DApp to suit everyone. We used the Ethereum Blockchain to store metadata of our interactions, and IPFS as our storage. If you wish, you can read more about our architecture here.
Some additional reading:
https://blog.ethereum.org/2014/05/06/daos-dacs-das-and-more-an-incomplete-terminology-guide/
https://www.packtpub.com/big-data-and-business-intelligence/mastering-blockchain
Best Answer
Yes, float is currently not supported in solidity. But you can decimals for that.
And honestly for storing IP address, geolaoctaion in conventional techs like Java, Node, float doesn't seem to a good choice. Float , int is suited when you need to perform some mathematical operations. Else you should store them as string.
You can choose String or bytes32 depending on your choice. See User string or bytes 32?