How to get the world position of the edge of an object?

Code Example - How to get the world position of the edge of an object?

                
                        Vector3 offset = transform.up * (transform.localScale.y / 2f) * -1f; 
Vector3 pos = transform.position + offset; //This is the position